> [!NOTE]
> This README was generated by [SKILL](https://github.com/agenvoy/skill-readme-generate), get the ZH version from [here](https://go-llm-router.pardn.io/zh/).

***

<p align="center">
<strong>ONE AGENT INTERFACE FOR EVERY LLM PROVIDER</strong>
</p>

<p align="center">
<a href="https://pkg.go.dev/github.com/pardnchiu/go-llm-router"><img src="https://img.shields.io/badge/GO-REFERENCE-blue?include_prereleases&style=for-the-badge" alt="Go Reference"></a>
<a href="https://github.com/pardnchiu/go-llm-router/releases"><img src="https://img.shields.io/github/v/tag/pardnchiu/go-llm-router?include_prereleases&style=for-the-badge" alt="Release"></a>
<a href="LICENSE"><img src="https://img.shields.io/github/license/pardnchiu/go-llm-router?include_prereleases&style=for-the-badge" alt="License"></a>
</p>

***

> 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 `Agenvoy` [2741d4a](https://github.com/agenvoy/Agenvoy/commit/2741d4a3be70c5bfac1bba9e1d5d54a65db15acd)
>
> **Since v0.28.17**, Agenvoy's LLM providers are unified and replaced by this package `go-llm-router`.

## Table of Contents

- [Features](#features)
- [Architecture](#architecture)
- [License](#license)
- [Author](#author)

## Features

> `go get github.com/pardnchiu/go-llm-router` · [Documentation](https://github.com/pardnchiu/go-llm-router/blob/master/doc/doc.md)

- **Unified Agent Interface** — Fourteen providers share one `Send` / `SendStream` contract, so callers never write per-vendor adapters.
- **String Routing Factory** — Resolve an Agent from a `provider@model` name; an unknown prefix falls through to an OpenAI-compatible endpoint as a named instance.
- **Reasoning Level Normalization** — Six levels from `none` to `max` map onto Claude thinking, Gemini budgets, and OpenAI effort, clamped to each model's range.
- **Usage Field Absorption** — `prompt_tokens` / `input_tokens` and 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

> [Full Architecture](https://github.com/pardnchiu/go-llm-router/blob/master/doc/architecture.md)

```mermaid
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](https://github.com/pardnchiu/go-llm-router/blob/master/LICENSE).

## Author

Just [open an issue](https://github.com/pardnchiu/go-llm-router/issues/new) to share an idea.

<a href="https://github.com/pardnchiu/go-llm-router/graphs/contributors">
  <img src="https://contrib.rocks/image?repo=pardnchiu/go-llm-router&cache_bust=2026-10-06" alt="go-llm-router contributors" />
</a>

***

©️ 2026 [邱敬幃 Pardn Chiu](https://www.linkedin.com/in/pardnchiu)
