looplj/axonhub

⚡️ Open-source AI Gateway — Use any SDK to call 100+ LLMs. Built-in failover, load balancing, cost control & end-to-end tracing.

AxonHub – All‑in‑one AI Development Platform

What it is – AxonHub is a self‑hosted gateway written in Go that sits between your application code and any large‑language‑model (LLM) provider. It lets you keep the same SDK (e.g., OpenAI’s Python client) while swapping the underlying model vendor (OpenAI, Anthropic, Gemini, etc.) just by changing a config file.

Key capabilities

Feature What you get
Any SDK → Any model Use the OpenAI, Anthropic, or other SDKs and have requests automatically translated to the API of the chosen provider. No code changes needed.
Full request tracing Thread‑level logs show the complete timeline of each call, making debugging fast.
Enterprise‑grade RBAC Fine‑grained permissions, usage quotas and data isolation for teams.
Smart load‑balancing & fail‑over < 100 ms routing decisions; automatically reroute to the healthiest channel if one provider degrades.
Real‑time cost tracking Token‑level cost breakdown (input, output, cache) shown per request and aggregated for budgeting.
Multi‑modal APIs Text generation, image generation, embeddings, reranking and (planned) realtime chat.
Supported providers OpenAI, Anthropic, Zhipu (GLM), Moonshot, DeepSeek, ByteDance Doubao, Gemini, Jina AI, OpenRouter, AWS Bedrock (testing), Google Cloud (testing), NanoGPT, etc.

How it works – AxonHub exposes a set of REST/GraphQL endpoints that mimic the OpenAI API shape. When a request arrives, AxonHub:

  1. Authenticates the caller via an AxonHub API key.
  2. Looks up the target provider/channel (configured with its own API key).
  3. Translates the payload to the provider’s native format.
  4. Sends the request, records latency, token usage and cost, and returns a response in the original OpenAI‑style schema.

Quick start (after deployment)

from openai import OpenAI

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

resp = client.chat.completions.create(
    model="gpt-4o",                     # any model name you have enabled
    messages=[{"role": "user", "content": "Hello, AxonHub!"}]
)
print(resp.choices[0].message.content)

The same code works if you later switch the channel to Claude, Gemini, or a Chinese‑language model – only the AxonHub config changes.

Typical use cases

  • Vendor lock‑in avoidance – test or migrate between providers without rewriting client code.
  • Cost optimisation – route cheap‑to‑use models for low‑priority tasks while keeping premium models for critical queries.
  • Observability & governance – centralised logs, per‑team quotas and cost dashboards for compliance teams.
  • Multi‑modal applications – combine text, image, embedding and rerank APIs behind a single endpoint.

Deployment – The project ships a Docker image (docker-ready badge) and can run on any host that supports Go. The README links a demo instance on Render.com and provides a deploy-axonhub skill for automated setup.

Documentation & community – Full Chinese and English docs, API reference, guides for tracing, permissions, load‑balancing and cost tracking are hosted in the repo and on a DeepWiki site. The project is open‑source under Apache‑2.0/LGPL‑3.0 dual licensing.


Bottom line – AxonHub is a practical, production‑ready gateway that abstracts away the differences between LLM providers, giving developers a single, observable API surface for all their AI models.

Related

  • Project
  • Project
  • Project
  • Project
  • Project