首页/ AI 技能 / @skilllib/skill-2117939930272415946
Skill站外收录 @skilllib/skill-2117939930272415946

openrouter-routing-rules

根据请求内容、紧急程度或成本限制,动态选择最合适的语言模型,实现按需智能路由,在保证效果的同时兼顾响应速度与使用成本。

0.0 (0) 28 次安装 原作者 编程导航
收录于 2026-01-22

Skills.MD

# OpenRouter Routing Rules ## Overview This skill covers implementing request-based routing logic to select optimal models based on content, urgency, or cost constraints. ## Prerequisites - OpenRouter integration - Understanding of model capabilities and pricing ## Instructions Follow these steps to implement this skill: 1. **Verify Prerequisites**: Ensure all prerequisites listed above are met 2. **Review the Implementation**: Study the code examples and patterns below 3. **Adapt to Your Environment**: Modify configuration values for your setup 4. **Test the Integration**: Run the verification steps to confirm functionality 5. **Monitor in Production**: Set up appropriate logging and monitoring ## Overview This skill covers implementing request-based routing logic to select optimal models based on content, urgency, or cost constraints. ## Prerequisites - OpenRouter integration - Understanding of model capabilities and pricing ## Basic Routing Strategies ### Content-Based Routing ```python def route_by_content(prompt: str) -> str: """Route to appropriate model based on content analysis.""" prompt_lower = prompt.lower() # Code-related if any(word in prompt_lower for word in ["code", "function", "debug", "python", "javascript"]): return "anthropic/claude-3.5-sonnet" ## Detailed Reference See `{baseDir}/references/implementation.md` for complete implementation guide.

评论 0

还没有评论,来抢沙发。