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

- **GitHub URL**: https://github.com/looplj/axonhub
- **Official Docs / Website**: https://axonhub.reveric.app
- **Category**: LLMs & Inference (大模型与推理微调)
- **Primary Language**: Go
- **License**: Apache-2.0
- **Engineering Health**: A+ (97/100 · Maintenance 35/35 · Adoption 22/25 · Releases 20/20 · License 20/20)
- **Latest Release**: v1.0.0-rc.5 (2026-11-24) — https://github.com/looplj/axonhub/releases
- **Review Snapshot**: 2026-12-04
- **Deployment / Stack Signals**: Docker, Self-Hosted, API
- **Momentum**: 5,514 ★ total (+2 24h / +25 7d) · 779 forks
- **Topics**: `agent`, `agents`, `ai`, `anthropic`, `anthropic-api`, `api-gateway`, `claude`, `claude-code`, `codex`, `cost-management`, `deepseek`, `gemini-api`
- **When to Use**: Best for: Platform teams routing several AI applications or coding tools across supported providers while centralizing access, quotas, traces, and costs. Skip if: You need offline model inference, or you use a single provider and need its native API behavior without operating another service.

## Overview
```text
### Architecture & Core Mechanics
AxonHub is a Go gateway in front of upstream inference services, not a model server. Clients send requests to OpenAI-, Anthropic-, or Gemini-compatible endpoints using AxonHub credentials. For supported combinations, the gateway translates the client protocol into the selected upstream format. Provider credentials and model availability are configured on channels, separating the client-facing API from the routing and failover configuration.

The tree separates `cmd/`, `internal/`, `llm/`, and `frontend/`. The browser dashboard is used to configure providers, models, and client keys and to inspect requests and traces. `go.mod` includes Ent, gqlgen, Atlas, and `coder/websocket`, showing dependencies for data access, GraphQL, schema tooling, and WebSocket transport. The tree also includes `plugins/`, but that alone does not establish a public or stable plugin interface.

### Key Capabilities & Differentiators
The text API bridges OpenAI, Anthropic, and Gemini client formats. The provider catalog includes GPT-4o and GPT-5, Claude, Gemini 2.5, DeepSeek-V3.1, GLM-4.5, Kimi K2, Doubao, and OpenRouter. Endpoint coverage extends to image generation, embeddings, reranking, and realtime conversation. Coverage varies by provider and model: Jina AI is listed for embeddings and reranking, while AWS Bedrock and Google Cloud integrations are marked as testing.

Beyond protocol conversion, AxonHub centralizes channel load balancing and automatic failover, thread-level request timelines, role-based access, usage quotas, and data isolation. Its cost breakdown distinguishes input, output, and cached tokens per request. Those controls let operators investigate routing, usage, and spend at the same gateway, but endpoint compatibility is not a promise that every provider-specific parameter, tool call, or streaming behavior translates unchanged.

### Trade-offs & Limitations
Compared with calling the OpenAI API directly, AxonHub lets multiple applications keep a common client-facing interface while an operator changes upstream channels, applies quotas, and tracks usage in one place. The trade-off is another network hop and another service to operate: the gateway, its database, and its credential store become infrastructure shared by downstream clients. A single-provider application that relies on provider-native features may be simpler to run against the native API.

Changing the base URL and key can be enough for basic chat, but validate streaming, tool calls, error handling, and failover under real traffic before treating different channels as interchangeable. Self-hosting gives you control over gateway configuration and storage, not over how an external provider processes forwarded requests. Review trace access and retention alongside provider data policies. For redistribution or modified builds, inspect `NOTICE`, `LICENSE`, and `llm/LICENSE`: the project uses both Apache-2.0 and LGPL-3.0.

### Hardware & Deployment Guide
The Docker Compose path pairs AxonHub with PostgreSQL and persists the database in a named volume. Set `AXONHUB_IMAGE`, `POSTGRES_IMAGE`, and `DB_PASSWORD`; use immutable image digests for production. The default host bind is loopback. For `server.base_path: /axonhub` or `AXONHUB_SERVER_BASE_PATH=/axonhub`, configure the reverse proxy to forward the full path without stripping the prefix. The dashboard is at `/axonhub/`, the OpenAI-compatible base URL at `/axonhub/v1`, and the health endpoint at `/axonhub/health`.

After startup, create an administrator, add and test a provider channel and its models, then issue an AxonHub key for clients. The gateway does not need model VRAM; size it for concurrent traffic and long-lived connections, and size PostgreSQL for request volume and retained traces. Self-hosting the gateway still requires connectivity to the configured upstream endpoints. The v1.0.0-rc.3 through rc.5 releases list desktop builds with automatic updates; evaluate those separately from the Compose server path, and test upgrades and restores before putting a release candidate into production.
```

## Key Capabilities
```text
- Protocol translation: OpenAI-, Anthropic-, and Gemini-compatible text APIs with configurable upstream provider channels.
- Routing: Load balancing and automatic failover across configured channels, managed separately from client SDK integration.
- Usage governance: RBAC, usage quotas, data isolation, and per-request costs broken down by input, output, and cached tokens.
- Observability: Thread-level request timelines for diagnosing errors across related calls.
- API coverage: Text generation, image generation, embeddings, reranking, and realtime conversation, with provider-specific coverage.
- Self-hosting: Docker Compose pairs the Go gateway with PostgreSQL; explicit image references, a required database password, and a loopback bind establish the default deployment posture.
```

## Quick Start / Clone
```bash
from openai import OpenAI

client = OpenAI(
    base_url="http://localhost:8090/v1",
    api_key="your-axonhub-api-key"
)

response = client.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": "Hello, AxonHub!"}]
)

print(response.choices[0].message.content)
```
