looplj/axonhub
Self-hosted LLM gateway for cross-provider routing, failover, and cost tracking
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & 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.
Platform teams routing several AI applications or coding tools across supported providers while centralizing access, quotas, traces, and costs.
You need offline model inference, or you use a single provider and need its native API behavior without operating another service.
Quick Start & Installation
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)
Comparison vs. Top LLMs & Inference Alternatives
Full comparison →| Repository | Stars | 7d Trend | Stack | License | Core Positioning |
|---|---|---|---|---|---|
| axonhub ★ | 5.5k | +25 | Go | Apache-2.0 | Self-hosted LLM gateway for cross-provider routing, failover, and cost tracking |
| gpt-load | 7.2k | +6 | Go | MIT | Self-hosted Go gateway for routing LLM traffic across providers and credentials |
| bifrost | 10.2k | +125 | Go | Apache-2.0 | Self-hosted Go gateway for routing and governing multi-provider LLM traffic |
| freellmapi | 62k | +2.6k | TypeScript | MIT | Self-hosted LLM gateway for routing across free tiers and custom endpoints |
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/looplj/axonhub.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about axonhub
How do I route an existing SDK through AxonHub?
/v1 endpoint and use an AxonHub API key. Then select a model configured on an enabled provider channel. The SDK can stay in place, but changing providers still calls for testing the endpoint, request options, and response behavior your application uses.Does the gateway need a GPU, and what should I size instead?
Can we self-host it commercially, and what compliance checks matter?
NOTICE, LICENSE, and llm/LICENSE to establish component scope and check the applicable obligations, especially if you modify or redistribute a build. Separately review provider terms and data-handling requirements: running the gateway yourself does not keep prompts on your infrastructure when requests are routed to an external provider.When is AxonHub a better fit than calling the OpenAI API directly?
Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy