hermes-delegate-routing
A fork-free Hermes Agent plugin that adds explicit per-task model / provider routing to delegate_task.
Route each subagent in a batch delegation to a different model/provider:
delegate_task(tasks=[
{"goal": "Summarize these logs", "model": "gemini-flash-2.0", "provider": "openrouter"},
{"goal": "Review this diff for bugs", "model": "sonnet", "provider": "anthropic"},
{"goal": "Research the CVE", "model": "deepseek-pro", "provider": "deepseek"}
])
Per-task delegate routing was proposed upstream and not accepted; this plugin
delivers it as a standalone package, so there is no fork to maintain. Full design
and rationale: docs/DESIGN.md.
Install
Install into the same environment as your hermes-agent, then enable it.
pip install hermes-delegate-routing
# or, for development from a checkout:
pip install -e /path/to/hermes-delegate-routing
The pip entry point (hermes_agent.plugins) makes hermes-agent auto-discover the
plugin; you still have to enable it in config.yaml:
plugins:
enabled: [delegate_routing]
# optional:
delegate_routing:
on_error: fail # "fail" (default) → a bad model/provider fails the call;
# "fallback" → skip the override, use batch creds, log a warning
No allow_tool_override grant is needed — the plugin does not use the registry
override API (see "How it works").
Usage
Put routing fields inside tasks[] — even for a single task:
delegate_task(tasks=[{"goal": "…", "model": "sonnet", "provider": "anthropic"}])
model— a model name/alias as used by/model(e.g.sonnet,gemini-flash-2.0), optionally with inline--provider <id>.provider— a configured provider id. Prefer this structured field over embedding--providerinmodel.- Precedence: per-task
tasks[i]→delegation.*config → parent agent. - A task with no
model/providerinherits the normal delegation model.
Top-level delegate_task(model=…, provider=…) is intentionally not supported —
the host drops top-level args before the tool runs, so only tasks[] fields take
effect. This matches the recommended call shape (see docs/DESIGN.md).
How it works
delegate_task is special-cased in the host runtime
(agent/agent_runtime_helpers.py) to bypass the tool registry, so the sanctioned
register_tool(override=True) mechanism can't intercept it. Instead the plugin
installs three narrow, idempotent monkeypatches on tools.delegate_tool at load:
- schema — advertise
tasks[].model/tasks[].providerto the model (via the registeredToolEntry); - capture — wrap
delegate_taskto resolve per-task creds (reusing the host/modelswitch pipeline) and stash them by task index; - apply — wrap
_build_child_agentto inject those creds per child.
If the host isn't importable or its function signatures don't match,
apply_patches() refuses to patch and the plugin degrades to a no-op — core
behavior is never left half-patched. See docs/DESIGN.md.
Supported versions
Verified against upstream NousResearch/hermes-agent:
| hermes-agent | Status |
|---|---|
0.19.0 (tag v2026.7.20) |
✅ verified — seams, resolver, Tier-1 end-to-end routing, and the real host plugin-loader path all exercised against the host |
0.18.0 |
✅ verified (earlier release) |
Because the plugin depends on host internals, new hermes-agent releases can drift. The signature guard turns drift into a safe no-op with a loud log, not a crash. File an issue if you hit an INACTIVE warning on a newer version.
Development
uv run --extra dev pytest # unit tests (no host needed; uses fakes)
uv run --extra dev ruff check . # lint
uv run --extra dev mypy # type-check
# host-backed tests (integration smoke + Tier-1 e2e) against a real host —
# they self-skip when no host is importable:
PYTHONPATH=/path/to/hermes-agent:. \
/path/to/hermes-agent/.venv/bin/python -m pytest tests/test_integration_smoke.py tests/test_e2e_routing.py
The host-backed tests also run in CI as an opt-in e2e job — see
docs/CI_E2E_TESTING.md.
License
MIT
Release files for hermes-delegate-routing 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| hermes_delegate_routing-0.1.2.tar.gz | 22.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| hermes_delegate_routing-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 36.0 kB
Release files / hermes_delegate_routing-0.1.2.tar.gz
| Download URL | hermes_delegate_routing-0.1.2.tar.gz |
|---|---|
| Size | 22.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7d8dbec36dd3752ab105e91a44d6a009007594ba5c96beada85e5c0c274fc1f8
|
|
BLAKE2b-256 checksum How to use checksums |
e0cb56ddeeee1d0db3f7b1e1ec469b58f8f2516b675194f35aebac36eddfebfb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 24, 2026.
Transparency logRelease files / hermes_delegate_routing-0.1.2-py3-none-any.whl
| Download URL | hermes_delegate_routing-0.1.2-py3-none-any.whl |
|---|---|
| Size | 13.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6e8643065602f05fd1869d1db6ae5ffef76a6632779147e26ef9560c8258179f
|
|
BLAKE2b-256 checksum How to use checksums |
7457ea7c5e0087af9199c3e5fed1b7aaddc85773371f423455f28a06899ef6f0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 24, 2026.
Transparency log