Token导航 LogoToken导航TokenDH.com
效率需要联网clawhub未标认证来源可访问clear审计提醒

semantic-model-router语义模型路由器

Agent Skill

semantic-model-router 用于补充效率相关能力,适合在 OpenClaw 中需要让 Agent 承接效率相关任务时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

12,795

周安装

544

GitHub Stars

公开资料未说明

下载量

4,483
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:semantic-model-router(语义模型路由器)
来源仓库:https://github.com/rayray1218/semantic-model-router
安装命令:
openclaw skills install semantic-model-router
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install semantic-model-router

简介

智能路由查询至性价比最优的大语言模型。

  • 覆盖 Anthropic、OpenAI、Google 等 17 种主流模型。
  • 自动平衡成本与性能,提升响应效率。semantic-model-router 属于效率类 Skill,可作为该场景下的辅助能力补充。
  • 安装命令:openclaw skills install semantic-model-router。
  • 需配置各模型 API 密钥并监控计费策略。

SKILL.md

name
semantic-model-router
description
Smart LLM Router — routes every query to the cheapest capable model. Supports 17 models across Anthropic, OpenAI, Google, DeepSeek & xAI (Grok). Uses a pre-trained ML classifier. No extra API keys required.
version
1.0.2
author
Ray
tags
[llm-ops, routing, cost-saving, openclaw, semantic-router, multi-model]
homepage
https://github.com/rayray1218/ClawSkill-Semantic-Router
files
["scripts/model_router.py", "scripts/model_weights.py", "scripts/requirements.txt"]
dependencies

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:

  1. ML Classifier (primary): A Logistic Regression model trained on 6,000+ labeled queries. Runs in <1ms from embedded weights in model_weights.py.
  2. Semantic Embeddings (fallback): Cosine similarity to tier intent vectors via sentence-transformers.
  3. Keyword Rules (last resort): Pattern matching with no dependencies.
TierDefault ModelTypical WorkloadCost/1Mvs Baseline
BASICdeepseek/deepseek-chatGreetings, simple Q&A, chit-chat$0.1499% saved
BALANCEDopenai/gpt-4o-miniSummaries, translations, explanations$0.1599% saved
ELITEanthropic/claude-sonnet-4-6Complex coding, architecture, security$3.0070% saved

Supported Models (17 total, verified Feb 2026)

Anthropic

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

OpenAI

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

Google

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

DeepSeek

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

xAI (Grok)

ModelInput /1MOutput /1M
xai/grok-3$3.00$15.00
xai/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.*

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

95.54%
按下载量换算4,283

安全审计

VirusTotal

通过

ClawScan

可疑

Static analysis

未展示

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills