opencode-model-router
Skill1 starsChanged 12 days agoMITView on GitHub
Route, inspect, lock, and synchronize AI models for OpenCode workspaces. Use when configuring OpenCode models, updating .opencode/opencode.json, tuning reasoning levels, locking a project to a specific model, setting tier priority, or automating model fallback and quota recovery.
In this repository95 other files it gives its agents.
- AGENTS.mdAGENTS.md
- docs/AGENTS.mdAGENTS.md
- agent-architectureSkill
- agentic-evalSkill
- agent-owasp-complianceSkill
- agent-skill-stackSkill
- ai-readySkill
- ai-team-orchestrationSkill
- answer-me-with-htmlSkill
- anti-ui-slopSkill
- archifySkill
- autoresearchSkill
- batch-script-progressSkill
- cli-creatorSkill
- codebase-designSkill
- code-exemplars-blueprint-generatorSkill
- copilot-instructions-blueprint-generatorSkill
- create-agentsmdSkill
- create-architectural-decision-recordSkill
- create-github-action-workflow-specificationSkill
- create-github-issues-feature-from-implementation-planSkill
- create-readmeSkill
- create-specificationSkill
- create-technical-spikeSkill
- create-tldr-pageSkill
- docs-sync-auditSkill
- folder-structure-blueprint-generatorSkill
- gh-fix-ciSkill
- github-actions-hardeningSkill
- github-repo-careSkill
- impeccableSkill
- launchd-automationSkill
- mcp-security-auditSkill
- notion-cliSkill
- playwright-cliSkill
- python-pypi-package-builderSkill
- refactorSkill
- simple-englishSkill
- swiftui-expert-skillSkill
- technical-documentationSkill
- workshop-driverSkill
- xerj-hubSkill
- xerjSkill
- anti-ui-slopSkill
- autoresearchSkill
- batch-script-progressSkill
- calling-frontend-from-tauri-rustSkill
- calling-rust-from-tauri-frontendSkill
- cli-creatorSkill
- codebase-designSkill
- code-exemplars-blueprint-generatorSkill
- configuring-tauri-appsSkill
- configuring-tauri-capabilitiesSkill
- configuring-tauri-cspSkill
- configuring-tauri-permissionsSkill
- configuring-tauri-scopesSkill
- copilot-instructions-blueprint-generatorSkill
- create-agentsmdSkill
- create-architectural-decision-recordSkill
- create-github-action-workflow-specificationSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 148
When set on a target, the router dynamically formats the model tag (e.g.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
OpenCode Model Router
opencode-model-router is a lightweight, zero-hardcoding developer utility that manages, routes, and synchronizes AI models into OpenCode project configurations (.opencode/opencode.json or opencode.json).
Core Invariants
- Single Source of Truth: Persistent configuration lives in exactly one canonical location:
~/.config/opencode-model-router/register.yaml(respects$XDG_CONFIG_HOME). - CLI-First Mutation: Mutate targets, locks, sync flags, and priorities via dedicated CLI commands (
target,lock,unlock,priority,apply). Avoid hand-editing raw YAML. - Zero Hardcoded Whitelists: Models, reasoning levels, and workspaces are resolved dynamically at runtime without static python model lists.
- Fail-Closed Logging: Any errors or network timeouts log cleanly to
~/.config/opencode-model-router/logs/sync.logwithout corrupting working configs.
Quick Reference Commands
1. Apply Active Model to a Project
Applies the current best model (or the project's locked model) and updates 2-tier fallback:
# Apply to current directory (auto-detects .opencode/opencode.json)
opencode-model-router apply
# Apply to a registered target alias
opencode-model-router apply paper-base
# Apply to an arbitrary directory path
opencode-model-router apply ~/my-project
# Override reasoning level on the fly
opencode-model-router apply . --reasoning max
# Force a specific model ID
opencode-model-router apply . --model opencode-go/deepseek-v4.1-flash#max
# JSON output for scripts and automation
opencode-model-router apply paper-base --json2. Lock & Unlock a Project
Pin a project to a specific model so background sync or automated swaps never change it:
# Lock project to a specific model
opencode-model-router lock . --model opencode-go/deepseek-v4.1-flash#max
# Lock by registered target alias
opencode-model-router lock paper-base --model pinned/custom-model
# Unlock to resume dynamic automated routing
opencode-model-router unlock paper-base3. Register & Manage Targets (target)
Manage projects in ~/.config/opencode-model-router/register.yaml:
# List all registered targets
opencode-model-router target list
opencode-model-router target list --json
# Register a new project target with reasoning level
opencode-model-router target add paper-base ~/academic-space/knowledge-space --reasoning max
# Update existing target properties
opencode-model-router target set paper-base --reasoning high --sync
opencode-model-router target set paper-base --no-sync
# Remove a target
opencode-model-router target remove paper-base4. Global Priority Ordering (priority)
Configure the tier search priority for Primary and Fallback model selection:
# View current tier priority order
opencode-model-router priority get
# [+] Active routing priority: go > go-free > zen-free
# Set custom tier priority (e.g. prioritize unlimited free models first)
opencode-model-router priority set go-free zen-free go
# [+] Routing priority set to: go-free > zen-free > go5. Self-Update (update)
Upgrade the CLI in-place:
opencode-model-router update6. Health & Diagnostics
# Run smoke tests across OpenCode spaces
opencode-model-router check --json
# View current router state and freshness
opencode-model-router --status --jsonTarget Configuration Schema
Targets in ~/.config/opencode-model-router/register.yaml follow this schema:
version: 2
routing:
priority:
- go # OpenCode Go primary tier
- go-free # OpenCode Go unlimited free tier
- zen-free # OpenCode Zen free tier
targets:
development:
path: ~/development-space
sync: true
reasoning_level: high
locked: false
paper-base:
path: ~/academic-space/knowledge-space
sync: true
reasoning_level: max
locked: true
locked_model: opencode-go/deepseek-v4.1-flash#max
locked_fallback: opencode/deepseek-v4.1-flash-freeReasoning Levels
Supported reasoning depth levels: max, high, medium, low, none.
When set on a target, the router dynamically formats the model tag (e.g. #max, #high). If set to none, the model remains unadorned.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

