humanerd-drew/opencode-drewgent/model-routing
Claude Code and agent skill by humanerd-drew/opencode-drewgent
- community
Checking that the SKILL.md file is still in the repository.
Cost-aware multi-tier model selection strategy. Assigns models to roles (main agent, subagent, auxiliary) by capability tier under subscription billing. Defines the 3-tier flash/pro/max pyramid and the escalation path. Supersedes the per-call era cost-optimization-background-llm skill.
Install
npx vskill@latest install humanerd-drew/opencode-drewgent/model-routingSKILL.md
The same SKILL.md was published earlier as humanerd-drew/opencode-drewgent/model-routing.
Model Routing — Subscription-Era Cost-Aware Strategy
Core Principle
OpenCode Go = fixed cost ($10/month). Every call through OpenCode Go has zero marginal cost. The optimization problem shifts from "minimize per-token spend" to "match model capability to task complexity without wasting user time."
Direct MiniMax API = per-call credits (Token Plan). Use only when OpenCode Go's proxy doesn't deliver equivalent quality for a specific capability.
The 3-Tier Model Pyramid
| Tier | Model | Profiles | Latency | When to Use | |
|---|---|---|---|---|---|
| Flash | deepseek-v4-flash | explorer, implementer, tester, archiver | Fastest | Read-only analysis, simple implementation, tests, docs. The default workhorse. | |
| Pro | deepseek-v4-pro | reviewer | Moderate | General code review. Stronger reasoning needed. | |
| Max | qwen3.7-max | planner, reviewer-critical, security-reviewer | Slowest | Complex planning, critical review, security audit. Use sparingly. |
Routing Configuration
Config.yaml (active 2026-06-13)
Agent Profiles (~/.{{AGENT_NAME_LOWER}}/agents/*.md)
8 pre-defined roles, each with model/provider/toolsets/instructions. Loaded via task(subagent_type="reviewer", description="...", prompt="..."). The subagent_type parameter is built into the task tool schema — every agent sees it.
Pipeline (Tier-Adaptive)
ESCALATE Mechanism
Flash-tier profiles can emit ESCALATE: <reason> when the task exceeds their reasoning capability. The caller detects this and re-routes to a stronger model.
User Preference: Cost in Every Proposal
Every architecture or model proposal MUST include a cost analysis section. Structure:
- Which cost model applies (subscription vs per-call)
- Marginal cost per additional call
- Tier assignment rationale (why flash/pro/max for each role)
- Fallback strategy (what happens if the primary provider is rate-limited)
Available Providers
- OpenCode Go (
opencode-go): $10/mo subscription. All models included at zero marginal cost. API athttps://opencode.ai/zen/go/v1. Key:OPENCODE_GO_API_KEY. - MiniMax direct (
minimax): Token Plan per-call credits. API athttps://api.minimax.io/anthropic(Anthropic format). Key:MINIMAX_API_KEY. Use only as fallback. - OpenCode Zen (
opencode-zen): Pay-as-you-go athttps://opencode.ai/zen/v1. Not active in current setup.
Pitfalls
Duplicate Provider Keys Cause HTTP 400 on Session Restore
If both OPENROUTER_API_KEY and OPENCODE_GO_API_KEY are present in .env, the agent may use the wrong provider on session restore (restore_primary picks up openrouter). The model name opencode-go/deepseek-v4-flash only works on OpenCode Go — OpenRouter returns HTTP 400 "not a valid model ID".
Symptom: Dashboard shows repeated HTTP 400: opencode-go/deepseek-v4-flash is not a valid model ID errors. Agent log shows provider=openrouter model=opencode-go/deepseek-v4-flash → fail → Fallback activated: deepseek-v4-flash (opencode-go) → success.
Fix: Remove the unused provider's API key from .env. Keep only the active provider's key.
Model naming convention: When provider is opencode-go, use bare model name (deepseek-v4-flash). When provider is opencode-go, the config model name includes provider prefix (opencode-go/deepseek-v4-flash) which works with the main agent but breaks on fallback providers.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/software-development/model-routing/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/humanerd-drew/opencode-drewgent/model-routing)