Files
nexus/wiki/concepts/SemanticRouting.md
2026-04-27 16:26:34 +08:00

33 lines
1.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "SemanticRouting"
type: concept
tags: ["routing", "llm-ops", "intelligent-routing"]
sources: ["engineering-autonomous-optimization-architect"]
last_updated: 2026-04-26
---
## Aliases
- Semantic Routing
- 语义路由
- Intent Routing
- Task-Aware Routing
## Definition
语义路由是 [[AutonomousOptimizationArchitect]] 的决策核心——根据任务类型、历史性能评分和当前 Provider 状态,动态选择最优的 LLM Provider。Provider 按"优化分数"Speed + Cost + Accuracy 综合排名)排序,优先尝试排名最高的可用 Provider。
## Mechanism
1. **任务分析**:理解用户请求的类型和复杂度(如代码生成 vs. 闲聊)
2. **Provider 排名**:按历史优化分数对所有 Provider 排序
3. **动态选择**:从最高排名 Provider 开始尝试,直到找到可用且在成本限制内的 Provider
4. **持续学习**[[LLMasJudge]] 评分结果更新各 Provider 在特定任务类型上的排名
## Key Properties
- **成本感知**:始终追踪每百万 Token 成本,优先使用低成本模型
- **性能自适应**:根据 [[ShadowTraffic]] 数据动态调整排名
- **故障感知**:熔断器切断的 Provider 自动跳过
## Connections
- [[AutonomousOptimizationArchitect]] — 语义路由是核心路由决策逻辑
- [[CircuitBreaker]] — 提供故障感知的 Provider 过滤
- [[LLMasJudge]] — 提供更新路由权重的数据