NadirClaw is an open-source LLM router designed to optimize costs and performance in AI applications. By intelligently classifying and routing prompts, it directs simple queries to affordable models and complex requests to premium providers, enhancing efficiency and saving resources. Compatible with any tool using the OpenAI API.
NadirClaw: An Open-source LLM Router for Efficient Prompt Management
NadirClaw is an innovative routing solution designed specifically for LLM (Large Language Model) interactions. This router intelligently classifies prompts and directs them to the most suitable LLM providers, automatically optimizing costs and performance. By routing simple prompts to economical or local models and complex prompts to premium models, NadirClaw enables users to effectively manage their resources without compromising on quality.
NadirClaw serves as an OpenAI-compatible proxy, functioning seamlessly with any AI tool that interacts with the OpenAI API. It processes incoming prompts in less than 10 milliseconds, utilizing a binary complexity classifier based on sentence embeddings. The architecture can be visualized as follows:
Your AI Tool ──> NadirClaw (:8856/v1) ──> simple prompts ──> Gemini Flash / Ollama (free/cheap)
──> complex prompts ──> GPT / Claude / Gemini Pro (premium)
──> reasoning tasks ──> o3 / DeepSeek-R1 (reasoning)
──> agentic requests ──> complex model (auto-detected)
NadirClaw is easy to install and configure. Installation can be completed in a single line:
pip install nadirclaw
Followed by an interactive setup to configure models and API keys:
nadirclaw setup
To initiate the router:
nadirclaw serve --verbose
Deploy NadirClaw and interact with your AI tool simply:
curl http://localhost:8856/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{"messages": [{"role": "user", "content": "What is 2+2?"}]}'
NadirClaw automatically determines the best model for processing this request, ensuring optimal results.
NadirClaw stands out as a practical and cost-effective solution for managing LLM interactions. Through its smart routing capabilities and versatile integrations, it significantly enhances the efficiency of AI tool deployments, making it an invaluable asset for developers and organizations aiming to leverage LLM technology effectively.
No comments yet.
Sign in to be the first to comment.