Skip to content

Skill to construct configuration JSON files powering the lemonade router - #105 - #110

Open
sdevinenamd wants to merge 7 commits into
mainfrom
build-lemonade-router
Open

Skill to construct configuration JSON files powering the lemonade router - #105#110
sdevinenamd wants to merge 7 commits into
mainfrom
build-lemonade-router

Conversation

@sdevinenamd

Copy link
Copy Markdown
Collaborator

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

  • Supports all three authoring levels: deterministic rules (keywords, regex, length, tools, images, metadata), semantic similarity classifiers (L2), and LLM-as-router (L0a)
  • Generates and offline-validates the JSON before showing it
  • Fills all unspecified fields with safe defaults (mode selection, ids, thresholds, on_error, model_name derivation)
  • Hands the user copy-paste curl commands to register and trace-test on their own

Files

  • SKILL.md: Generation steps 1–8, mode selection logic, condition reference table
  • 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.5-9B-NoThinking.
  • Requests tagged with a department metadata field of either "legal" or "compliance" or "audit" must stay on the local model Qwen3.5-9B-GGUF. Everything else goes to Qwen3.5-9B-NoThinking.
  • 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.5-9B-NoThinking.
  • 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants