Skip to content

Open-source AI Gateway, all enterprise features included

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

ScriptSmith/hadrian

Hadrian Gateway

An open-source AI Gateway that provides a unified OpenAI-compatible API for routing requests to multiple LLM providers. All enterprise features included. Dual-licensed under Apache 2.0 and MIT.

Documentation | API Reference

Warning

Hadrian is experimental, alpha, vibe-coded software and is not ready for production use. The API, configuration format, and database schema are subject to breaking changes that will lead to data loss. Hadrian has not undergone a security audit. Do not expose it to untrusted networks or use it to handle sensitive data. We are not accepting pull requests at this time, but issues and discussions are welcome.

Why Hadrian?

  • Single binary, single config. No complex deployments. Works on a Raspberry Pi or global cloud infrastructure.
  • All features included. Multi-tenancy, SSO, RBAC, guardrails, semantic caching, cost forecasting. Everything is free.
  • Production ready. Budget enforcement, rate limiting, circuit breakers, fallback chains, observability.
  • Multi-model chat UI. Compare responses from multiple models side-by-side with 14 interaction modes.
  • Built-in RAG. OpenAI-compatible Vector Stores API with document processing, chunking, and search.
  • Studio. Image generation, TTS, transcription, and translation with multi-model execution.

Quick Start

See the Getting Started guide for more details. Otherwise:

Download the latest binary from GitHub Releases and run it:

./hadrian

Or use Docker:

cat <<'EOF' > hadrian.toml
[server]
host = "0.0.0.0"
port = 8080

[database]
type = "sqlite"
path = "/app/data/hadrian.db"

[cache]
type = "memory"

[ui]
enabled = true

# Add a provider (uncomment and set your API key)
# [providers.openai]
# type = "open_ai"
# api_key = "${OPENAI_API_KEY}"
EOF

docker run -p 8080:8080 \
  -v ./hadrian.toml:/app/config/hadrian.toml:ro \
  -v hadrian-data:/app/data \
  ghcr.io/scriptsmith/hadrian

Or build from source (just required):

git clone https://github.com/ScriptSmith/hadrian.git
cd hadrian && just init && just build
./target/release/hadrian

Or install from crates.io (find the latest version with cargo search hadrian):

cargo install hadrian@VERSION

The gateway starts at http://localhost:8080 with the chat UI. No database required for basic use. Running without arguments creates ~/.config/hadrian/hadrian.toml with sensible defaults, uses SQLite, and opens the browser.

Configuration

# Minimal -- just add a provider
[providers.openai]
type = "open_ai"
api_key = "${OPENAI_API_KEY}"
# Multiple providers with fallback
[providers.anthropic]
type = "anthropic"
api_key = "${ANTHROPIC_API_KEY}"
fallback_providers = ["openai"]

[providers.openai]
type = "open_ai"
api_key = "${OPENAI_API_KEY}"

Supports OpenAI, Anthropic, AWS Bedrock, Google Vertex AI, Azure OpenAI, and any OpenAI-compatible API (OpenRouter, Ollama, etc). See the provider docs for details.

Features

  • Providers -- OpenAI, Anthropic, Bedrock, Vertex, Azure, plus any OpenAI-compatible API. Fallback chains, circuit breakers, health checks.
  • Multi-tenancy -- Organizations, teams, projects, users. Scoped providers, budgets, and rate limits at every level.
  • Auth -- API keys, OIDC/OAuth, per-org SSO, SAML, SCIM, reverse proxy auth, CEL-based RBAC.
  • Guardrails -- Blocklist, PII detection, content moderation (OpenAI, Bedrock, Azure). Blocking, concurrent, and post-response modes.
  • Caching -- Exact match and semantic similarity caching with pgvector or Qdrant.
  • Knowledge Bases -- File upload, text extraction, OCR, chunking, vector search, re-ranking. OpenAI-compatible Vector Stores API.
  • Cost tracking -- Microcent precision, time-series forecasting, budget enforcement with atomic reservation.
  • Observability -- Prometheus metrics, OTLP tracing, structured logging, usage export.
  • Web UI -- Multi-model chat with 14 modes, frontend tools (Python, JS, SQL, charts), MCP support, admin panel.
  • Studio -- Image generation, text-to-speech, transcription, and translation across providers.

API

OpenAI-compatible. Point any OpenAI SDK at Hadrian:

curl http://localhost:8080/api/v1/responses \
  -H "Content-Type: application/json" \
  -H "X-API-Key: gw_live_..." \
  -d '{"model": "anthropic/claude-opus-4-6", "input": "Hello!"}'

Interactive API reference available at /api/docs when running.

Deployment

Available as a single binary, Docker image, or Helm chart.

# Docker Compose (production)
cd deploy && docker compose -f docker-compose.postgres.yml up -d

# Kubernetes (from source)
cd helm/hadrian && helm dependency update && helm install my-gateway .

See the deployment docs for Docker Compose configurations, Helm chart options, and production recommendations.

Development

# Backend
cargo build && cargo test && cargo clippy && cargo +nightly fmt

# Frontend
cd ui && pnpm install && pnpm dev

# E2E tests
cd deploy/tests && pnpm test

License

Dual-licensed under Apache 2.0 and MIT.