# Send semantic-model-router to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- Download the package from Yavira.
- Extract it into a folder your agent can access.
- Paste one of the prompts below and point your agent at the extracted folder.
## Suggested prompts
### New install

```text
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete.
```
### Upgrade existing

```text
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "semantic-model-router",
    "name": "semantic-model-router",
    "source": "tencent",
    "type": "skill",
    "category": "AI 智能",
    "sourceUrl": "https://clawhub.ai/rayray1218/semantic-model-router",
    "canonicalUrl": "https://clawhub.ai/rayray1218/semantic-model-router",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/semantic-model-router",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=semantic-model-router",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "scripts/model_router.py",
      "scripts/model_weights.py",
      "scripts/requirements.txt",
      "SKILL.md"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-30T16:55:25.780Z",
      "expiresAt": "2026-05-07T16:55:25.780Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
        "contentDisposition": "attachment; filename=\"network-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/semantic-model-router"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    }
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/semantic-model-router",
    "downloadUrl": "https://openagent3.xyz/downloads/semantic-model-router",
    "agentUrl": "https://openagent3.xyz/skills/semantic-model-router/agent",
    "manifestUrl": "https://openagent3.xyz/skills/semantic-model-router/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/semantic-model-router/agent.md"
  }
}
```
## Documentation

### Semantic Model Router

Smart LLM router that saves up to 99% on inference costs by routing each request to the cheapest model that can handle it. Powered by a pre-trained ML classifier and semantic embeddings — no external calls, no API keys needed.

### Install

openclaw plugins install @rayray1218/semantic-model-router

### Quick Start

from scripts.model_router import ModelRouter

router = ModelRouter()
res = router.route("Design a distributed caching layer for a fintech platform.")
print(res["report"])
# [ClawRouter] anthropic/claude-sonnet-4-6 (ELITE, ml, conf=0.97)
#              Cost: $3.0/M | Baseline: $10.0/M | Saved: 70.0%

### How Routing Works

Queries are classified into three tiers through a 3-stage pipeline:

ML Classifier (primary): A Logistic Regression model trained on 6,000+ labeled queries. Runs in <1ms from embedded weights in model_weights.py.
Semantic Embeddings (fallback): Cosine similarity to tier intent vectors via sentence-transformers.
Keyword Rules (last resort): Pattern matching with no dependencies.

TierDefault ModelTypical WorkloadCost/1Mvs BaselineBASICdeepseek/deepseek-chatGreetings, simple Q&A, chit-chat$0.1499% savedBALANCEDopenai/gpt-4o-miniSummaries, translations, explanations$0.1599% savedELITEanthropic/claude-sonnet-4-6Complex coding, architecture, security$3.0070% saved

### Anthropic

ModelInput /1MOutput /1Manthropic/claude-sonnet-4-6$3.00$15.00 ★ ELITE defaultanthropic/claude-opus-4-5$5.00$25.00anthropic/claude-haiku-4-5$0.80$4.00

### OpenAI

ModelInput /1MOutput /1Mopenai/gpt-5$1.25$10.00openai/gpt-4o$2.50$10.00openai/gpt-4o-mini$0.15$0.60 ★ BALANCED defaultopenai/o3$2.00$8.00openai/o4-mini$1.10$4.40

### Google

ModelInput /1MOutput /1Mgoogle/gemini-3.0-pro$1.25$10.00google/gemini-2.5-pro$1.25$10.00google/gemini-2.5-flash$0.30$2.50google/gemini-2.5-flash-lite$0.10$0.40

### DeepSeek

ModelInput /1MOutput /1Mdeepseek/deepseek-chat (V3.2)$0.28$0.42 ★ BASIC defaultdeepseek/deepseek-reasoner (V3.2)$0.28$0.42

### xAI (Grok)

ModelInput /1MOutput /1Mxai/grok-3$3.00$15.00xai/grok-3-mini$0.30$0.50

Pricing source: Official API docs of each provider, verified Feb 2026.

### Override Models at Runtime

# Use GPT-5.2 for ELITE, Gemini Flash Lite for BASIC
router = ModelRouter(
    elite_model="openai/gpt-5.2",
    balanced_model="google/gemini-2.5-flash",
    basic_model="google/gemini-2.5-flash-lite",
)

# Swap a tier's model without recreating the router
router.set_model("ELITE", "anthropic/claude-opus-4-5")

### List All Available Models (CLI)

python3 scripts/model_router.py --list-models

### CLI Usage

# Route a single query
python3 scripts/model_router.py "Implement AES encryption from scratch"

# Override ELITE model
python3 scripts/model_router.py --elite openai/gpt-5.2 "Write a compiler"

# Run full smoke-test
python3 scripts/model_router.py

### Dynamic Keyword Expansion

router.add_keywords("ELITE", ["cryptographic proof", "zero-knowledge"])

### Example Output

Query                                              Predicted  Expected   ✓  Cost Info
────────────────────────────────────────────────────────────────────────────────────
How are you doing today?                           BASIC      BASIC      ✓  $0.14/M  saved 98.6%
Summarize this article in three bullet points.     BALANCED   BALANCED   ✓  $0.15/M  saved 98.5%
Implement a thread-safe LRU cache in Python.       ELITE      ELITE      ✓  $3.0/M   saved 70.0%

### Security & Privacy

Zero external calls: All classification runs locally.
No API keys: The router itself needs none.
Transparent weights: All model parameters live in scripts/model_weights.py — fully auditable.

Save costs, route smarter. Built for the OpenClaw community.
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: rayray1218
- Version: 1.0.3
## Source health
- Status: healthy
- Source download looks usable.
- Yavira can redirect you to the upstream package for this source.
- Health scope: source
- Reason: direct_download_ok
- Checked at: 2026-04-30T16:55:25.780Z
- Expires at: 2026-05-07T16:55:25.780Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/semantic-model-router)
- [Send to Agent page](https://openagent3.xyz/skills/semantic-model-router/agent)
- [JSON manifest](https://openagent3.xyz/skills/semantic-model-router/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/semantic-model-router/agent.md)
- [Download page](https://openagent3.xyz/downloads/semantic-model-router)