# Repository Briefing: tbphp/gpt-load
> Source: https://repoforai.com/repo/tbphp/gpt-load (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/tbphp/gpt-load
- **Official Docs / Website**: https://gpt-load.com
- **Category**: LLMs & Inference (大模型与推理微调)
- **Primary Language**: Go
- **License**: MIT
- **Engineering Health**: A+ (95/100 · Maintenance 35/35 · Adoption 20/25 · Releases 20/20 · License 20/20)
- **Latest Release**: v2.0.0-rc.69 (2026-12-03) — https://github.com/tbphp/gpt-load/releases
- **Review Snapshot**: 2026-12-04
- **Deployment / Stack Signals**: Docker, Self-Hosted, API
- **Momentum**: 7,248 ★ total (+1 24h / +6 7d) · 799 forks
- **Topics**: `ai-gateway`, `anthropic`, `api-gateway`, `claude`, `claude-code`, `codex`, `gemini`, `gin`, `go`, `golang`, `llm`, `llm-gateway`
- **When to Use**: Best for: Teams that need one managed endpoint for multiple LLM providers or credentials, with scoped client access, failover policies, and shared usage visibility. Skip if: One upstream API already meets your needs, you need offline inference, or you cannot operate a separate gateway and protect its credential store.

## Overview
```text
### Architecture & Core Mechanics
GPT-Load is a self-hosted Go gateway with Gin in its dependency stack and an embedded management console. A request enters through a client-protocol endpoint with a gateway AccessKey. The key limits which groups and protocols the client can use; the group defines available models and runtime policy for a channel, and the gateway selects an upstream credential from that channel. This separates application access from provider credentials, so operators can change upstream credentials without reconfiguring every client.

Bifrost Core supports provider authentication, request and response conversion, streaming, and usage normalization. CLIProxyAPI handles OAuth and execution for subscription channels. GPT-Load itself owns encrypted credential storage, account selection, retries, health, affinity, logging, and usage policy. The integration surface is a set of built-in channels and a custom OpenAI-compatible upstream option; the client protocol and the upstream channel are separate configuration decisions.

### Key Capabilities & Differentiators
The endpoint surface goes beyond chat. It includes OpenAI Chat Completions and Responses, Anthropic Messages, Gemini model and embedding routes, plus dedicated routes for images, embeddings, reranking, speech, and Mistral OCR and transcription. Built-in channels cover official APIs, Azure OpenAI, AWS Bedrock, Google Vertex AI, services such as DeepSeek and OpenRouter, and Codex, Claude, Antigravity, and Grok subscription accounts. The endpoint list is not a guarantee that every upstream supports every operation; validate the protocol, model, and channel combinations your clients actually use.

Multiple credentials can be scheduled with configurable weights. Retries, cooldown, and blacklisting help isolate failures, while session affinity keeps related requests on the same credential. The console exposes routing, health, request logs, and usage, including token categories, cache hit rates, and cost estimates. Those estimates are useful for tracking trends, not as replacements for provider invoices.

### Trade-offs & Limitations
Compared with calling the OpenAI API directly, GPT-Load gives teams one place to manage access, credentials, routing, and usage, at the cost of an additional network hop and another service to operate. If only one upstream and one credential policy are needed, direct integration is simpler. The gateway does not run model inference or make upstream access available offline. Size it for concurrent requests, open streams, and log and database growth rather than model VRAM, and benchmark with the traffic you intend to serve.

Local credential encryption shifts key custody to the operator. Back up the database and `encryption.key` together: replacing or losing the key makes existing encrypted credentials unrecoverable, and master key rotation is not supported in this version. Treat OAuth as another operational dependency, and verify upstream terms before using subscription accounts for shared traffic. The gateway's MIT license does not grant rights to upstream services; bundled dependencies also have their own notices.

### Hardware & Deployment Guide
The provided Compose setup uses `ghcr.io/tbphp/gpt-load:2`, publishes HTTP on `127.0.0.1:3001` by default, and checks `/health`. It persists application-managed SQLite, `auth.key`, and `encryption.key` in the `gpt-load-data` volume at `/app/data`. `DATABASE_DSN` supports external MySQL or PostgreSQL; portable binaries are also available. The main listener and fixed OAuth callback ports (`1455`, `54545`, `51121`) have separate host bind overrides. Those fixed mappings conflict if you run two default Compose instances on one host.

The supplied release history lists `v2.0.0-rc.69` as a release candidate that adds HTTPS forward-proxy support. The `:2` image tracks verified beta and RC builds before GA; `latest` remains on 1.x. Pin an exact image tag for reproducible rollouts. The 2.x rewrite cannot open or import 1.x data: deploy it alongside 1.x with a fresh database and `encryption.key`, a separate data directory and volume, and non-conflicting ports. Verify client behavior before cutover and keep 1.x available for rollback.
```

## Key Capabilities
```text
- Access scope: A channel holds upstream credentials, a group defines model and runtime policy, and an AccessKey grants access by group and client protocol.
- Credential scheduling: API keys and supported OAuth subscriptions share weighted selection, retry, cooldown, blacklisting, and session affinity.
- Adapter boundaries: Bifrost Core handles provider protocol mechanics; CLIProxyAPI handles subscription OAuth and execution; GPT-Load owns scheduling and health policy.
- Protocol coverage: The gateway exposes OpenAI Responses, Anthropic Messages, Gemini embeddings, Mistral OCR and transcription, and other dedicated routes.
- Operational visibility: The embedded console shows request logs, routing and health, token categories, cache hit rates, and estimated costs.
- Recovery constraint: Back up the database with `encryption.key`; 2.x requires fresh state rather than an in-place upgrade from 1.x.
```

## Quick Start / Clone
```bash
git clone --depth 1 https://github.com/tbphp/gpt-load.git
cd gpt-load

cp .env.example .env
docker compose up -d
```
