48 lines
1.7 KiB
Markdown
48 lines
1.7 KiB
Markdown
---
|
|
title: Model Routing
|
|
type: concept
|
|
status: active
|
|
created: 2026-07-22
|
|
updated: 2026-07-22
|
|
verified_on: 2026-07-22
|
|
confidence: high
|
|
tags: [routing, model, inference]
|
|
sources: [raw/configs/hermes-config-sanitized.txt, current-profile.md]
|
|
---
|
|
|
|
# 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
|
|
- `priority` retries same provider up to `maxRetries`, then errors; it does NOT fall through
|
|
- `fill-first` walks the list on failure
|
|
- `auto`/`lkgp` recalculates 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_value` table (`modelAliases` namespace)
|
|
- Wildcard mappings via `model_combo_mappings`
|
|
- OpenCode/Zen entries may resolve back to `opencode-zen` provider internally
|
|
|
|
## History
|
|
- User-provided: OpenRouter was used previously; provider lists now centered on LiteLLM + OmniRoute
|
|
- User-provided: `persist_switch_by_default=false`; `/model` is per-session unless `--global` used
|
|
- Inferred: Configuration undergoes periodic corrections related to vision, model fallback, and browser backend tuning
|
|
|
|
## Related
|
|
- [[model-providers]]
|
|
- [[systems/omniroute]]
|
|
- [[openrouter]]
|