Skip to content

feat: extract models from command-code dist, load via models.json - #4

Merged
patlux merged 3 commits into
patlux:mainfrom
ninehills:main
May 26, 2026
Merged

feat: extract models from command-code dist, load via models.json#4
patlux merged 3 commits into
patlux:mainfrom
ninehills:main

Conversation

@ninehills

Copy link
Copy Markdown
Contributor
  • Add scripts/extract-models.ts to parse command-code npm dist file
  • Generate models.json (21 models, 15 pricing entries) with contextWindow and maxOutputTokens pre-filled; no nulls or hardcoded fallbacks in index.ts
  • Rewrite index.ts to load model list and costs from models.json
  • Cap gateway model maxOutputTokens at 65536 (API limit for Baseten/Vercel)
  • Add 'Update models' section to README documenting the generation flow
  • Add npm run extract-models script

ninehills and others added 3 commits May 25, 2026 16:37
- Add scripts/extract-models.ts to parse command-code npm dist file
- Generate models.json (21 models, 15 pricing entries) with contextWindow
  and maxOutputTokens pre-filled; no nulls or hardcoded fallbacks in index.ts
- Rewrite index.ts to load model list and costs from models.json
- Cap gateway model maxOutputTokens at 65536 (API limit for Baseten/Vercel)
- Add 'Update models' section to README documenting the generation flow
- Add npm run extract-models script
@patlux

patlux commented May 26, 2026

Copy link
Copy Markdown
Owner

Thanks @ninehills for opening this and adding the updated model list. I pushed two follow-up commits on top of your PR:

  • switched model discovery from a committed/generated models.json to live fetching from https://api.commandcode.ai/provider/v1/models at startup
  • removed the command-code package/dist extractor and models.json from the package
  • added COMMANDCODE_MODELS_URL for tests/local mocks
  • updated the README model-discovery docs
  • added parser coverage and updated the local pi integration test to mock the model-list endpoint and assert Qwen/Qwen3.7-Max

Verified locally: npm run format:check, npm run typecheck, and npm test all pass. Merging this now.

@patlux
patlux merged commit 5d42778 into patlux:main May 26, 2026
@patlux patlux mentioned this pull request May 26, 2026
@patlux

patlux commented May 26, 2026

Copy link
Copy Markdown
Owner

Shipped in pi-commandcode-provider@0.1.1 / tag v0.1.1.

Install/update via:

pi update npm:pi-commandcode-provider
# or pin explicitly
pi install npm:pi-commandcode-provider@0.1.1

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.

2 participants