Model Routing
Purpose
How Hermes selects providers, applies combos, and enforces context limits.
Current Flow
- Main path:
custom:litellm→http://litellm:4000/v1 - Default model:
freellmapi-auto - OmniRoute used for auxiliary roles: vision, skills_hub, approval, mcp, title_generation, web_extract, compression
Context Enforcement
- Three layers: model native → combo
data.config.context_length→ Hermes client cap - Effective context is the minimum of the three
Combo Behavior
priorityretries same provider up tomaxRetries, then errors; it does NOT fall throughfill-firstwalks the list on failureauto/lkgprecalculates per request using health scoring- Same-provider entries in a combo share rate-limit buckets
- Session affinity caches provider in
session_model_history
Aliases and Mappings
- Model aliases resolved via
key_valuetable (modelAliasesnamespace) - Wildcard mappings via
model_combo_mappings - OpenCode/Zen entries may resolve back to
opencode-zenprovider internally
History
- User-provided: OpenRouter was used previously; provider lists now centered on LiteLLM + OmniRoute
- User-provided:
persist_switch_by_default=false;/modelis per-session unless--globalused - Inferred: Configuration undergoes periodic corrections related to vision, model fallback, and browser backend tuning