explaingit

atlasomnia/hermes-tool-router

17PythonAudience · developerComplexity · 3/5Setup · moderate

TLDR

A Python plugin for the Hermes AI agent that predicts which tools a conversation needs and loads only those groups instead of all definitions, so less token space is wasted before each message.

Mindmap

mindmap
  root((hermes-tool-router))
    What it does
      Predicts needed tools
      Loads only relevant groups
      Saves token space
    How it works
      Classifier model
      Confidence threshold
      Fallback to all tools
    Recovery
      Detects missing tools
      Adds group on the fly
      One extra API call
    Setup
      Plugin folder copy
      Reference files
      Smoke test script
    Tech stack
      Python
      Hermes agent
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Cut the token overhead of your Hermes agent by loading only the tool groups a message actually needs.

USE CASE 2

Recover from wrong tool predictions automatically without breaking a conversation.

USE CASE 3

Measure token savings on your specific Hermes setup using the included smoke test scripts.

Tech stack

Python

Getting it running

Difficulty · moderate Time to first run · 30min

No install script, manual setup requires copying the plugin folder and reference files into the Hermes directory before restarting the agent.

In plain English

This project is an add-on for the Hermes AI agent that reduces how many token-consuming tool descriptions are loaded at the start of each conversation. AI agents typically attach the full list of available tool definitions to every request, which occupies token space before the user's message even begins. This router intercepts each request and predicts which tools are actually needed, then tells Hermes to load only those groups rather than everything. The router runs a small classifier model (either a hosted auxiliary model or a locally running model you configure) that reads the incoming message and predicts which groups of tools are relevant, such as "file", "terminal", or "web". If the classifier is confident enough, Hermes loads only those groups for the first turn. If the classifier is uncertain, if the message is longer than a configurable character threshold (600 by default), or if the prediction is empty, the router falls back to loading all available tools. There is a recovery mechanism for wrong predictions. If the model tries to call a tool that was not loaded, Hermes detects the missing tool name and adds that tool group on the fly before retrying. A bad prediction therefore costs one extra API call rather than a failed response. The project ships as a portable plugin that lives outside the main Hermes checkout, along with reference files and scripts for measuring token savings on your own setup. Because savings depend on your Hermes version, enabled tools, and AI provider, the README explicitly tells users to run the included smoke test locally rather than trust numbers from someone else's environment. There is no automated install script yet. Manual setup involves copying a plugin folder and some reference files into the Hermes directory, then restarting the agent. The project is Python-based, written in English, and has 17 stars on GitHub. The README notes that the folder is not yet published as a package and does not install itself.

Copy-paste prompts

Prompt 1
Help me set up hermes-tool-router as a plugin in my Hermes AI agent directory. Walk me through copying the plugin folder and reference files to the right locations.
Prompt 2
I am using hermes-tool-router and the classifier keeps falling back to loading all tools. What configuration changes can I make to the confidence threshold or character limit to improve prediction accuracy?
Prompt 3
Write a script to benchmark token savings before and after installing hermes-tool-router on my Hermes setup.
Prompt 4
Explain how hermes-tool-router recovery works when it predicts the wrong tool group and the model tries to call a missing tool.
Open on GitHub → Explain another repo

← atlasomnia on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.