NadirClaw Skill
NadirClaw is an open-source LLM router that classifies prompts in ~10ms and routes simple ones to cheap/local models while keeping complex work on premium models.
Install
CODEBLOCK0
Setup
Run the interactive wizard:
CODEBLOCK1
Or auto-configure for OpenClaw:
CODEBLOCK2
This writes NadirClaw as a provider in OpenClaw config with model nadirclaw/auto. No restart needed.
Start
CODEBLOCK3
Runs on http://localhost:8856. Any OpenAI-compatible tool can use it by pointing to this URL.
Point tools at NadirClaw
CODEBLOCK4
Routing profiles
Pass x-routing-profile header or use these models:
- -
nadirclaw/auto - smart routing (default) - INLINECODE4 - maximize savings
- INLINECODE5 - always use best model
- INLINECODE6 - Ollama/local only
- INLINECODE7 - chain-of-thought optimized
Monitor savings
CODEBLOCK5
Key features
- - ~10ms classification overhead
- Session persistence (no model bouncing mid-conversation)
- Rate limit fallback (auto-retry on 429)
- Agentic task detection (forces premium for tool use)
- Context-window filtering (auto-swaps for long conversations)
- Supports: OpenAI, Anthropic, Google Gemini, Ollama, any LiteLLM provider
Troubleshooting
- - If
nadirclaw serve fails, check API keys: INLINECODE9 - For Ollama: ensure
ollama serve is running first - Logs:
nadirclaw report --last 20 to see recent routing decisions - Raw debug: INLINECODE12
技能名称: nadirclaw
详细描述:
NadirClaw 技能
NadirClaw 是一个开源的大语言模型路由器,可在约10毫秒内对提示进行分类,将简单任务路由至廉价/本地模型,同时将复杂任务保留在高级模型上处理。
安装
bash
pip install nadirclaw
配置
运行交互式向导:
bash
nadirclaw setup
或为 OpenClaw 自动配置:
bash
nadirclaw openclaw onboard
此操作会将 NadirClaw 作为提供商写入 OpenClaw 配置,模型为 nadirclaw/auto。无需重启。
启动
bash
nadirclaw serve --verbose
运行在 http://localhost:8856。任何兼容 OpenAI 的工具均可通过指向此 URL 来使用。
将工具指向 NadirClaw
bash
OpenClaw(自动)
nadirclaw openclaw onboard
Claude Code
ANTHROPIC
BASEURL=http://localhost:8856/v1 claude
任何兼容 OpenAI 的工具
OPENAI
BASEURL=http://localhost:8856/v1
路由配置
传递 x-routing-profile 标头或使用以下模型:
- - nadirclaw/auto - 智能路由(默认)
- nadirclaw/eco - 最大化节省
- nadirclaw/premium - 始终使用最佳模型
- nadirclaw/free - 仅限 Ollama/本地模型
- nadirclaw/reasoning - 针对思维链优化
监控节省情况
bash
nadirclaw savings # 成本节省报告
nadirclaw report # 详细路由分析
nadirclaw dashboard # 实时终端仪表盘
主要特性
- - 约10毫秒的分类开销
- 会话持久化(对话中途不切换模型)
- 速率限制回退(遇到429时自动重试)
- 代理任务检测(工具调用时强制使用高级模型)
- 上下文窗口过滤(长对话时自动切换)
- 支持:OpenAI、Anthropic、Google Gemini、Ollama、任何 LiteLLM 提供商
故障排除
- - 如果 nadirclaw serve 失败,请检查 API 密钥:nadirclaw setup
- 对于 Ollama:确保先运行 ollama serve
- 日志:nadirclaw report --last 20 查看最近的路由决策
- 原始调试:nadirclaw serve --verbose --log-raw