[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6N05VSRCNM74VFSXNF15MNE":3,"skill-same:01M6N05VSRCNM74VFSXNF15MNE":84},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":22,"publishedAt":42,"linkOnly":43,"markdownContent":44,"markdownBody":45,"frontMatter":46,"refName":56,"commitSha":57,"skillDirectory":58,"forksCount":59,"repositoryHtmlUrl":60,"repositoryHomepageUrl":6,"ownerHtmlUrl":61,"ownerBlogUrl":6,"ownerDescription":62,"updatedAt":63,"install":64,"resources":77},"01M6N05VSRCNM74VFSXNF15MNE","llmrouter",null,"Intelligent LLM proxy that routes requests to appropriate models based on complexity. Save money by using cheaper models for simple tasks. Tested with Anthropic, OpenAI, Gemini, Kimi\u002FMoonshot, and Ollama.","Kernel8901\u002Fai-agent-skills-classification","Kernel8901","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F72647553?v=4","01M6KV388J2H5PNC8D8P940BJD","01M6KV38CS5B3AY63RKZB410YM",7,"MIT","https:\u002F\u002Fgithub.com\u002FKernel8901\u002Fai-agent-skills-classification\u002Fblob\u002Fmain\u002F人工智能与大型语言模型\u002Fllmrouter\u002FSKILL.md",[17],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000010","后端与接口","SCENARIO","使用场景",[5,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41],"llm proxy","darwin","for","pip","pip3","with","save money","simple","complexity","gemini","python3","ollama","save","api","proxy","openai","tasks","linux","github","2026-11-10 10:12:30",false,"---\nname: llmrouter\ndescription: Intelligent LLM proxy that routes requests to appropriate models based on complexity. Save money by using cheaper models for simple tasks. Tested with Anthropic, OpenAI, Gemini, Kimi\u002FMoonshot, and Ollama.\nhomepage: https:\u002F\u002Fgithub.com\u002Falexrudloff\u002Fllmrouter\nmetadata: {\"openclaw\":{\"emoji\":\"?\",\"homepage\":\"https:\u002F\u002Fgithub.com\u002Falexrudloff\u002Fllmrouter\",\"os\":[\"darwin\",\"linux\"],\"requires\":{\"bins\":[\"python3\"],\"anyBins\":[\"pip\",\"pip3\"]},\"primaryEnv\":\"ANTHROPIC_API_KEY\"}}\n---\n\n# LLM Router\n\nAn intelligent proxy that classifies incoming requests by complexity and routes them to appropriate LLM models. Use cheaper\u002Ffaster models for simple tasks and reserve expensive models for complex ones.\n\n**Works with [OpenClaw](https:\u002F\u002Fgithub.com\u002Fopenclaw\u002Fopenclaw)** to reduce token usage and API costs by routing simple requests to smaller models.\n\n**Status:** Tested with Anthropic, OpenAI, Google Gemini, Kimi\u002FMoonshot, and Ollama.\n\n## Quick Start\n\n### Prerequisites\n\n1. **Python 3.10+** with pip\n2. **Ollama** (optional - only if using local classification)\n3. **Anthropic API key** or Claude Code OAuth token (or other provider key)\n\n### Setup\n\n```bash\n# Clone if not already present\ngit clone https:\u002F\u002Fgithub.com\u002Falexrudloff\u002Fllmrouter.git\ncd llmrouter\n\n# Create virtual environment (required on modern Python)\npython3 -m venv venv\nsource venv\u002Fbin\u002Factivate\n\n# Install dependencies\npip install -r requirements.txt\n\n# Pull classifier model (if using local classification)\nollama pull qwen2.5:3b\n\n# Copy and customize config\ncp config.yaml.example config.yaml\n# Edit config.yaml with your API key and model preferences\n```\n\n### Verify Installation\n\n```bash\n# Start the server\nsource venv\u002Fbin\u002Factivate\npython server.py\n\n# In another terminal, test health endpoint\ncurl http:\u002F\u002Flocalhost:4001\u002Fhealth\n# Should return: {\"status\": \"ok\", ...}\n```\n\n### Start the Server\n\n```bash\npython server.py\n```\n\nOptions:\n- `--port PORT` - Port to listen on (default: 4001)\n- `--host HOST` - Host to bind (default: 127.0.0.1)\n- `--config PATH` - Config file path (default: config.yaml)\n- `--log` - Enable verbose logging\n- `--openclaw` - Enable OpenClaw compatibility (rewrites model name in system prompt)\n\n## Configuration\n\nEdit `config.yaml` to customize:\n\n### Model Routing\n\n```yaml\n# Anthropic routing\nmodels:\n  super_easy: \"anthropic:claude-haiku-4-5-20251001\"\n  easy: \"anthropic:claude-haiku-4-5-20251001\"\n  medium: \"anthropic:claude-sonnet-4-20250514\"\n  hard: \"anthropic:claude-opus-4-20250514\"\n  super_hard: \"anthropic:claude-opus-4-20250514\"\n\n# OpenAI routing\nmodels:\n  super_easy: \"openai:gpt-4o-mini\"\n  easy: \"openai:gpt-4o-mini\"\n  medium: \"openai:gpt-4o\"\n  hard: \"openai:o3-mini\"\n  super_hard: \"openai:o3\"\n\n# Google Gemini routing\nmodels:\n  super_easy: \"google:gemini-2.0-flash\"\n  easy: \"google:gemini-2.0-flash\"\n  medium: \"google:gemini-2.0-flash\"\n  hard: \"google:gemini-2.0-flash\"\n  super_hard: \"google:gemini-2.0-flash\"\n```\n\n**Note:** Reasoning models are auto-detected and use correct API params.\n\n### Classifier\n\nThree options for classifying request complexity:\n\n**Local (default)** - Free, requires Ollama:\n```yaml\nclassifier:\n  provider: \"local\"\n  model: \"qwen2.5:3b\"\n```\n\n**Anthropic** - Uses Haiku, fast and cheap:\n```yaml\nclassifier:\n  provider: \"anthropic\"\n  model: \"claude-haiku-4-5-20251001\"\n```\n\n**OpenAI** - Uses GPT-4o-mini:\n```yaml\nclassifier:\n  provider: \"openai\"\n  model: \"gpt-4o-mini\"\n```\n\n**Google** - Uses Gemini:\n```yaml\nclassifier:\n  provider: \"google\"\n  model: \"gemini-2.0-flash\"\n```\n\n**Kimi** - Uses Moonshot:\n```yaml\nclassifier:\n  provider: \"kimi\"\n  model: \"moonshot-v1-8k\"\n```\n\nUse remote (anthropic\u002Fopenai\u002Fgoogle\u002Fkimi) if your machine can't run local models.\n\n### Supported Providers\n\n- `anthropic:claude-*` - Anthropic Claude models (tested)\n- `openai:gpt-*`, `openai:o1-*`, `openai:o3-*` - OpenAI models (tested)\n- `google:gemini-*` - Google Gemini models (tested)\n- `kimi:kimi-k2.5`, `kimi:moonshot-*` - Kimi\u002FMoonshot models (tested)\n- `local:model-name` - Local Ollama models (tested)\n\n## Complexity Levels\n\n| Level | Use Case | Default Model |\n|-------|----------|---------------|\n| super_easy | Greetings, acknowledgments | Haiku |\n| easy | Simple Q&A, reminders | Haiku |\n| medium | Coding, emails, research | Sonnet |\n| hard | Complex reasoning, debugging | Opus |\n| super_hard | System architecture, proofs | Opus |\n\n## Customizing Classification\n\nEdit `ROUTES.md` to tune how messages are classified. The classifier reads the table in this file to determine complexity levels.\n\n## API Usage\n\nThe router exposes an OpenAI-compatible API:\n\n```bash\ncurl http:\u002F\u002Flocalhost:4001\u002Fv1\u002Fchat\u002Fcompletions \\\n  -H \"Authorization: Bearer $ANTHROPIC_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"model\": \"llm-router\",\n    \"messages\": [{\"role\": \"user\", \"content\": \"Hello!\"}]\n  }'\n```\n\n## Testing Classification\n\n```bash\npython classifier.py \"Write a Python sort function\"\n# Output: medium\n\npython classifier.py --test\n# Runs test suite\n```\n\n## Running as macOS Service\n\nCreate `~\u002FLibrary\u002FLaunchAgents\u002Fcom.llmrouter.plist`:\n\n```xml\n\u003C?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\u003C!DOCTYPE plist PUBLIC \"-\u002F\u002FApple\u002F\u002FDTD PLIST 1.0\u002F\u002FEN\" \"http:\u002F\u002Fwww.apple.com\u002FDTDs\u002FPropertyList-1.0.dtd\">\n\u003Cplist version=\"1.0\">\n\u003Cdict>\n    \u003Ckey>Label\u003C\u002Fkey>\n    \u003Cstring>com.llmrouter\u003C\u002Fstring>\n    \u003Ckey>ProgramArguments\u003C\u002Fkey>\n    \u003Carray>\n        \u003Cstring>\u002Fpath\u002Fto\u002Fllmrouter\u002Fvenv\u002Fbin\u002Fpython\u003C\u002Fstring>\n        \u003Cstring>\u002Fpath\u002Fto\u002Fllmrouter\u002Fserver.py\u003C\u002Fstring>\n        \u003Cstring>--openclaw\u003C\u002Fstring>\n    \u003C\u002Farray>\n    \u003Ckey>RunAtLoad\u003C\u002Fkey>\n    \u003Ctrue\u002F>\n    \u003Ckey>KeepAlive\u003C\u002Fkey>\n    \u003Ctrue\u002F>\n    \u003Ckey>WorkingDirectory\u003C\u002Fkey>\n    \u003Cstring>\u002Fpath\u002Fto\u002Fllmrouter\u003C\u002Fstring>\n    \u003Ckey>StandardOutPath\u003C\u002Fkey>\n    \u003Cstring>\u002Fpath\u002Fto\u002Fllmrouter\u002Flogs\u002Fstdout.log\u003C\u002Fstring>\n    \u003Ckey>StandardErrorPath\u003C\u002Fkey>\n    \u003Cstring>\u002Fpath\u002Fto\u002Fllmrouter\u002Flogs\u002Fstderr.log\u003C\u002Fstring>\n\u003C\u002Fdict>\n\u003C\u002Fplist>\n```\n\n**Important:** Replace `\u002Fpath\u002Fto\u002Fllmrouter` with your actual install path. Must use the venv python, not system python.\n\n```bash\n# Create logs directory\nmkdir -p ~\u002Fpath\u002Fto\u002Fllmrouter\u002Flogs\n\n# Load the service\nlaunchctl load ~\u002FLibrary\u002FLaunchAgents\u002Fcom.llmrouter.plist\n\n# Verify it's running\ncurl http:\u002F\u002Flocalhost:4001\u002Fhealth\n\n# To stop\u002Frestart\nlaunchctl unload ~\u002FLibrary\u002FLaunchAgents\u002Fcom.llmrouter.plist\nlaunchctl load ~\u002FLibrary\u002FLaunchAgents\u002Fcom.llmrouter.plist\n```\n\n## OpenClaw Configuration\n\nAdd the router as a provider in `~\u002F.openclaw\u002Fopenclaw.json`:\n\n```json\n{\n  \"models\": {\n    \"providers\": {\n      \"localrouter\": {\n        \"baseUrl\": \"http:\u002F\u002Flocalhost:4001\u002Fv1\",\n        \"apiKey\": \"via-router\",\n        \"api\": \"openai-completions\",\n        \"models\": [\n          {\n            \"id\": \"llm-router\",\n            \"name\": \"LLM Router (Auto-routes by complexity)\",\n            \"reasoning\": false,\n            \"input\": [\"text\", \"image\"],\n            \"cost\": {\n              \"input\": 0,\n              \"output\": 0,\n              \"cacheRead\": 0,\n              \"cacheWrite\": 0\n            },\n            \"contextWindow\": 200000,\n            \"maxTokens\": 8192\n          }\n        ]\n      }\n    }\n  }\n}\n```\n\n**Note:** Cost is set to 0 because actual costs depend on which model the router selects. The router logs which model handled each request.\n\n### Set as Default Model (Optional)\n\nTo use the router for all agents by default, add:\n\n```json\n{\n  \"agents\": {\n    \"defaults\": {\n      \"model\": {\n        \"primary\": \"localrouter\u002Fllm-router\"\n      }\n    }\n  }\n}\n```\n\n### Using with OAuth Tokens\n\nIf your `config.yaml` uses an Anthropic OAuth token from OpenClaw's `~\u002F.openclaw\u002Fauth-profiles.json`, the router automatically handles Claude Code identity headers.\n\n### OpenClaw Compatibility Mode (Required)\n\n**If using with OpenClaw, you MUST start the server with `--openclaw`:**\n\n```bash\npython server.py --openclaw\n```\n\nThis flag enables compatibility features required for OpenClaw:\n- Rewrites model names in responses so OpenClaw shows the actual model being used\n- Handles tool name and ID remapping for proper tool call routing\n\nWithout this flag, you may encounter errors when using the router with OpenClaw.\n\n## Common Tasks\n\n- **Check server status**: `curl http:\u002F\u002Flocalhost:4001\u002Fhealth`\n- **View current config**: `cat config.yaml`\n- **Test a classification**: `python classifier.py \"your message\"`\n- **Run classification tests**: `python classifier.py --test`\n- **Restart server**: Stop and run `python server.py` again\n- **View logs** (if running as service): `tail -f logs\u002Fstdout.log`\n\n## Troubleshooting\n\n### \"externally-managed-environment\" error\nPython 3.11+ requires virtual environments. Create one:\n```bash\npython3 -m venv venv\nsource venv\u002Fbin\u002Factivate\npip install -r requirements.txt\n```\n\n### \"Connection refused\" on port 4001\nServer isn't running. Start it:\n```bash\nsource venv\u002Fbin\u002Factivate && python server.py\n```\n\n### Classification returns wrong complexity\nEdit `ROUTES.md` to tune classification rules. The classifier reads this file to determine complexity levels.\n\n### Ollama errors \u002F \"model not found\"\nEnsure Ollama is running and the model is pulled:\n```bash\nollama serve  # Start Ollama if not running\nollama pull qwen2.5:3b\n```\n\n### OAuth token not working\nEnsure your token in `config.yaml` starts with `sk-ant-oat`. The router auto-detects OAuth tokens and adds required identity headers.\n\n### LaunchAgent not starting\nCheck logs and ensure paths are absolute:\n```bash\ncat ~\u002FLibrary\u002FLaunchAgents\u002Fcom.llmrouter.plist  # Verify paths\ncat \u002Fpath\u002Fto\u002Fllmrouter\u002Flogs\u002Fstderr.log  # Check for errors\n```\n","# LLM Router\n\nAn intelligent proxy that classifies incoming requests by complexity and routes them to appropriate LLM models. Use cheaper\u002Ffaster models for simple tasks and reserve expensive models for complex ones.\n\n**Works with [OpenClaw](https:\u002F\u002Fgithub.com\u002Fopenclaw\u002Fopenclaw)** to reduce token usage and API costs by routing simple requests to smaller models.\n\n**Status:** Tested with Anthropic, OpenAI, Google Gemini, Kimi\u002FMoonshot, and Ollama.\n\n## Quick Start\n\n### Prerequisites\n\n1. **Python 3.10+** with pip\n2. **Ollama** (optional - only if using local classification)\n3. **Anthropic API key** or Claude Code OAuth token (or other provider key)\n\n### Setup\n\n```bash\n# Clone if not already present\ngit clone https:\u002F\u002Fgithub.com\u002Falexrudloff\u002Fllmrouter.git\ncd llmrouter\n\n# Create virtual environment (required on modern Python)\npython3 -m venv venv\nsource venv\u002Fbin\u002Factivate\n\n# Install dependencies\npip install -r requirements.txt\n\n# Pull classifier model (if using local classification)\nollama pull qwen2.5:3b\n\n# Copy and customize config\ncp config.yaml.example config.yaml\n# Edit config.yaml with your API key and model preferences\n```\n\n### Verify Installation\n\n```bash\n# Start the server\nsource venv\u002Fbin\u002Factivate\npython server.py\n\n# In another terminal, test health endpoint\ncurl http:\u002F\u002Flocalhost:4001\u002Fhealth\n# Should return: {\"status\": \"ok\", ...}\n```\n\n### Start the Server\n\n```bash\npython server.py\n```\n\nOptions:\n- `--port PORT` - Port to listen on (default: 4001)\n- `--host HOST` - Host to bind (default: 127.0.0.1)\n- `--config PATH` - Config file path (default: config.yaml)\n- `--log` - Enable verbose logging\n- `--openclaw` - Enable OpenClaw compatibility (rewrites model name in system prompt)\n\n## Configuration\n\nEdit `config.yaml` to customize:\n\n### Model Routing\n\n```yaml\n# Anthropic routing\nmodels:\n  super_easy: \"anthropic:claude-haiku-4-5-20251001\"\n  easy: \"anthropic:claude-haiku-4-5-20251001\"\n  medium: \"anthropic:claude-sonnet-4-20250514\"\n  hard: \"anthropic:claude-opus-4-20250514\"\n  super_hard: \"anthropic:claude-opus-4-20250514\"\n\n# OpenAI routing\nmodels:\n  super_easy: \"openai:gpt-4o-mini\"\n  easy: \"openai:gpt-4o-mini\"\n  medium: \"openai:gpt-4o\"\n  hard: \"openai:o3-mini\"\n  super_hard: \"openai:o3\"\n\n# Google Gemini routing\nmodels:\n  super_easy: \"google:gemini-2.0-flash\"\n  easy: \"google:gemini-2.0-flash\"\n  medium: \"google:gemini-2.0-flash\"\n  hard: \"google:gemini-2.0-flash\"\n  super_hard: \"google:gemini-2.0-flash\"\n```\n\n**Note:** Reasoning models are auto-detected and use correct API params.\n\n### Classifier\n\nThree options for classifying request complexity:\n\n**Local (default)** - Free, requires Ollama:\n```yaml\nclassifier:\n  provider: \"local\"\n  model: \"qwen2.5:3b\"\n```\n\n**Anthropic** - Uses Haiku, fast and cheap:\n```yaml\nclassifier:\n  provider: \"anthropic\"\n  model: \"claude-haiku-4-5-20251001\"\n```\n\n**OpenAI** - Uses GPT-4o-mini:\n```yaml\nclassifier:\n  provider: \"openai\"\n  model: \"gpt-4o-mini\"\n```\n\n**Google** - Uses Gemini:\n```yaml\nclassifier:\n  provider: \"google\"\n  model: \"gemini-2.0-flash\"\n```\n\n**Kimi** - Uses Moonshot:\n```yaml\nclassifier:\n  provider: \"kimi\"\n  model: \"moonshot-v1-8k\"\n```\n\nUse remote (anthropic\u002Fopenai\u002Fgoogle\u002Fkimi) if your machine can't run local models.\n\n### Supported Providers\n\n- `anthropic:claude-*` - Anthropic Claude models (tested)\n- `openai:gpt-*`, `openai:o1-*`, `openai:o3-*` - OpenAI models (tested)\n- `google:gemini-*` - Google Gemini models (tested)\n- `kimi:kimi-k2.5`, `kimi:moonshot-*` - Kimi\u002FMoonshot models (tested)\n- `local:model-name` - Local Ollama models (tested)\n\n## Complexity Levels\n\n| Level | Use Case | Default Model |\n|-------|----------|---------------|\n| super_easy | Greetings, acknowledgments | Haiku |\n| easy | Simple Q&A, reminders | Haiku |\n| medium | Coding, emails, research | Sonnet |\n| hard | Complex reasoning, debugging | Opus |\n| super_hard | System architecture, proofs | Opus |\n\n## Customizing Classification\n\nEdit `ROUTES.md` to tune how messages are classified. The classifier reads the table in this file to determine complexity levels.\n\n## API Usage\n\nThe router exposes an OpenAI-compatible API:\n\n```bash\ncurl http:\u002F\u002Flocalhost:4001\u002Fv1\u002Fchat\u002Fcompletions \\\n  -H \"Authorization: Bearer $ANTHROPIC_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"model\": \"llm-router\",\n    \"messages\": [{\"role\": \"user\", \"content\": \"Hello!\"}]\n  }'\n```\n\n## Testing Classification\n\n```bash\npython classifier.py \"Write a Python sort function\"\n# Output: medium\n\npython classifier.py --test\n# Runs test suite\n```\n\n## Running as macOS Service\n\nCreate `~\u002FLibrary\u002FLaunchAgents\u002Fcom.llmrouter.plist`:\n\n```xml\n\u003C?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\u003C!DOCTYPE plist PUBLIC \"-\u002F\u002FApple\u002F\u002FDTD PLIST 1.0\u002F\u002FEN\" \"http:\u002F\u002Fwww.apple.com\u002FDTDs\u002FPropertyList-1.0.dtd\">\n\u003Cplist version=\"1.0\">\n\u003Cdict>\n    \u003Ckey>Label\u003C\u002Fkey>\n    \u003Cstring>com.llmrouter\u003C\u002Fstring>\n    \u003Ckey>ProgramArguments\u003C\u002Fkey>\n    \u003Carray>\n        \u003Cstring>\u002Fpath\u002Fto\u002Fllmrouter\u002Fvenv\u002Fbin\u002Fpython\u003C\u002Fstring>\n        \u003Cstring>\u002Fpath\u002Fto\u002Fllmrouter\u002Fserver.py\u003C\u002Fstring>\n        \u003Cstring>--openclaw\u003C\u002Fstring>\n    \u003C\u002Farray>\n    \u003Ckey>RunAtLoad\u003C\u002Fkey>\n    \u003Ctrue\u002F>\n    \u003Ckey>KeepAlive\u003C\u002Fkey>\n    \u003Ctrue\u002F>\n    \u003Ckey>WorkingDirectory\u003C\u002Fkey>\n    \u003Cstring>\u002Fpath\u002Fto\u002Fllmrouter\u003C\u002Fstring>\n    \u003Ckey>StandardOutPath\u003C\u002Fkey>\n    \u003Cstring>\u002Fpath\u002Fto\u002Fllmrouter\u002Flogs\u002Fstdout.log\u003C\u002Fstring>\n    \u003Ckey>StandardErrorPath\u003C\u002Fkey>\n    \u003Cstring>\u002Fpath\u002Fto\u002Fllmrouter\u002Flogs\u002Fstderr.log\u003C\u002Fstring>\n\u003C\u002Fdict>\n\u003C\u002Fplist>\n```\n\n**Important:** Replace `\u002Fpath\u002Fto\u002Fllmrouter` with your actual install path. Must use the venv python, not system python.\n\n```bash\n# Create logs directory\nmkdir -p ~\u002Fpath\u002Fto\u002Fllmrouter\u002Flogs\n\n# Load the service\nlaunchctl load ~\u002FLibrary\u002FLaunchAgents\u002Fcom.llmrouter.plist\n\n# Verify it's running\ncurl http:\u002F\u002Flocalhost:4001\u002Fhealth\n\n# To stop\u002Frestart\nlaunchctl unload ~\u002FLibrary\u002FLaunchAgents\u002Fcom.llmrouter.plist\nlaunchctl load ~\u002FLibrary\u002FLaunchAgents\u002Fcom.llmrouter.plist\n```\n\n## OpenClaw Configuration\n\nAdd the router as a provider in `~\u002F.openclaw\u002Fopenclaw.json`:\n\n```json\n{\n  \"models\": {\n    \"providers\": {\n      \"localrouter\": {\n        \"baseUrl\": \"http:\u002F\u002Flocalhost:4001\u002Fv1\",\n        \"apiKey\": \"via-router\",\n        \"api\": \"openai-completions\",\n        \"models\": [\n          {\n            \"id\": \"llm-router\",\n            \"name\": \"LLM Router (Auto-routes by complexity)\",\n            \"reasoning\": false,\n            \"input\": [\"text\", \"image\"],\n            \"cost\": {\n              \"input\": 0,\n              \"output\": 0,\n              \"cacheRead\": 0,\n              \"cacheWrite\": 0\n            },\n            \"contextWindow\": 200000,\n            \"maxTokens\": 8192\n          }\n        ]\n      }\n    }\n  }\n}\n```\n\n**Note:** Cost is set to 0 because actual costs depend on which model the router selects. The router logs which model handled each request.\n\n### Set as Default Model (Optional)\n\nTo use the router for all agents by default, add:\n\n```json\n{\n  \"agents\": {\n    \"defaults\": {\n      \"model\": {\n        \"primary\": \"localrouter\u002Fllm-router\"\n      }\n    }\n  }\n}\n```\n\n### Using with OAuth Tokens\n\nIf your `config.yaml` uses an Anthropic OAuth token from OpenClaw's `~\u002F.openclaw\u002Fauth-profiles.json`, the router automatically handles Claude Code identity headers.\n\n### OpenClaw Compatibility Mode (Required)\n\n**If using with OpenClaw, you MUST start the server with `--openclaw`:**\n\n```bash\npython server.py --openclaw\n```\n\nThis flag enables compatibility features required for OpenClaw:\n- Rewrites model names in responses so OpenClaw shows the actual model being used\n- Handles tool name and ID remapping for proper tool call routing\n\nWithout this flag, you may encounter errors when using the router with OpenClaw.\n\n## Common Tasks\n\n- **Check server status**: `curl http:\u002F\u002Flocalhost:4001\u002Fhealth`\n- **View current config**: `cat config.yaml`\n- **Test a classification**: `python classifier.py \"your message\"`\n- **Run classification tests**: `python classifier.py --test`\n- **Restart server**: Stop and run `python server.py` again\n- **View logs** (if running as service): `tail -f logs\u002Fstdout.log`\n\n## Troubleshooting\n\n### \"externally-managed-environment\" error\nPython 3.11+ requires virtual environments. Create one:\n```bash\npython3 -m venv venv\nsource venv\u002Fbin\u002Factivate\npip install -r requirements.txt\n```\n\n### \"Connection refused\" on port 4001\nServer isn't running. Start it:\n```bash\nsource venv\u002Fbin\u002Factivate && python server.py\n```\n\n### Classification returns wrong complexity\nEdit `ROUTES.md` to tune classification rules. The classifier reads this file to determine complexity levels.\n\n### Ollama errors \u002F \"model not found\"\nEnsure Ollama is running and the model is pulled:\n```bash\nollama serve  # Start Ollama if not running\nollama pull qwen2.5:3b\n```\n\n### OAuth token not working\nEnsure your token in `config.yaml` starts with `sk-ant-oat`. The router auto-detects OAuth tokens and adds required identity headers.\n\n### LaunchAgent not starting\nCheck logs and ensure paths are absolute:\n```bash\ncat ~\u002FLibrary\u002FLaunchAgents\u002Fcom.llmrouter.plist  # Verify paths\ncat \u002Fpath\u002Fto\u002Fllmrouter\u002Flogs\u002Fstderr.log  # Check for errors\n```\n",{"name":5,"homepage":47,"metadata":48,"description":7},"https:\u002F\u002Fgithub.com\u002Falexrudloff\u002Fllmrouter",{"openclaw":49},{"os":50,"emoji":51,"homepage":47,"requires":52,"primaryEnv":55},[24,40],"?",{"bins":53,"anyBins":54},[33],[26,27],"ANTHROPIC_API_KEY","main","f4cb2d49f7667e79ef7804f50396d5aaffdf1f56","人工智能与大型语言模型\u002Fllmrouter",1,"https:\u002F\u002Fgithub.com\u002FKernel8901\u002Fai-agent-skills-classification","https:\u002F\u002Fgithub.com\u002FKernel8901","a little little little dobe in life but science geek","2026-04-05 16:43:56",{"source":8,"skillName":5,"commands":65,"prompt":75,"zipAvailable":76},[66,69,72],{"tool":67,"command":68},"npx","npx skills add Kernel8901\u002Fai-agent-skills-classification --skill llmrouter",{"tool":70,"command":71},"bunx","bunx skills add Kernel8901\u002Fai-agent-skills-classification --skill llmrouter",{"tool":73,"command":74},"pnpm","pnpm dlx skills add Kernel8901\u002Fai-agent-skills-classification --skill llmrouter","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FKernel8901\u002Fai-agent-skills-classification\u002Fblob\u002Fmain\u002F人工智能与大型语言模型\u002Fllmrouter\u002FSKILL.md",true,[78],{"path":79,"resourceType":80,"resourceTypeDesc":81,"sizeBytes":82,"sourceHtmlUrl":83},"_meta.json","REFERENCE","参考文档",275,"https:\u002F\u002Fgithub.com\u002FKernel8901\u002Fai-agent-skills-classification\u002Fblob\u002Fmain\u002F人工智能与大型语言模型\u002Fllmrouter\u002F_meta.json",[85,109,140,151,161,187],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":42},"01M6Q5R6WZ06RRB9RQTW54B34B","zyfai","Earn yield on any Ethereum wallet on Base, Arbitrum, and Plasma. Use when a user wants passive DeFi yield on their funds. Deploys a non-custodial subaccount (Safe) linked to their EOA, enables automated yield optimization, and lets them deposit\u002Fwithdraw anytime.","https:\u002F\u002Fgithub.com\u002FKernel8901\u002Fai-agent-skills-classification\u002Fblob\u002Fmain\u002F金融\u002Fzyfai-sdk\u002FSKILL.md",[],[87,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108],"safe","ethereum","defi","Optimization","user","use","Wallet","base","deposit","withdraw","yield","arbitrum","non-custodial","passive","defi yield","earn","yield optimization",{"skillNo":110,"name":111,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":112,"categories":113,"keywords":123,"publishedAt":42},"01M6Q5R337B5JSNER4P4YS03TN","zerion-api","https:\u002F\u002Fgithub.com\u002FKernel8901\u002Fai-agent-skills-classification\u002Fblob\u002Fmain\u002F金融\u002Fzerion-api\u002FSKILL.md",[114,115,118],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},{"categoryNo":116,"categoryName":117,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000023","Skill与智能体开发",{"categoryNo":119,"categoryName":120,"taxonomyType":121,"taxonomyTypeDesc":122},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[36,124,125,126,127,128,129,94,130,98,131,132,133,134,135,136,137,138,139],"zerion api","zerion","MCP","mcp server","server","blockchain","transactions","crypto wallet","crypto","evm","solana","query","across","positions","token","prices",{"skillNo":141,"name":142,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":143,"categories":144,"keywords":148,"publishedAt":42},"01M6Q5QZFYTDAZMZ27BN5VZXAR","zerion-api-skill","https:\u002F\u002Fgithub.com\u002FKernel8901\u002Fai-agent-skills-classification\u002Fblob\u002Fmain\u002F金融\u002Fzerion-api-skill\u002FSKILL.md",[145,146,147],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},{"categoryNo":116,"categoryName":117,"taxonomyType":20,"taxonomyTypeDesc":21},{"categoryNo":119,"categoryName":120,"taxonomyType":121,"taxonomyTypeDesc":122},[36,149,150,124,125,126,127,128,129,94,130,98,132,133,134,135,136,137,138,139],"api skill","zerion api skill",{"skillNo":152,"name":153,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":154,"categories":155,"keywords":159,"publishedAt":42},"01M6Q5QW17QW98RA3FE45E4RD8","zerion-api-mcp","https:\u002F\u002Fgithub.com\u002FKernel8901\u002Fai-agent-skills-classification\u002Fblob\u002Fmain\u002F金融\u002Fzerion-api-mcp\u002FSKILL.md",[156,157,158],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},{"categoryNo":116,"categoryName":117,"taxonomyType":20,"taxonomyTypeDesc":21},{"categoryNo":119,"categoryName":120,"taxonomyType":121,"taxonomyTypeDesc":122},[126,36,160,124,125,127,128,94,130,98,131,132,133,134,135,136,137,138,139],"zerion api mcp",{"skillNo":162,"name":163,"nameZh":6,"description":164,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":165,"categories":166,"keywords":170,"publishedAt":42},"01M6Q5QQYZB7A501BDEQWKGSJT","yahoo-finance-forex","Fetches real-time FOREX news and market data from Yahoo Finance for major currency pairs (EUR\u002FUSD, GBP\u002FUSD, USD\u002FJPY, etc.). Analyzes sentiment and provides trading context.","https:\u002F\u002Fgithub.com\u002FKernel8901\u002Fai-agent-skills-classification\u002Fblob\u002Fmain\u002F金融\u002Fyahoo-finance-forex\u002FSKILL.md",[167],{"categoryNo":168,"categoryName":169,"taxonomyType":121,"taxonomyTypeDesc":122},"01JBSEEDCAT000000000000040","财务",[171,172,173,174,175,41,176,177,178,33,179,180,181,182,183,184,185,26,186,25],"finance","yahoo finance","forex","yahoo","yahoo finance forex","https","sentiment","real-time","install","Market","usd","news","time","currency","gbp","market data",{"skillNo":188,"name":189,"nameZh":6,"description":190,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":191,"categories":192,"keywords":194,"publishedAt":42},"01M6Q5QM6VS84WZVM7BKXXPF32","yahoo-finance","This skill should be used when the user asks to \"get stock prices\", \"check stock quotes\", \"look up earnings\", \"get financial data\", \"find trending stocks\", or needs stock market data from Yahoo Finance.","https:\u002F\u002Fgithub.com\u002FKernel8901\u002Fai-agent-skills-classification\u002Fblob\u002Fmain\u002F金融\u002Fyahoo-finance-cli\u002FSKILL.md",[193],{"categoryNo":168,"categoryName":169,"taxonomyType":121,"taxonomyTypeDesc":122},[171,172,174,195,196,197,198,199,200,180,201,202,203,204,205,206,207,208,139,186],"cli","homebrew","find","check","brew","up","local","get","stock","link","trending","sf","quotes","ln"]