Skip to content

Feature Request: Dynamic model routing based on task complexity #30652

@cmissel

Description

@cmissel

Problem

Hermes Agent currently locks each session to a single model via config.yaml. This means every request — whether it's "what's the weather" or "design a microservices architecture" — goes through the same model at the same cost/latency.

There's no built-in way to route tasks to different models based on complexity, cost, or capability requirements.

Current Workaround

Users have to build their own routing layer using:

  1. prefill_messages_file — inject routing instructions into every session
  2. delegate_task — spawn subagents with different model overrides for complex tasks
  3. Manual skill management — maintain routing rules externally

This works but is fragile, requires significant setup, and duplicates logic that should be in core.

Proposed Solution

Add native dynamic model routing to Hermes Agent, for example:

Option A: Routing rules in config.yaml

model_routing:
  default: local/qwen3-6b  # cheap/free baseline
  
  rules:
    - match: "complexity > 7"
      provider: openrouter
      model: anthropic/claude-sonnet-4
    
    - match: "needs_vision"
      provider: openrouter  
      model: qwen/qwen3-vl-plus
    
    - match: "token_estimate > 5000"
      provider: openai-codex
      model: gpt-5.5

Option B: Agent-accessible model switching

Allow agents to call a tool like model_switch(provider, model) mid-session when they detect a task exceeds the current model's capabilities.

Option C: Delegation auto-routing

When delegate_task is called without explicit model override, automatically select an appropriate model based on task description complexity.

Benefits

  • Cost savings: Route simple queries to cheap/local models, complex work to frontier models
  • Better performance: Use specialized models for specific tasks (vision, coding, reasoning)
  • Improved UX: Users don't need to manually select models or maintain external routing skills
  • Competitive advantage: Other agent frameworks don't have this — it would be a differentiator

Current State

This feature gap means users either:

  1. Always use expensive frontier models (wasteful for simple tasks)
  2. Always use cheap models (fails on complex tasks)
  3. Build fragile workarounds with prefill + delegation

Related

  • The prefill_messages_file config option exists but isn't documented as a routing mechanism
  • delegate_task supports model overrides but requires manual decision-making
  • No built-in complexity assessment or task classification

Thanks for considering this — it would make Hermes significantly more practical for everyday use.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low — cosmetic, nice to havecomp/agentCore agent loop, run_agent.py, prompt buildertype/featureNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions