You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds a new skill that converts plain-English routing intent into a valid Lemonade collection.router policy JSON, ready for the user to register via POST /api/v1/pull.
reference.m: Full schema contract, classifier type matrix, validation checklist
examples.md: 7 worked NL→JSON pairs (examples 5–7 are production configs from an enterprise HR/Benefits/Finance deployment)
scripts/validate.py: Offline structural validator
Example Prompts:
Any message containing a credit card number pattern (four groups of four digits, optionally separated by spaces or dashes) must stay on Qwen3.5-9B-GGUF. Everything else goes to Qwen3.6-35B-A3B.
Requests tagged with either "legal" or "compliance" or "audit" must stay on the local model Qwen3.5-9B-GGUF. Everything else goes to Qwen3.6-35B-A3B.
Use an embedding model to detect whether a request is about cooking. High confidence cooking questions (above 0.8) go to Qwen3-1.7B-GGUF. Medium confidence ones (between 0.5 and 0.8) go to Qwen3.5-9B-GGUF but tag them as uncertain. Anything below 0.5 falls through to Qwen3.6-35B-A3B.
I want image requests to stay on Qwen3.5-9B-GGUF since it supports vision. Requests without any images go to Qwen3-1.7B-GGUF. Default to the vision model.
Example 7 embeds the exact mistake the skill warns against. The complexity llm classifier's prompt ends with "Reply with exactly one label: COMPLEX or SIMPLE." The engine's {"model", "rationale"} contract applies to all llm classifiers, not just routing.router — it's the same LlmClassifier class either way. A weaker model obeying that authored line replies bare COMPLEX, the strict parser rejects it, the score comes back empty, and the rule silently never fires. That's the identical silent-fall-through failure described in checklist item 12 — but the skill scopes the warning (and validate.py's BAD_ROUTER_PROMPT_RE) to router.prompt only. Fix: delete that sentence from example 7, and extend item 12 + the validator regex to cover llm classifier prompts too.
The reference never documents that hand-authored llm classifiers speak the router's wire contract — that their score is binary (chosen label = 1.0, everything else absent). Authors will naturally write "reply with the label" prompts unless told; this is the doc gap that produced problem 1.
Minor gap in validate.py: the server rejects regexes with nested unbounded quantifiers (e.g. (X+)+) at policy load as a ReDoS safeguard (documented in route_policy.schema.json); the validator's Python re.compile check can't catch that, so a policy can pass validation and still fail /pull. A cheap pattern check would close it.
Nits: the decision object also carries version: "1" (skill omits it); metadata comparisons are case-sensitive with comma-decoded token sets for any (unmentioned); and example 3's keywords_all: ["apparel", "clothes"] demands both words for a user who said "clothing or apparel" — should be keywords_any.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a new skill that converts plain-English routing intent into a valid Lemonade collection.router policy JSON, ready for the user to register via POST /api/v1/pull.
Router reference: https://lemonade-server.ai/docs/dev/router-policy/
What the skill does
Files
Example Prompts: