Skip to content

feat(subagent): add configurable subagent model/provider (#609)#751

Closed
Bartok9 wants to merge 1 commit into
NousResearch:mainfrom
Bartok9:feat/609-configurable-subagent-model
Closed

feat(subagent): add configurable subagent model/provider (#609)#751
Bartok9 wants to merge 1 commit into
NousResearch:mainfrom
Bartok9:feat/609-configurable-subagent-model

Conversation

@Bartok9

@Bartok9 Bartok9 commented Mar 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements #609 — Allow configurable subagent model in config.yaml

Changes

  1. Add subagent section to DEFAULT_CONFIG with optional model/provider fields
  2. Update delegate_tool.py to read from subagent config when spawning child agents

Config Structure

# config.yaml
subagent:
  # Provider for subagent model (optional — defaults to parent's provider)
  # provider: openrouter
  
  # Model to use for subagents spawned by delegate_task
  # A fast/cheap model is recommended since subtasks are narrowly scoped
  # model: google/gemini-3-flash-preview

Precedence

  1. Explicit model passed via tool call (highest)
  2. config.subagent.model
  3. Parent agent's model (inherit - current behavior)

This matches the existing pattern used by compression.summary_model.

Use Cases

  • Cost savings: Run main agent on Opus, delegate subtasks to Gemini Flash
  • Speed: Use faster models for narrowly scoped subagent tasks
  • Provider flexibility: Use different provider for subagents (e.g. main on Nous Portal, subagents on OpenRouter)

Testing

  • All modified files compile (py_compile)
  • Backwards compatible (defaults to parent's model if not configured)

…h#609)

- Add 'subagent' section to DEFAULT_CONFIG with model/provider options
- Update delegate_tool.py to read from subagent config
- Precedence: explicit model arg > config.subagent.model > parent model
- Same pattern as compression.summary_model for consistency

Example config:
  subagent:
    provider: openrouter
    model: google/gemini-3-flash-preview

Closes NousResearch#609
teknium1 pushed a commit that referenced this pull request Mar 11, 2026
Allow users to configure a dedicated model for subagents spawned by
delegate_task, so narrowly-scoped subtasks can use a cheaper/faster
model while the parent agent runs on a more powerful one.

Config:
  subagent:
    model: google/gemini-3-flash-preview

Precedence: explicit model arg > config.subagent.model > parent model.

Cherry-picked from PR #751 by Bartok9, rebased onto current main
with conflict resolution and simplified to model-only override
(provider/base_url/api_key stay inherited from parent — covers the
common case of same-provider model swap via OpenRouter).

Closes #609

Co-authored-by: Bartok Moltbot <bartokmoltbot@users.noreply.github.com>
@teknium1

Copy link
Copy Markdown
Contributor

Thanks for this PR! The concept is exactly right, but the branch was 830 commits behind main with merge conflicts.

Cherry-picked your commit with authorship preserved into PR #896, rebased onto current main. Simplified to model-only override (the provider swap without base_url/api_key resolution would break cross-provider cases — keeping it to model swap covers the 95% use case of same-provider model routing via OpenRouter).

Your commit shows as authored by you in git history. 🙏

@teknium1 teknium1 closed this Mar 11, 2026
angelburgosrosado pushed a commit to angelburgosrosado/hermes-agent that referenced this pull request Apr 28, 2026
Allow users to configure a dedicated model for subagents spawned by
delegate_task, so narrowly-scoped subtasks can use a cheaper/faster
model while the parent agent runs on a more powerful one.

Config:
  subagent:
    model: google/gemini-3-flash-preview

Precedence: explicit model arg > config.subagent.model > parent model.

Cherry-picked from PR NousResearch#751 by Bartok9, rebased onto current main
with conflict resolution and simplified to model-only override
(provider/base_url/api_key stay inherited from parent — covers the
common case of same-provider model swap via OpenRouter).

Closes NousResearch#609

Co-authored-by: Bartok Moltbot <bartokmoltbot@users.noreply.github.com>
CumulusService pushed a commit to Cumulus-Service-GmbH/hermes-agent that referenced this pull request May 30, 2026
Allow users to configure a dedicated model for subagents spawned by
delegate_task, so narrowly-scoped subtasks can use a cheaper/faster
model while the parent agent runs on a more powerful one.

Config:
  subagent:
    model: google/gemini-3-flash-preview

Precedence: explicit model arg > config.subagent.model > parent model.

Cherry-picked from PR NousResearch#751 by Bartok9, rebased onto current main
with conflict resolution and simplified to model-only override
(provider/base_url/api_key stay inherited from parent — covers the
common case of same-provider model swap via OpenRouter).

Closes NousResearch#609

Co-authored-by: Bartok Moltbot <bartokmoltbot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants