Model Router
Route model requests based on configured models, costs and task complexity. Use for routing general/low-complexity requests to the cheapest available model and for higher-complexity requests to stronger models.
MIT-0 · Free to use, modify, and redistribute. No attribution required.
⭐ 10 · 2.8k · 14 current installs · 15 all-time installs
MIT-0
Security Scan
OpenClaw
Benign
high confidencePurpose & Capability
Name/description match the code and SKILL.md. The script's inputs (models JSON, task text, optional prefer/min-capability flags) are exactly what you'd expect for a model-routing utility.
Instruction Scope
SKILL.md instructs running the included CLI/library against a models file and task text. The runtime instructions and code only read the provided JSON file and the CLI args; they do not reference other files, environment variables, or external endpoints.
Install Mechanism
No install spec is present (instruction-only with one included Python script). No downloads, package installs, or extracted archives are requested.
Credentials
The skill requires no environment variables, credentials, or config paths. The example models JSON contains provider names (including an 'internal' provider) but no secrets — review model entries before use to ensure they don't point to sensitive endpoints.
Persistence & Privilege
The skill does not request persistent presence (always=false) and does not modify agent or system configs. It prints a chosen model and reasoning only.
Assessment
This skill appears to do only local model selection based on a JSON config and heuristics. Before installing: review your models.json (or OpenClaw config) to ensure entries point only to providers you trust (the example includes an 'internal' provider), because the router will pick whatever model records you give it; consider cost implications if you wire the router into an automated pipeline (it may route many requests to expensive models); test the heuristics on representative tasks to ensure routing matches your expectations; and avoid passing sensitive user data to untrusted provider entries in the models file. Overall the package is coherent and low-risk, but validate the models configuration and how the chosen model is subsequently invoked in your system.Like a lobster shell, security has layers — review code before you run it.
Current versionv0.1.1
Download ziplatest
License
MIT-0
Free to use, modify, and redistribute. No attribution required.
SKILL.md
model-router
This skill provides a compact, runnable router that inspects an OpenClaw-style configuration (or a simple models JSON) and selects an appropriate model for an incoming request based on:
- declared model capabilities and an optional cost score
- task complexity (heuristic: short/simple vs long/complex)
- explicit overrides (user or caller hints)
Design principles
- Keep decision logic small and deterministic.
- Default to the cheapest model for general, not-complex tasks.
- Escalate to stronger models when the task appears complex or asks for high-fidelity results.
- Make model metadata explicit (capabilities, cost_score, tags) so the router is transparent and auditable.
What this skill includes
- scripts/router.py — a small CLI and library to pick a model given a task description and a models configuration file.
- examples/models.json — example model configurations (name, provider, cost_score, capabilities).
When to use
- Trigger when you need to programmatically choose which LLM to call for a user request.
- Use for batching or middleware routing in server apps.
Usage (quick)
- Prepare a models file (JSON) with model entries. See examples/models.json.
- Call: python3 scripts/router.py --models examples/models.json --task "Summarize this email" --mode auto
- The script prints the chosen model and the reasoning.
Files
- scripts/router.py — router CLI/library
- examples/models.json — sample model list
Files
3 totalSelect a file
Select a file to preview.
Comments
Loading comments…
