Catalog / LLM routing & guardrails
Hermes skill_router: pre-route each task to the right skill with a local Laya model
Hermes plugin that classifies each task against a ~300-skill index with Laya, injects the top skill's SKILL.md as per-turn context, and fails open. Cache-safe by design.
# skill_router
A Hermes plugin that **pre-routes each task to the right skill** before the main
model sees it, using a small calibrated local model (Laya, a 421M System-1
decision model). It implements the idea from [JEV TIP 001](https://x.com/parcadei/status/2101132368949993830):
stop spending your main model's tokens (and trust) on figuring out which skill
to load — classify the task against skill names + short descriptions, then load
the winner deterministically.
**Fixes the "session forgot the skill" failure**: the relevant skill's guidance
is injected as active context every turn, so the main model never has to
remember to call `skill_view()`.
## What it does
- On each new user turn, the plugin's `pre_llm_call` hook runs a tiny routing
model (Laya, local, `$0`) against the ~300-skill index.
- It classifies the task, picks the top 1-2 skills, reads their `SKILL.md`, and
injects a compact excerpt as the user-message context.
- Fail-open: if Laya is unavailable, missing, or routing finds nothing, the hook
injects nothing and Hermes behaves exactly as stock.
## Cache-safe by design
The skill is injected through the **user-message channel** (`pre_llm_call`
returns `{"context": ...}`), never by mutating the system prompt. This preserves
Hermes's byte-stable prompt-cache invariant — only the ephemeral per-turn user
context changes, exactly like the built-in memory-prefetch path.
## Installation (no custom code for you)
The plugin lives in `~/.hermes/plugins/skill_router/` (user state, safe across
`hermes update`). Install once:
```bash
hermes plugins enable skill_router # if not auto-enabled
```
It requires the local Laya venv (already present on this machine):
`~/.hermes/workspace/laya-venv/bin/python` with `pip install laya`.
Verify: `hermes plugin