MCPcopy Index your code
hub / github.com/api7/aisix-archived

github.com/api7/aisix-archived @v0.1.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.1.0 ↗ · + Follow
692 symbols 1,518 edges 130 files 44 documented · 6%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Build Status License

AISIX AI Gateway

An open source, high-performance AI Gateway and LLM proxy built in Rust.

Unified OpenAI-compatible API for OpenAI, Anthropic, Gemini, DeepSeek, and any OpenAI-compatible provider.

🦀 Rust • 🔌 OpenAI Compatible • 🗄️ etcd

Why Teams Use AISIX as Their Enterprise AI Gateway

  • 🦀 Rust + Tokio — Extreme performance with low resource footprint; ships as a single binary
  • 🔌 OpenAI-Compatible — One API to call all LLMs; drop-in replacement with zero code changes
  • Dynamic Config — Hot-reload via etcd; update models and keys without restarting
  • 🛡️ Enterprise-Grade Control — API key auth, rate limiting (RPM / TPM / concurrent), and per-model access control
  • 📊 Observability — OpenTelemetry distributed tracing and Prometheus metrics out of the box
  • 🎨 Admin UI — Built-in management dashboard for models, API keys, and a chat playground

Features

🌐 Multi-Provider Support

Provider Chat Completions Streaming Embeddings
🟢 OpenAI
🟠 Anthropic
🔵 Gemini
🐋 DeepSeek
🔌 OpenAI-Compatible

🚦 Traffic Management

  • Rate limiting — RPM, RPD, TPM, TPD, and concurrent request limits
  • Per-model and per-key access control
  • Request validation with JSON Schema

🛡️ Security & Auth

  • API key authentication on all proxy requests
  • Per-key model allowlist
  • Admin API key protection

📊 Observability

  • OpenTelemetry distributed tracing (Jaeger / Zipkin)
  • Prometheus metrics export
  • Structured logging via logforth

🎨 Admin & Management

  • RESTful Admin API with OpenAPI spec + Scalar UI
  • React-based Admin Dashboard
  • Model CRUD / API Key CRUD / Chat Playground
  • etcd-backed dynamic configuration (no restarts needed)

Architecture

AISIX Architecture


Quick Start

curl -fsSL https://run.api7.ai/aisix/quickstart | sh

This script downloads configuration files, generates a random Admin Key, and starts AISIX with etcd via Docker Compose. Once running:

  • Proxy API: http://127.0.0.1:3000
  • Admin API: http://127.0.0.1:3001/aisix/admin
  • Admin UI: http://127.0.0.1:3001/ui

For the full setup guide including model configuration and making your first request, see the Quick Start documentation.


Development

See CONTRIBUTING.md for the full contribution guide including branching, code style, and PR expectations.

Prerequisites

  • Rust (latest stable)
  • Node.js LTS + pnpm (corepack enable pnpm)
  • Docker & Docker Compose (for etcd and the test environment)
  • protobuf-compilersudo apt install protobuf-compiler (Debian/Ubuntu) or brew install protobuf (macOS)

Build & Run

  1. Build UI

    ```bash cd ui pnpm install --frozen-lockfile pnpm build

    Or if you don't want to, then create a stub folder.

    Run this command in the root directory of the project.

    mkdir -p ui/dist ```

  2. Build gateway

    bash cargo run

Roadmap

  • [ ] Guardrails: content filtering and safety checks
  • [ ] Load Balancing / Fallback: across providers
  • [ ] Cost tracking & usage analytics
  • [ ] Semantic caching: cache responses based on query intent, not exact match
  • [ ] More providers: Azure, Bedrock, Ollama...
  • [ ] Kubernetes Helm chart
  • [ ] New protocol support
    • [ ] OpenAI Responses API
    • [ ] Anthropic Messages API
    • [ ] Google Gemini GenerateContent API
  • [ ] Multimodal APIs: Image, audio, video
  • [ ] MCP proxy

Community

  • Contribute via CONTRIBUTING.md — setup, code style, and PR guidelines
  • Join our Discord server for real-time chat with the community and maintainers
  • Use GitHub Discussions for questions, ideas, and architecture discussions
  • Use GitHub Issues for bug reports, feature requests, and actionable tasks
  • Follow repository activity for ongoing documentation and product updates

License

This project is licensed under the Apache License 2.0.

Extension points exported contracts — how you extend this code

Provider (Interface)
(no doc) [5 implementers]
src/providers/mod.rs
ProxyHook (Interface)
(no doc) [3 implementers]
src/proxy/hooks/mod.rs
HasRateLimit (Interface)
(no doc) [3 implementers]
src/config/entities/types.rs
AppConfig (Interface)
(no doc)
tests/e2e/utils/setup.ts
FileRoutesByFullPath (Interface)
(no doc)
ui/src/routeTree.gen.ts
URLFormatter (Interface)
(no doc) [4 implementers]
src/providers/mod.rs
ConcurrencyGuard (Interface)
Trait for RAII concurrency guard. Dropping the guard releases the concurrency slot. [1 implementers]
src/proxy/hooks/rate_limit/concurrent/mod.rs
ConfigProvider (Interface)
(no doc) [2 implementers]
src/config/types.rs

Core symbols most depended-on inside this repo

cn
called by 52
ui/src/lib/utils.ts
into_response
called by 43
src/admin/types.rs
oneshot_json
called by 32
tests/utils/http.rs
get
called by 31
src/config/types.rs
proxyPost
called by 31
tests/e2e/utils/proxy.ts
bearerAuthHeader
called by 28
tests/e2e/utils/admin.ts
try_acquire
called by 23
src/proxy/hooks/rate_limit/concurrent/local.rs
adminPost
called by 23
tests/e2e/utils/admin.ts

Shape

Function 351
Method 179
Class 99
Interface 41
Enum 22

Languages

Rust71%
TypeScript29%

Modules by API surface

src/config/entities/mod.rs52 symbols
src/proxy/hooks/rate_limit/ratelimit/utils.rs31 symbols
src/proxy/hooks/mod.rs29 symbols
src/providers/anthropic/types.rs28 symbols
src/proxy/hooks/rate_limit/ratelimit/local.rs23 symbols
src/config/types.rs19 symbols
src/config/entities/models.rs17 symbols
src/proxy/hooks/rate_limit/concurrent/utils.rs14 symbols
src/proxy/hooks/rate_limit/concurrent/local.rs14 symbols
src/config/etcd.rs14 symbols
src/proxy/hooks/rate_limit/mod.rs13 symbols
src/proxy/hooks/rate_limit/concurrent/mod.rs13 symbols

For agents

$ claude mcp add aisix-archived \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page