Search

PythonReactSEOPDF
OpenClaw

Smart Router Skill

智能路由器技能

astralwaveorg0 source installs☆ 0 Repository stars

Installation

Follow the repository instructions for this skill and your agent. Review the files and dependencies before adding it to your workflow.

SkillHub CLI

skillhub install astralwaveorg/smart-router-skill

Inspect the source and compatibility requirements, then follow its installation steps.

Give your agent the source link and ask it to inspect instructions and dependencies before explaining the installation steps.

View source ↗Guides

Skill instructions

智能路由器技能

概述

智能路由器是一个先进的模型调度系统,它超越了简单的关键词匹配,使用多维度分析来为每个消息选择最合适的模型。系统包含成本优化、自动模型扫描和性能监控功能。

功能特性

🎯 智能路由
  • 多维度分析:消息长度、内容复杂度、模式识别
  • 动态模型选择:基于任务类型自动选择最佳模型
  • 成本感知:优先使用免费模型,复杂任务才用付费模型
  • 上下文感知:考虑对话历史和用户偏好
💰 成本优化
  • 预算控制:设置每日/每月预算限制
  • 自动降级:简单任务自动使用免费模型
  • 使用统计:实时监控各模型成本
  • 智能提醒:成本接近阈值时预警
🔄 自动化管理
  • 定期扫描:自动发现OpenRouter免费模型
  • 性能监控:实时监控路由性能和系统健康
  • 自动备份:定期备份配置和日志
  • 规则优化:基于使用数据自动优化路由规则

安装和配置

前提条件
  • OpenClaw 2026.2.13 或更高版本
  • Node.js 18+
  • OpenRouter API密钥(用于模型扫描)
快速安装
# 1. 复制技能文件到OpenClaw技能目录
cp -r smart-router-skill /opt/homebrew/lib/node_modules/openclaw/skills/

# 2. 更新OpenClaw配置以启用技能
openclaw config patch --json '{"skills":{"entries":{"smart-router":{"enabled":true}}}}'

# 3. 重启OpenClaw
openclaw gateway restart
详细安装步骤
  1. 环境变量设置:
export OPENROUTER_API_KEY="your-openrouter-api-key"
export DEEPSEEK_API_KEY="your-deepseek-api-key"
  1. 初始化系统:
cd /Users/nora/.openclaw/users/main/workspace
node enhanced-intent-router.js init
  1. 运行集成测试:
./test-integration.sh
  1. 部署系统:
node update-openclaw-config.js update
openclaw gateway restart

使用方法

基本路由
// 使用智能路由器路由消息
const { SmartIntentRouter } = require('./enhanced-intent-router.js');

const router = new SmartIntentRouter();
await router.initialize();

const decision = router.analyzeMessage("帮我写一个Python函数");
console.log(decision);
// 输出: { agentId: 'code-agent', model: '4sapi-anthropic/claude-sonnet-4-5-20250929', ... }
命令行工具

Source information

Source
github
Repository
openclaw/skills
Path
skills/astralwaveorg/smart-router-skill
Version
—
Commit
9a78914222d2d02da3c4c79be1e5a8ddf6c990e2
Classification source
rules
Status
active
Visibility
public

These signals come from indexed source analysis and may lag behind changes. Check the current source files.

Extracted content

SKILL.md
# 智能路由器技能

## 概述

智能路由器是一个先进的模型调度系统,它超越了简单的关键词匹配,使用多维度分析来为每个消息选择最合适的模型。系统包含成本优化、自动模型扫描和性能监控功能。

## 功能特性

### 🎯 智能路由
- **多维度分析**:消息长度、内容复杂度、模式识别
- **动态模型选择**:基于任务类型自动选择最佳模型
- **成本感知**:优先使用免费模型,复杂任务才用付费模型
- **上下文感知**:考虑对话历史和用户偏好

### 💰 成本优化
- **预算控制**:设置每日/每月预算限制
- **自动降级**:简单任务自动使用免费模型
- **使用统计**:实时监控各模型成本
- **智能提醒**:成本接近阈值时预警

### 🔄 自动化管理
- **定期扫描**:自动发现OpenRouter免费模型
- **性能监控**:实时监控路由性能和系统健康
- **自动备份**:定期备份配置和日志
- **规则优化**:基于使用数据自动优化路由规则

## 安装和配置

### 前提条件
- OpenClaw 2026.2.13 或更高版本
- Node.js 18+ 
- OpenRouter API密钥(用于模型扫描)

### 快速安装

```bash
# 1. 复制技能文件到OpenClaw技能目录
cp -r smart-router-skill /opt/homebrew/lib/node_modules/openclaw/skills/

# 2. 更新OpenClaw配置以启用技能
openclaw config patch --json '{"skills":{"entries":{"smart-router":{"enabled":true}}}}'

# 3. 重启OpenClaw
openclaw gateway restart
```

### 详细安装步骤

1. **环境变量设置**:
```bash
export OPENROUTER_API_KEY="your-openrouter-api-key"
export DEEPSEEK_API_KEY="your-deepseek-api-key"
```

2. **初始化系统**:
```bash
cd /Users/nora/.openclaw/users/main/workspace
node enhanced-intent-router.js init
```

3. **运行集成测试**:
```bash
./test-integration.sh
```

4. **部署系统**:
```bash
node update-openclaw-config.js update
openclaw gateway restart
```

## 使用方法

### 基本路由

```javascript
// 使用智能路由器路由消息
const { SmartIntentRouter } = require('./enhanced-intent-router.js');

const router = new SmartIntentRouter();
await router.initialize();

const decision = router.analyzeMessage("帮我写一个Python函数");
console.log(decision);
// 输出: { agentId: 'code-agent', model: '4sapi-anthropic/claude-sonnet-4-5-20250929', ... }
```

### 命令行工具

```b...

Related skills

OpenClaw

humanpages

human-pages-ai

Search and hire real humans for tasks — photography, delivery, research, and more

OpenClaw

openclaw-skills

zseven-w

Reusable skill templates for OpenClaw AI agents. Templates for API integration, data processing, web scraping, CLI tools, and file processing.

OpenClaw

0xarchive

0xfantommenace

Query historical crypto market data from 0xArchive across Hyperliquid, Lighter.xyz, and HIP-3. Covers orderbooks, trades, candles, funding rates, open interest, liquidations, and data quality. Use when the user...

OpenClaw

1sec-security

cutmob

Install, configure, and manage 1-SEC — an open-source, all-in-one cybersecurity platform (16 modules, single binary) on Linux servers and VPS instances. Use when the user asks to secure a server, install securi...