Skip to main content

airmux

One self-hosted LLM gateway. Any compatible client. Multiple providers.

Connect through a supported inference API while `airmux` centralizes provider translation, routing, policy, credentials, failover, and usage accounting behind one endpoint.

CI PyPI Python 3.13+ Elastic License 2.0

Quickstart · Documentation · Contributing · Report a bug

airmux gives applications, agents, CLIs, and services one self-hosted origin for calling multiple provider families. Clients send Chat Completions, Responses, or Messages requests through any SDK or integration that can target the corresponding HTTP API. airmux authenticates the workspace, applies policy, selects a model and scoped provider credential, translates the request, and records the result.

You run the whole platform: a web console, organizations and workspaces, managed provider credentials, live policy, and persistent usage history with estimated cost.

Quickstart

Run the full platform on one machine. You need Docker with Compose 2.24.4+ and an API key for at least one provider.

curl -fsSLO https://github.com/michel-tricot/airmux/releases/latest/download/docker-compose.yml
mkdir -p airmux-config
docker compose up -d --wait
docker compose exec cli airmux quickstart --url http://localhost:8080

Enter a provider key when prompted. quickstart sets up your account and workspace, prints an inference key, and sends a real model request. Open localhost:8080 for the console, where the request appears with its model, tokens, and estimated cost.

The quickstart guide continues through finding that request in the console. See customize the Docker deployment when you need to change runtime settings.

Goal Command
List catalog models docker compose exec cli airmux models list
Inspect the installation docker compose exec cli airmux doctor
Follow gateway activity docker compose exec cli airmux events tail --interval 2 --keep 30
Follow service logs docker compose logs -f cli
Stop while preserving state docker compose down

Use your existing client

Any client that can target one of airmux's HTTP APIs and send an inference key through Authorization: Bearer or x-api-key can connect. That includes SDKs, agent frameworks, CLIs, services, and raw HTTP integrations.

API Endpoint
Chat Completions POST /inf/v1/chat/completions
Responses POST /inf/v1/responses
Messages POST /inf/v1/messages
Model discovery GET /inf/v1/models and GET /inf/v1/models/{model_id}

The OpenAI SDK is one example. Point it at /inf/v1 and replace the upstream key with an airmux inference key:

import os

from openai import OpenAI

client = OpenAI(
    base_url="http://127.0.0.1:8080/inf/v1",
    api_key=os.environ["AIRMUX_INFERENCE_KEY"],
)

response = client.chat.completions.create(
    model="openai/gpt-4o-mini",
    messages=[{"role": "user", "content": "Why use an LLM gateway?"}],
)

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

The client protocol does not constrain the provider route. A Messages request can target an OpenAI-compatible model, and a Chat Completions request can target an Anthropic model. airmux translates the request and returns the response and errors in the caller's dialect. See the SDK guide for client examples.

Why airmux

  • Protocol-first clients: connect any SDK, agent framework, CLI, service, or raw HTTP integration that speaks an exposed API
  • Policy at the gateway: compose model and provider allowlists, price ceilings, spending budgets, request limits, credential rules, denials, strict parameters, and fallbacks
  • Scoped provider secrets: separate instance, organization, and workspace credentials without exposing secret values to configuration bundles
  • Predictable failover: retry eligible credentials and route to bounded backup models without escaping workspace policy
  • Complete request records: capture tokens, estimated cost, latency, status, credential scope, configuration version, and every fallback attempt
  • A resilient request path: gateways evaluate immutable local bundles and can keep serving through a control-plane outage

The shipped catalog includes Anthropic, Cerebras, DeepSeek, Fireworks, Groq, Mistral, OpenAI, Together, and xAI. Model IDs, prices, context windows, modalities, capabilities, and parameter support are explicit, inspectable data in the taxonomy.

Gateway-only mode

A secondary path for one inference endpoint managed through local files, with no Docker, Postgres, console, or usage history. You need Python 3.13+, uv, and a provider key:

uv tool install airmux
export OPENAI_API_KEY='your-provider-key'
airmux gateway init
airmux gateway serve

init creates configuration, a model taxonomy, and a private inference key under .airmux/. Continue with the gateway-only guide.

Architecture

airmux separates mutable management work from the inference request path.

flowchart LR
  A[Application] -->|Inference key| G[Data plane]
  U[Operator] --> C[Console or CLI]
  C --> M[Control plane]
  M --> P[(Postgres)]
  M --> S[(Secret store)]
  M -->|Versioned bundles| G
  G -->|Cold secret resolution| S
  G -->|Provider request| L[LLM provider]
  G -->|Usage and health| M

Caller dialects and provider protocols cross through one canonical model, so adding a caller dialect costs one ingress adapter and adding a provider family costs one egress adapter. The control plane compiles complete, versioned organization bundles that gateways validate and adopt atomically, so inference never reads the management database and an in-flight request never observes partially updated policy.

Read the architecture guide for the full data flow, failure boundaries, and deployment shapes.

Documentation

I want to... Start here
Run airmux and see it working Quickstart
Connect an application Use an SDK
Control routing, access, and spending Workspace policies
Understand usage and cost Usage and activity
Deploy airmux Deployment overview
Deploy without Docker Linux host deployment
Customize a Docker deployment Docker Compose
Upgrade or roll back a deployment Docker Compose, without Docker, or separate services
Call the management API Management API
Work on the project Contributing and Development guide

The complete management API is generated from lib/api-spec/openapi.yaml.

Release files for airmux 0.2.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for airmux 0.2.5
File Size Uploaded
airmux-0.2.5.tar.gz 230.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for airmux 0.2.5
File Interpreter ABI Platform
airmux-0.2.5-py3-none-any.whl Python 3 none any Details

Total release size: 557.4 kB

Release files / airmux-0.2.5.tar.gz

Download URL airmux-0.2.5.tar.gz
Size 230.0 kB
Tags Source
SHA-256 checksum
How to use checksums
f5456245bbe1fc23a109b6a8d9f2c136ae3cead72d33bd7f9c348e1b41c2082f
BLAKE2b-256 checksum
How to use checksums
ea64028b90327e5ccda4ba1d1171bb54caa6cfce443eff1b727470c74122dc71
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 26, 2026.

Transparency log

Release files / airmux-0.2.5-py3-none-any.whl

Download URL airmux-0.2.5-py3-none-any.whl
Size 327.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bab3107c7c1b390c895efafa8fe44b7b73bb599d0a177ec379120bcbdcad43fc
BLAKE2b-256 checksum
How to use checksums
db0b87f51568af5cdf83630a4344ac1de42be6c2a12d305779d132a73f0dfa04
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 26, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.5 This release

2 release files

0.2.3

2 release files

0.2.0

2 release files

0.1.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page