Repolode
NadirRouter

NadirRouter/NadirClaw

Self-hosted, source-available LLM router that sends simple prompts to cheap or local models and complex ones to premium models, behind an OpenAI-compatible proxy.

Stars
661
Forks
80
Open issues
1
Last commit
4 hours ago

What is it?

NadirClaw is a local proxy that sits between AI coding tools and model providers. Each incoming prompt is classified in roughly 10ms, sent to the cheapest model tier likely to answer it, and checked by a heuristic verifier for refusals, truncation and malformed JSON. If the answer fails the check, the request escalates to a stronger model. The project reports cost savings per request against an all-premium baseline.

It exposes OpenAI-compatible (/v1/chat/completions) and Anthropic-compatible (/v1/messages) endpoints, so clients such as Claude Code, Codex, Cursor, Aider, Continue and OpenClaw can point at it with a base URL change. Gemini is called natively through the Google GenAI SDK, and other providers go through LiteLLM. Ollama and custom OpenAI-compatible servers such as vLLM or LM Studio are supported for local models.

Beyond routing, the project includes fallback chains on 429 and 5xx errors, session model pinning, context-window filtering, context compaction, an in-memory prompt cache, budget alerts, a terminal and web dashboard, CSV/JSONL log export, and Prometheus metrics. The license is PolyForm Noncommercial, so it is source-available rather than open source.

Key features

  • 01Classifies each prompt in about 10ms and routes it to simple, mid or complex model tiers.
  • 02Verifies cheap answers with heuristic checks and escalates to a stronger model when they fail.
  • 03Offers OpenAI-compatible and Anthropic-compatible endpoints for existing coding tools.
  • 04Calls Gemini natively and reaches other providers through LiteLLM, including Ollama.
  • 05Falls back through a configurable model chain when a provider returns rate-limit or server errors.
  • 06Reports per-request cost savings, with a terminal and web dashboard and budget alerts.

Use cases

  • Reducing monthly API spend for developers who use Claude Code, Cursor or Codex with mixed-difficulty prompts.
  • Running simple requests on a local Ollama model while sending hard tasks to a cloud model.
  • Giving a small team one self-hosted gateway that tracks model usage and cost.
  • Routing an OpenAI-compatible tool to a custom vLLM or LM Studio endpoint alongside cloud models.

Topics

FAQ

What is NadirClaw?
Self-hosted, source-available LLM router that sends simple prompts to cheap or local models and complex ones to premium models, behind an OpenAI-compatible proxy. NadirClaw is a local proxy that sits between AI coding tools and model providers. Each incoming prompt is classified in roughly 10ms, sent to the cheapest model tier likely to answer it, and checked by a heuristic verifier for refusals, truncation and malformed JSON. If the answer fails the check, the request escalates to a stronger model. The project reports cost savings per request against an all-premium baseline.
Is NadirClaw free to use? What license does it have?
NadirClaw is open source under the Other license. Check the license terms before using it in commercial products.
Is NadirClaw still maintained?
Actively maintained. The last commit to NadirClaw was on Oct 22, 2026.
What can I use NadirClaw for?
Reducing monthly API spend for developers who use Claude Code, Cursor or Codex with mixed-difficulty prompts. Running simple requests on a local Ollama model while sending hard tasks to a cloud model. Giving a small team one self-hosted gateway that tracks model usage and cost. Routing an OpenAI-compatible tool to a custom vLLM or LM Studio endpoint alongside cloud models.
Where can I get NadirClaw?
The source code and installation instructions are on GitHub: https://github.com/NadirRouter/NadirClaw

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects