Skip to content

feat: fetch CommandCode model catalog dynamically - #9

Open
whitedotjsx wants to merge 1 commit into
dev2k6:mainfrom
whitedotjsx:main
Open

feat: fetch CommandCode model catalog dynamically#9
whitedotjsx wants to merge 1 commit into
dev2k6:mainfrom
whitedotjsx:main

Conversation

@whitedotjsx

Copy link
Copy Markdown
  • /v1/models returns the live model catalog (68 models) fetched from the official CommandCode docs registry, refreshed every 6h, with the static list as fallback
  • MapModel now resolves against the catalog (exact ids, short names, punctuation-insensitive), keeping the static alias table as fallback
  • Adds catalog.go/catalog_test.go with unit tests; all tests pass

- Fetch the official model list from the CommandCode docs registry
  (https://commandcode.ai/docs/reference/cli/models) on startup and every 6h
- /v1/models now returns the live catalog (68 models) with the static
  list as fallback until the first fetch completes
- MapModel resolves against the catalog: exact ids, short names
  (kimi-k2.5 -> moonshotai/Kimi-K2.5) and punctuation-insensitive
  matches (gemini38flash -> google/gemini-3.8-flash)
- Static alias table kept as fallback; add unit tests for parsing,
  resolution and fallback
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant