feat: implement MVP LLM router service

实现基于 token 长度的简单规则路由服务:
- FastAPI 基础服务 (/v1/chat/completions)
- 根据 token 长度自动选择模型 (gpt-3.5/gpt-4o-mini/gpt-4o)
- 成本追踪和统计 (/stats)
- 健康检查端点 (/health)
- 总计 224 行代码
This commit is contained in:
2026-04-17 23:33:43 +08:00
parent 55506952c1
commit 4a8de8925e
4 changed files with 287 additions and 0 deletions

8
requirements.txt Normal file
View File

@@ -0,0 +1,8 @@
fastapi>=0.104.0
uvicorn[standard]>=0.24.0
pydantic>=2.5.0
openai>=1.6.0
tiktoken>=0.5.0
httpx>=0.25.0
pytest>=7.4.0
pytest-asyncio>=0.21.0