Skip to main content

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 --provider in model.
  • Precedence: per-task tasks[i]delegation.* config → parent agent.
  • A task with no model/provider inherits 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:

  1. schema — advertise tasks[].model / tasks[].provider to the model (via the registered ToolEntry);
  2. capture — wrap delegate_task to resolve per-task creds (reusing the host /model switch pipeline) and stash them by task index;
  3. apply — wrap _build_child_agent to 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.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hermes-delegate-routing 0.1.1
File Size Uploaded
hermes_delegate_routing-0.1.1.tar.gz 20.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for hermes-delegate-routing 0.1.1
File Interpreter ABI Platform
hermes_delegate_routing-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 33.7 kB

Release files / hermes_delegate_routing-0.1.1.tar.gz

Download URL hermes_delegate_routing-0.1.1.tar.gz
Size 20.5 kB
Tags Source
SHA-256 checksum
How to use checksums
e274d1375bb47e4f4f255734f4081e2bb884a0409e7c5d2bd766d92bde646ce6
BLAKE2b-256 checksum
How to use checksums
ff43aa1f7e3e8c0adba8b60f05cb55b993343ba70ff1966f20d280fbc21bdc8f
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

Release files / hermes_delegate_routing-0.1.1-py3-none-any.whl

Download URL hermes_delegate_routing-0.1.1-py3-none-any.whl
Size 13.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
981ddc4d1a85a365cea36d8851c9652e81c40ddfc8413e8d4a5ba6a1d49c39fb
BLAKE2b-256 checksum
How to use checksums
a8a57f86418c96313ae3134a77fc5c22fd71961f5f8f58c958c6614805e3582a
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

Release history Release notifications | RSS feed

0.1.3

2 release files

0.1.2

2 release files

This release

0.1.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page