Skip to main content

get_model_name

Function get_model_name 

Source
pub fn get_model_name(config: Option<&Config>) -> Option<String>
Expand description

Get the model name using the following priority:

  1. CHANT_MODEL env var (explicit override)
  2. ANTHROPIC_MODEL env var (Claude CLI default)
  3. defaults.model in config
  4. Parse from claude --version output (last resort)

Model names are normalized to shorthand (e.g., “claude-sonnet-4-20250514” -> “sonnet”).