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 (SemIf Qwen3.5-4B by
default, or legacy Laya). 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 (SemIf on the 3080 box, or legacy Laya) 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 the engine is unavailable, busy, 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.
## Engines: SemIf (default) and Laya
Routing engine is config-driven (`engine`, default `semif`):
- **SemIf (default)** — `Qwen/Qwen3.5-4B` running on the win11 RTX 3080 box
(`192.168.1.253`), direct-logit readout. Reads the task+options and returns
usable graded probabilities (~0.2s warm after a ~100s one-time model load).
Measured 67% top-1 vs L