General
external model delegation - Claude MCP Skill
External Model Delegation Pattern
SEO Guide: Enhance your AI agent with the external model delegation tool. This Model Context Protocol (MCP) server allows Claude Desktop and other LLMs to external model delegation pattern... Download and configure this skill to unlock new capabilities for your AI workflow.
Documentation
SKILL.md# External Model Delegation Pattern
A `UserPromptSubmit` hook classifies every user prompt into one of six cost/performance tiers. The hook injects `additionalContext` instructing Claude to run a specific delegation script and return the output.
## Tier routing table
| Tier | Delegation command | Cost |
|------|-------------------|------|
| QWEN | `qwen3 "prompt"` | $0 (local Ollama) |
| DEEPSEEK_FLASH | `deepseek --flash "prompt"` | $0.14 / $0.28 per M tokens |
| DEEPSEEK_PRO | `deepseek --pro "prompt"` | $0.44 / $0.87 per M tokens |
| KIMI | `kimi --quiet -p "prompt"` | $0.60 / $2.50 per M tokens |
| CODEX | `codex exec` | varies |
| CLAUDE | handle natively | $3-5 / $15-25 per M tokens |
## Delegation script pattern
Each script is a self-contained executable in `~/bin/` that accepts a prompt and writes the response to stdout:
```
~/bin/
āāā qwen3 # Shell: curl to local Ollama API
āāā kimi # Shell: execs Kimi CLI binary
āāā deepseek # Python: httpx to DeepSeek Anthropic-compat API
āāā route-task # Shell + qwen3: classifies prompt into tier
```
### Script contract
1. Accept prompt as first argument: `qwen3 "what is 2+2"`
2. Support `--flash` / `--pro` model flags (deepseek)
3. Support `--quiet` mode flag (kimi)
4. Write response to stdout, errors to stderr
5. Exit 0 on success, non-zero on error
### Writing a new delegation script
```bash
#!/bin/bash
# Minimal delegator template
PROMPT="$1"
API_KEY="${EXTERNAL_API_KEY:-}"
# Call external API, write result to stdout
curl -s https://api.example.com/chat \
-H "Authorization: Bearer $API_KEY" \
-d "$(jq -n --arg p "$PROMPT" '{prompt: $p}')" \
| jq -r '.response'
```
## Routing hook flow
```
User types prompt
ā
UserPromptSubmit hook fires
ā
qwen3 classifies into tier (QWEN|DEEPSEEK_FLASH|DEEPSEEK_PRO|KIMI|CODEX|CLAUDE)
ā
Hook injects additionalContext: "Run: <delegation-command>"
ā
Claude reads context, spawns delegation script, returns output
ā
User sees response from the delegated model
```
## Classification tiers
| Tier | Task types |
|------|-----------|
| QWEN | grep, find, regex, shell, syntax lookups, log reading, short summaries |
| DEEPSEEK_FLASH | Simple code, boilerplate, CRUD, test writing, small fixes, config |
| DEEPSEEK_PRO | Multi-file features, refactors, debugging, medium coding, docs |
| KIMI | Single-file review, medium reasoning, commit messages, diff summaries |
| CODEX | Bulk generation, mechanical changes across many files |
| CLAUDE | Architecture, security, complex debugging, system design, quality-critical |
## Environment
```bash
# Required env vars (set in ~/.zshrc)
export DEEPSEEK_API_KEY="sk-..." # For deepseek delegator
export OPENAI_API_KEY="sk-..." # For codex CLI
# Ollama must be running locally for qwen3 classification + delegation
```Signals
Information
- Repository
- alinaqi/claude-bootstrap
- Author
- alinaqi
- Last Sync
- 9/5/2026
- Repo Updated
- 9/1/2026
- Created
- 5/16/2026
Reviews (0)
No reviews yet. Be the first to review this skill!
Related Skills
upgrade-nodejs
Upgrading Bun's Self-Reported Node.js Version
cursorrules
CrewAI Development Rules
cn-check
Install and run the Continue CLI (`cn`) to execute AI agent checks on local code changes. Use when asked to "run checks", "lint with AI", "review my changes with cn", or set up Continue CI locally.
firecrawl-build-search
Integrate Firecrawl `/search` into product code and agent workflows. Use when an app needs discovery before extraction, when the feature starts with a query instead of a URL, or when the system should search the web and optionally hydrate result content.
Related Guides
Bear Notes Claude Skill: Your AI-Powered Note-Taking Assistant
Learn how to use the bear-notes Claude skill. Complete guide with installation instructions and examples.
OpenAI Whisper API Claude Skill: Complete Guide to AI-Powered Audio Transcription
Learn how to use the openai-whisper-api Claude skill. Complete guide with installation instructions and examples.
Mastering the Oracle CLI: A Complete Guide to the Claude Skill for Database Professionals
Learn how to use the oracle Claude skill. Complete guide with installation instructions and examples.