ArgentOSDocs

Model Router

Complexity scoring, tier routing, and configuration overrides for the ArgentOS model router.

Overview

The model router sits between the agent runtime and the LLM API. For each request, it scores the complexity of the task and routes it to the appropriate model tier. This happens transparently -- the agent does not need to know which model it is talking to.

Complexity Scoring

Each incoming message is scored on a 0-1 scale based on several signals:

SignalWeightDescription
Message lengthMediumLonger messages suggest more complex tasks
Tool usage contextHighRequests involving tools score higher
Conversation depthMediumDeep multi-turn conversations score higher
Keyword signalsLowWords like "analyze", "plan", "compare" boost score
Memory recall+0.25Memory queries get a minimum boost to reach Haiku

Tier Routing

The score maps to a tier:

0.0 ─────── 0.3 ─────── 0.5 ─────── 0.8 ─────── 1.0
   LOCAL        FAST       BALANCED      POWERFUL

LOCAL Tier

  • Model: Qwen3 30B-A3B instruct via Ollama
  • Cost: Free (runs locally)
  • Limitations: Cannot use tools, cannot leverage injected memory context
  • Best for: Quick factual replies, greetings, simple queries

FAST Tier

  • Model: Claude Haiku
  • Cost: Low
  • Best for: Memory recall, simple tool use, straightforward Q&A

BALANCED Tier

  • Model: Claude Sonnet
  • Cost: Medium
  • Best for: Most conversations, multi-tool workflows, code generation

POWERFUL Tier

  • Model: Claude Opus
  • Cost: High
  • Best for: Complex reasoning, multi-step planning, creative writing

Configuration

Override tier models and thresholds in argent.json:

{
  "agents": {
    "defaults": {
      "modelRouter": {
        "enabled": true,
        "tiers": {
          "local": {
            "model": "qwen3:30b-a3b",
            "maxScore": 0.3
          },
          "fast": {
            "model": "claude-haiku-4-20250514",
            "maxScore": 0.5
          },
          "balanced": {
            "model": "claude-sonnet-4-20250514",
            "maxScore": 0.8
          },
          "powerful": {
            "model": "claude-opus-4-20250514"
          }
        }
      }
    }
  }
}

Config overrides take precedence over code defaults.

Disabling the Router

Set enabled: false to always use the default model:

{
  "modelRouter": {
    "enabled": false
  }
}