Summary
Adopt models.dev (https://models.dev) as the primary source for LLM model metadata instead of maintaining a static provider.json file. This would keep the model registry automatically up-to-date with pricing, capabilities, and context limits.
Context
Currently, forgecode maintains a static provider.json file (~3200 lines) with hardcoded model definitions. This requires manual updates when new models are released.
I analyzed how Dexto (another AI coding assistant) handles this - they sync from models.dev at build time.
Current Approach (forgecode)
- Static
crates/forge_repo/src/provider/provider.json embedded at compile time
- Some providers dynamically fetch models from their APIs at runtime
- Manual updates required for new models
- No pricing information
Proposed Approach (use models.dev)
- Fetch model catalog from
https://models.dev/api.json at build time
- Generate a Rust file similar to Dexto's
models.generated.ts
- Automatically includes:
- Model IDs and names
- Context limits (input/output tokens)
- Pricing (input/output per million tokens, cache pricing, reasoning pricing)
- Modalities (text, image, audio, video, pdf)
- Capabilities (reasoning, tool_call, temperature support)
- Release dates and status
Benefits
- Always up-to-date - New models automatically available after running sync script
- Rich metadata - Pricing, modalities, and capabilities come free
- Less maintenance - No manual updates needed for model list
- Cross-provider - Single source for all providers (OpenAI, Anthropic, Google, etc.)
Implementation Suggestion
Create a scripts/sync-llm-registry.ts (or .rs) that:
- Fetches
https://models.dev/api.json
- Filters models by provider-specific rules (e.g., OpenAI →
gpt-*, o*)
- Generates a Rust file with
MODELS_BY_PROVIDER constant
- Add to CI to verify registry is up-to-date
Reference
- Dexto's implementation:
scripts/sync-llm-registry.ts
- Dexto's generated file:
packages/core/src/llm/registry/models.generated.ts
Todo
Summary
Adopt models.dev (https://models.dev) as the primary source for LLM model metadata instead of maintaining a static
provider.jsonfile. This would keep the model registry automatically up-to-date with pricing, capabilities, and context limits.Context
Currently, forgecode maintains a static
provider.jsonfile (~3200 lines) with hardcoded model definitions. This requires manual updates when new models are released.I analyzed how Dexto (another AI coding assistant) handles this - they sync from models.dev at build time.
Current Approach (forgecode)
crates/forge_repo/src/provider/provider.jsonembedded at compile timeProposed Approach (use models.dev)
https://models.dev/api.jsonat build timemodels.generated.tsBenefits
Implementation Suggestion
Create a
scripts/sync-llm-registry.ts(or .rs) that:https://models.dev/api.jsongpt-*,o*)MODELS_BY_PROVIDERconstantReference
scripts/sync-llm-registry.tspackages/core/src/llm/registry/models.generated.tsTodo