pardnchiu/go-llm-router
Last updated
[!NOTE] This README was generated by SKILL, get the ZH version from here.
ONE AGENT INTERFACE FOR EVERY LLM PROVIDER
A Go LLM library with a unified LLM API for 14 providers, provider@model routing, and normalized streaming and usage
Extracted as a standalone package from
Agenvoy2741d4aSince v0.28.17, Agenvoy's LLM providers are unified and replaced by this package
go-llm-router.
Table of Contents
Features
go get github.com/pardnchiu/go-llm-router· Documentation
- Unified Agent Interface — Fourteen providers share one
Send/SendStreamcontract, so callers never write per-vendor adapters. - String Routing Factory — Resolve an Agent from a
provider@modelname; an unknown prefix falls through to an OpenAI-compatible endpoint as a named instance. - Reasoning Level Normalization — Six levels from
nonetomaxmap onto Claude thinking, Gemini budgets, and OpenAI effort, clamped to each model's range. - Usage Field Absorption —
prompt_tokens/input_tokensand every cache variant fold into a single Input / Output / Cache shape. - Multimodal and OAuth Extensions — Built-in Copilot / Codex / Grok OAuth flows, plus image generation, speech-to-text, and text-to-speech agents.
Architecture
graph TB
App[Caller] --> Router[router.New]
Router --> Agent[llmrouter.Agent]
Agent --> KeyBased[Key-based providers]
Agent --> OAuthBased[OAuth providers]
Agent --> Compat[OpenAI-compatible endpoints]
OAuthBased --> OAuth[core/oauth token store]
Agent --> Stream[Stream event normalization]
Agent --> Usage[Usage normalization]
Agent --> Media[Image / audio agents]
License
This project is licensed under the MIT LICENSE.
Author
Just open an issue to share an idea.
©️ 2026 邱敬幃 Pardn Chiu