360 Secure SkillHub
360 安全技能中心

NadirClaw

该 Skill 指导安装、配置和运行 NadirClaw LLM 路由服务,通过约 10ms 的提示词分类在便宜/本地模型与高级模型间路由,支持多种路由配置、成本节省报告、会话保持、速率限制回退与上下文窗口过滤,并可将兼容 OpenAI 的工具指向该服务。

doramirdor
doramirdor
热度 57.25
最近更新 2026-05-11 17:27:36
分类:开发依赖:代码执行 / 读写文件 / 第三方 API / 内部调用大模型应用场景:API 集成 / DevOps / 工作流

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add nadirclaw
Metadata
name
nadirclaw
version
1.0.0
description
Install, configure, and run NadirClaw LLM router to cut AI API costs by 40-70%. Use when the user wants to reduce LLM spending, route prompts to cheaper models, set up cost-saving proxy, or optimize API usage across providers (OpenAI, Anthropic, Google, Ollama). Also use when asked about model routing, LLM cost optimization, or setting up NadirClaw with OpenClaw.

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

pip install nadirclaw

Setup

Run the interactive wizard:

nadirclaw setup

Or auto-configure for OpenClaw:

nadirclaw openclaw onboard

This writes NadirClaw as a provider in OpenClaw config with model nadirclaw/auto. No restart needed.

Start

nadirclaw serve --verbose

Runs on http://localhost:8856. Any OpenAI-compatible tool can use it by pointing to this URL.

Point tools at NadirClaw

# OpenClaw (auto)
nadirclaw openclaw onboard

# Claude Code
ANTHROPIC_BASE_URL=http://localhost:8856/v1 claude

# Any OpenAI-compatible tool
OPENAI_BASE_URL=http://localhost:8856/v1 <tool>

Routing profiles

Pass x-routing-profile header or use these models:

  • nadirclaw/auto - smart routing (default)
  • nadirclaw/eco - maximize savings
  • nadirclaw/premium - always use best model
  • nadirclaw/free - Ollama/local only
  • nadirclaw/reasoning - chain-of-thought optimized

Monitor savings

nadirclaw savings      # cost savings report
nadirclaw report       # detailed routing analytics
nadirclaw dashboard    # live terminal dashboard

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: nadirclaw setup
  • For Ollama: ensure ollama serve is running first
  • Logs: nadirclaw report --last 20 to see recent routing decisions
  • Raw debug: nadirclaw serve --verbose --log-raw