hermes - 💡(How to fix) Fix Add first-class per-turn and per-tool-call model overrides [1 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Root Cause

This gives Hermes one shared primitive for dynamic model selection instead of each surface solving it differently. It also creates a clean foundation for future natural-language routing and recommendation features without making the first implementation depend on an intelligent router.

Fix Action

Fixed

Code Example

provider: openai | anthropic | openrouter | xai | ...
model: gpt-image-2 | claude-sonnet-... | ...
api_mode: optional
base_url: optional
api_key: optional/resolved
scope: once | tool_call | session | global
target: chat | image_generate | video_generate | auxiliary.<task>
RAW_BUFFERClick to expand / collapse

Problem

Hermes supports model switching today, but the paths are split:

  • /model can hot-swap the live chat session.
  • --global and dashboard model settings persist to config.yaml.
  • image_generate and some auxiliary paths read provider/model from config at call time.
  • Auxiliary tasks can be pinned through auxiliary.<task>.{provider,model}.

This works, but it is still not a unified dynamic routing model. Users naturally ask things like:

  • “Use Claude for this task.”
  • “Generate this image with GPT-Image-2.”
  • “Try Grok Imagine for this one.”
  • “Use a cheaper model for the next summary.”

Today those requests are just normal text unless the user knows the exact slash command or config surface. Tool calls like image_generate also do not have a first-class provider / model override, so changing the backend usually means editing config instead of scoping the choice to one output.

Proposal

Introduce a unified runtime model override mechanism with explicit scope:

  • once: applies to the next assistant turn only.
  • tool_call: applies to one tool invocation, e.g. image/video generation.
  • session: applies to the current live session, equivalent to /model session-only behavior.
  • global: persists to config.yaml, equivalent to /model --global.

The override should carry:

provider: openai | anthropic | openrouter | xai | ...
model: gpt-image-2 | claude-sonnet-... | ...
api_mode: optional
base_url: optional
api_key: optional/resolved
scope: once | tool_call | session | global
target: chat | image_generate | video_generate | auxiliary.<task>

Why this matters

This gives Hermes one shared primitive for dynamic model selection instead of each surface solving it differently. It also creates a clean foundation for future natural-language routing and recommendation features without making the first implementation depend on an intelligent router.

Suggested implementation path

  1. Extract the live-session /model switching result into a reusable runtime override object.
  2. Add a small override store on the session/agent runtime for once and tool_call scoped overrides.
  3. Extend generation tool schemas, starting with image_generate, to accept optional provider and model.
  4. Route tool-level overrides through the same provider registry/config resolution used by existing image/video providers.
  5. Keep natural-language parsing out of the first PR, but make it possible for a later command or router to set the same override object.

Acceptance criteria

  • /model <model> --provider <provider> continues to work as today.
  • A user can request one image with a specific image model without changing config.yaml.
  • A one-turn chat override does not persist into later turns.
  • Session-scoped switching still updates the live agent client, context compressor, and _primary_runtime.
  • Dashboard/global config writes remain new-session-only unless routed through the live session override path.
  • Tests cover chat session switch, one-turn override cleanup, and image-generation provider/model override.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix Add first-class per-turn and per-tool-call model overrides [1 pull requests]