LLM gatewayLLM gatewayLLM 网关
What is an LLM gateway?LLM gateway là gì?什么是 LLM 网关?
An LLM gateway is a proxy between your app and many model providers. You call one base URL with one API key, and the gateway routes the request, retries it on another provider when the first fails, and logs it in one place.LLM gateway là một proxy giữa ứng dụng của bạn và nhiều nhà cung cấp model. Bạn gọi một base URL với một API key, gateway định tuyến request, thử lại trên nhà cung cấp khác khi nhà đầu tiên lỗi, và ghi log ở một nơi.LLM 网关是你的应用与众多模型供应商之间的代理。你用一个 API key 调用一个 base URL,网关负责路由请求、在第一个供应商出错时换一个重试,并把日志记在同一处。
What an AI router does for youAI router giúp bạn điều gìAI 路由器为你做什么
How routing worksCách định tuyến hoạt động路由如何工作
- 1.Send a request to the gateway base URL with any model id, written provider/model.Gửi request tới base URL của gateway với id model bất kỳ, dạng provider/model.向网关 base URL 发送请求,模型 id 写作 provider/model。
- 2.The gateway picks an upstream for that model, from your own keys first when you have them.Gateway chọn một upstream cho model đó, ưu tiên key của bạn nếu có.网关为该模型选择一个上游,若你有自己的 Key 则优先使用。
- 3.On a 401, 429 or 5xx it retries the next upstream, and your client sees the final answer.Gặp 401, 429 hoặc 5xx nó thử upstream kế tiếp, và client của bạn chỉ thấy câu trả lời cuối cùng.遇到 401、429 或 5xx 时换下一个上游重试,你的客户端只看到最终结果。