NadirRouter / NadirClaw
Source-available LLM router and AI cost optimizer. Routes simple prompts to cheap or local models and complex ones to premium models, automatically. Drop-in OpenAI-compatible proxy for Claude Code, Codex, Cursor and OpenClaw. Self-hosted, no middleman.
Why this job: says: openai compatible, llm router; topics: llm-gateway, llm-proxy, llm-router, proxy
What it does
- Context Optimize. compacts bloated context (JSON, tool schemas, chat history, whitespace) before dispatch, cutting 29-71% of input tokens on five synthetic payloads and 1-10% on real conversational traffic (benchmark). Every mode except of
- Smart routing. classifies prompts in ~10ms using sentence embeddings
- Pluggable classifier. binary (default, ~10ms centroid classifier) or distilbert (3-class fine-tuned DistilBERT that natively predicts simple/mid/complex). Select with NADIRCLAW_COMPLEXITY_ANALYZER
- Three-tier routing. simple / mid / complex tiers with configurable score thresholds (NADIRCLAW_TIER_THRESHOLDS); set NADIRCLAW_MID_MODEL for a cost-effective middle tier
- N-tier YAML config. one classifier head, any number of tiers. The default profile (n2_default.yaml) ships a cheap-and-strong two-tier cascade tuned on RouterArena (arena_F 0.7358, beats the legacy three-tier baseline). Switch profiles with
Get started
pip install nadirclawYou need: Python 3.10+; At least one LLM provider:
- Maintenance
- Active
- Last commit yesterday
- Stars
- 665
- +4 this week
- Licence
- Custom
- Read before business use
- Downloads for
- None listed
- No release files
- Latest version
- v0.25.3
- Released 4 days ago
- Built with
- Python
- 100% of the code
Is it looked after?
- Contributors
- 3
- Last 90 days
- Issues
- 96% closed
- 1 still open
- Pull requests
- 72 merged
- 1 waiting
- Releases
- 35
- 30+ in the last year
- Contributing guide (opens in new tab)
- Security policy (opens in new tab)
- No code of conduct
Similar repos
| Repo | Stars | Last commit | Licence | Downloads for |
|---|---|---|---|---|
| lidge-jun / opencodex | 18,334 | today | MIT | Mac, Windows, Linux |
| MaySudo / Misceo | 848 | 3 months ago | Custom | Mac, Windows, Linux |
| respanai / respan-gateway | 656 | today | Apache-2.0 | Mac, Windows, Linux |
More: languages, topics and project record
Languages
- Python 100%
- Shell <1%
- Dockerfile <1%
Topics
- ai
- cost-optimization
- gemini
- llm
- llm-router
- model-routing
- ollama
- openai
- openclaw
- proxy
- python
- ai-router
Project record
- JobModel gateways
- StatusListed
- Commits153
- Forks80
- Watching5
- Stars in 28 days+8
- CreatedFeb 11, 2026
- First seen by usNov 7, 2026
- CheckedNov 10, 2026
