- Get Started

Extending: Custom Models

Custom model entries let you define aliases, document context windows, and tag cost tiers without changing the orchestrator. The model registry is optional; if a model is absent, the orchestrator passes the raw model string through to the Coder AI Gateway.

Why Add Model Entries

  1. Stable aliases - Switch model versions in one place (e.g., claude-sonnetclaude-sonnet-4-20250514)
  2. Context window hints - Inform the planner about token limits
  3. Cost tracking - Tag cost tiers (low/medium/high) for budgeting dashboards
json
{
  "models": [
    {
      "id": "claude-sonnet-4-20250514",
      "provider": "anthropic",
      "aliases": ["claude-sonnet", "sonnet"],
      "context_window": 200000,
      "cost_tier": "high"
    },
    {
      "id": "gpt-4.1",
      "provider": "openai",
      "aliases": ["gpt-4-1"],
      "context_window": 1000000,
      "cost_tier": "high"
    },
    {
      "id": "gpt-4o-mini",
      "provider": "openai",
      "aliases": [],
      "context_window": 128000,
      "cost_tier": "low"
    }
  ]
}
FieldTypeDescription
idstringCanonical model identifier used in agents.{"{role}"}.model.
providerstringProvider slug that hosts this model.
aliasesarrayAlternative names that resolve to this model.
context_windowintApproximate context window in tokens. Used by planner to estimate fit.
cost_tierstringlow, medium, or high. Used for cost warnings.

Configure in Coder Dashboard

Models must be configured in the Coder dashboard (AI Settings → Coder Agents → Models) before they can be used. The registry.json model entries only provide metadata; the actual provider credentials live in Coder.

Provider slugs

The agents.{role}.provider value must match a provider slug configured in the Coder AI Gateway. Common slugs: anthropic, openai, google, fireworks, groq.