ONE AGENT INTERFACE FOR EVERY LLM PROVIDER
Go LLM 路由函式庫,具備統一 Agent 介面、多供應商路由與正規化 token 用量
從
Agenvoy2741d4a 移出為獨立套件Agenvoy v0.28.17 起,LLM provider 統一改用本套件
go-llm-router取代。
目錄
功能特點
go get github.com/pardnchiu/go-llm-router· 完整文件
- 統一 Agent 介面 — 十二家供應商共用
Send介面,呼叫端無需為各家 API 寫適配層。 - 字串路由工廠 — 以
provider@model字串一次建立對應 Agent,支援括號標籤與自訂 endpoint。 - 推理層級正規化 — 將
none到xhigh統一映射到 Claude thinking、Gemini budget、OpenAI effort 等各家機制。 - 跨供應商用量吸收 — 自動吸收
prompt_tokens/input_tokens與 cache 欄位差異,輸出一致的 Input/Output/Cache 計數。 - OAuth 與影像擴充 — 內建 Copilot/Codex/Grok OAuth 流程,Codex 另支援影像生成與多模態輸入。
架構
graph TB
App[呼叫端] --> Router[router.New]
Router --> Agent[core.Agent]
Agent --> Claude[Claude]
Agent --> OpenAI[OpenAI / Codex]
Agent --> Gemini[Gemini]
Agent --> Others[Grok / DeepSeek / 其他]
Agent --> OAuth[oauth]
Agent --> Usage[Usage 正規化]
授權
本專案採用 MIT LICENSE。
Author
邱敬幃 Pardn Chiu
hi@pardn.io
https://www.linkedin.com/in/pardnchiu
©️ 2026 邱敬幃 Pardn Chiu