Documentation
¶
Overview ¶
Package model centralises model selection for the agent loop.
Priority order (mirrors getRuntimeMainLoopModel in the TS source):
- Runtime /model override (highest)
- ANTHROPIC_MODEL env var
- CLAUDE_CODE_MODEL env var
- settings.json "model" field (via SetDefault at startup)
- Default constant
The default matches the model shipped in Claude Code 2.1.126.
Index ¶
Constants ¶
const Default = "claude-opus-4-7"
Default is the hardcoded fallback model. Matches Claude Code 2.1.126.
const Fast = "claude-sonnet-4-6"
Fast is the faster/cheaper model used when /fast is active. Mirrors getSmallFastModel() — Sonnet for fast responses.
const MaxTokens = 16000
MaxTokens is the default max_tokens value for /v1/messages. Real CC uses 16000 for the main loop; we match that.
Variables ¶
var ThinkingBudgets = map[string]int{
"low": 1000,
"normal": 0,
"high": 8000,
"max": 16000,
}
ThinkingBudgets maps effort levels to token budgets. Mirrors the thinking budget constants from the real CLI.
Functions ¶
func Resolve ¶
func Resolve() string
Resolve returns the model name to use, applying priority order.
func SetDefault ¶
func SetDefault(name string)
SetDefault sets the model from settings.json. Called once at startup before any goroutines read Resolve(). Lower priority than env vars.
func SetOverride ¶
func SetOverride(name string)
SetOverride sets the runtime model override (from /model slash command).
Types ¶
This section is empty.