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.

What it solves

NadirClaw reduces AI API costs by routing prompts to the cheapest possible model that can reliably answer. It prevents the waste of using expensive premium models for simple tasks (like formatting JSON or basic questions) while ensuring high-quality responses by escalating to more powerful models only when necessary.

How it works

NadirClaw acts as a drop-in proxy that uses a three-step process for every request:

  1. Route: A fast embedding classifier (~10ms) predicts the smallest viable model. It can override this based on specific triggers like vision content, long context, or agentic tool loops.
  2. Verify: The response from the cheap model is checked against quality heuristics (such as checking for refusals, truncation, or JSON failures).
  3. Escalate: If the response fails the verification threshold, the system automatically steps up to the next-best model in the chain.

Who it’s for

It is designed for developers and teams who use multiple LLM providers and want to lower their operational costs without sacrificing quality. It is particularly useful for those using OpenAI-compatible clients like Cursor, Aider, or Windsurf.

Highlights

  • Cost Savings: Measures and reports actual savings per request against a premium baseline.
  • Drop-in Compatibility: Works with any OpenAI-compatible tool via a local proxy.
  • Context Optimization: Compacts bloated context (JSON, history, whitespace) to save 30-70% of input tokens.
  • Flexible Routing: Supports N-tier YAML configurations, fallback chains for reliability, and specialized routing for reasoning or vision tasks.
  • Privacy-First: Runs locally, ensuring API keys never leave the user's machine.
  • Comprehensive Monitoring: Includes a live dashboard, Prometheus metrics, and detailed cost reporting.

Related

  • Dispatch
  • Project
  • Project
  • Project
  • Project