{"id":50680209,"url":"https://github.com/SSC-STUDIO/Ai-Model-Gateway","last_synced_at":"2026-06-25T16:01:19.103Z","repository":{"id":344693553,"uuid":"1182384161","full_name":"SSC-STUDIO/Ai-Model-Gateway","owner":"SSC-STUDIO","description":"Self-hosted LLM operations gateway for routing, fallback, telemetry, benchmarking, config publishing, updates, and rollback.","archived":false,"fork":false,"pushed_at":"2026-06-23T07:29:45.000Z","size":168743,"stargazers_count":2,"open_issues_count":13,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-23T09:16:31.920Z","etag":null,"topics":["ai-gateway","anthropic","anthropic-api","benchmark","claude-code","codex-cli","config-management","fallback","gateway","golang","llm","llm-gateway","llmops","model-routing","observability","openai","openai-compatible","rate-limiting","self-hosted","telemetry"],"latest_commit_sha":null,"homepage":"https://ssc-studio.github.io/Ai-Model-Gateway/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SSC-STUDIO.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":"audit-output/00_总协调报告.md","citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":"SUPPORT.md","governance":null,"roadmap":"docs/roadmap.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":"MAINTAINERS.md","copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-15T12:57:39.000Z","updated_at":"2026-06-23T07:29:48.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/SSC-STUDIO/Ai-Model-Gateway","commit_stats":null,"previous_names":["ssc-studio/ai-model-gateway"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/SSC-STUDIO/Ai-Model-Gateway","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SSC-STUDIO%2FAi-Model-Gateway","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SSC-STUDIO%2FAi-Model-Gateway/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SSC-STUDIO%2FAi-Model-Gateway/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SSC-STUDIO%2FAi-Model-Gateway/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SSC-STUDIO","download_url":"https://codeload.github.com/SSC-STUDIO/Ai-Model-Gateway/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SSC-STUDIO%2FAi-Model-Gateway/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34782137,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-25T02:00:05.521Z","response_time":101,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-gateway","anthropic","anthropic-api","benchmark","claude-code","codex-cli","config-management","fallback","gateway","golang","llm","llm-gateway","llmops","model-routing","observability","openai","openai-compatible","rate-limiting","self-hosted","telemetry"],"created_at":"2026-06-08T18:00:32.959Z","updated_at":"2026-06-25T16:01:19.076Z","avatar_url":"https://github.com/SSC-STUDIO.png","language":"Go","funding_links":[],"categories":["API tools"],"sub_categories":["JavaScript"],"readme":"[![CI](https://github.com/SSC-STUDIO/Ai-Model-Gateway/actions/workflows/ci.yml/badge.svg)](https://github.com/SSC-STUDIO/Ai-Model-Gateway/actions/workflows/ci.yml)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)\n[![Version](https://img.shields.io/badge/version-1.4.4-blue.svg)](VERSION)\n\n# AI Model Gateway\n\nAI Model Gateway is a self-hosted LLM gateway for teams that want provider routing, configuration publishing, telemetry, benchmarks, and day-2 operations in one compact Go runtime.\n\nIt is not trying to be another hosted model marketplace. The project is optimized for local control: one supervisor command, separate data/control/telemetry planes, OpenAI-compatible client entry points, provider health visibility, safe config rollout, and an admin UI that behaves like an operations console.\n\n## Start Here\n\n| Need | Link |\n| --- | --- |\n| Try the packaged runtime first | [Release archive install](docs/installation.md#install-from-a-release-archive) |\n| Try with Docker Compose | [Docker Compose deployment](docs/deployment.md#docker-compose) |\n| Decide in one short pass | [15-minute evaluation path](docs/evaluate-in-15-minutes.md) |\n| Check adoption fit before wiring clients | [LLM gateway adoption checklist](https://ssc-studio.github.io/Ai-Model-Gateway/llm-gateway-adoption-checklist.html) |\n| Point local tools at the gateway | [Client integrations](https://ssc-studio.github.io/Ai-Model-Gateway/client-integrations.html) |\n| Route Codex CLI traffic | [Codex CLI gateway page](https://ssc-studio.github.io/Ai-Model-Gateway/codex-cli-gateway.html) |\n| Route Claude Code traffic | [Claude Code gateway page](https://ssc-studio.github.io/Ai-Model-Gateway/claude-code-gateway.html) |\n| Verify fallback behavior | [Provider fallback demo](examples/provider-fallback/) |\n| Review quality and security before adoption | [Review evidence](https://ssc-studio.github.io/Ai-Model-Gateway/#review-evidence) |\n| Compare gateway options | [LLM gateway comparison](docs/llm-gateway-comparison.md) |\n| Read the product page | [Website](https://ssc-studio.github.io/Ai-Model-Gateway/) |\n| 中文评估入口 | [自托管 LLM 网关中文页](https://ssc-studio.github.io/Ai-Model-Gateway/self-hosted-llm-gateway-zh.html) |\n| Share with a relevant community | [Share kit](https://ssc-studio.github.io/Ai-Model-Gateway/share-kit.html) / [中文分享包](https://ssc-studio.github.io/Ai-Model-Gateway/share-kit-zh.html) |\n\nFastest trial: download the packaged runtime, verify `SHA256SUMS.txt`, then run the 15-minute path or fallback demo. If you prefer containers, use the Docker Compose path below; CI also builds the runtime image on every main-branch push. If it fits your self-hosted LLM infrastructure needs, star the repository so more operators can find it.\n\n## See It First\n\n![AI Model Gateway Admin overview](docs/assets/admin-overview.png)\n\nThe Admin UI exposes the operational surface behind the gateway: provider health, routing state, telemetry, benchmark signals, config publishing, diagnostics, request logs, and update/rollback workflows. Start with the [15-minute evaluation path](docs/evaluate-in-15-minutes.md), review the [quality and security evidence](https://ssc-studio.github.io/Ai-Model-Gateway/#review-evidence), or use the [release archive install](docs/installation.md#install-from-a-release-archive) path if you want the shortest packaged trial.\n\n## Who Should Use It\n\nAI Model Gateway is most useful when you are running LLM traffic for a team and need operational control rather than a hosted model marketplace:\n\n- You want OpenAI, Anthropic, and Responses-compatible clients to enter through one local gateway.\n- You need provider routing, fallback, rate limiting, and cache behavior that you can inspect and change.\n- You want config changes to go through preview, diff, publish, audit, and rollback instead of editing a live proxy file.\n- You need request logs, latency, cost, provider health, benchmarks, diagnostics, and replay in one admin surface.\n- You want updates and rollback to use manifest-verified bundles instead of replacing binaries by hand.\n\n## Try It Quickly\n\nThe fastest path is the packaged release archive. It avoids rebuilding the runtime and verifies the download with `SHA256SUMS.txt`.\n\n| Platform | Archive |\n| --- | --- |\n| Linux x64 | [`ai-model-gateway-linux-amd64.tar.gz`](https://github.com/SSC-STUDIO/Ai-Model-Gateway/releases/download/v1.4.4/ai-model-gateway-linux-amd64.tar.gz) |\n| Linux arm64 | [`ai-model-gateway-linux-arm64.tar.gz`](https://github.com/SSC-STUDIO/Ai-Model-Gateway/releases/download/v1.4.4/ai-model-gateway-linux-arm64.tar.gz) |\n| Windows x64 | [`ai-model-gateway-windows-amd64.zip`](https://github.com/SSC-STUDIO/Ai-Model-Gateway/releases/download/v1.4.4/ai-model-gateway-windows-amd64.zip) |\n| macOS arm64 | [`ai-model-gateway-darwin-arm64.tar.gz`](https://github.com/SSC-STUDIO/Ai-Model-Gateway/releases/download/v1.4.4/ai-model-gateway-darwin-arm64.tar.gz) |\n| Checksums | [`SHA256SUMS.txt`](https://github.com/SSC-STUDIO/Ai-Model-Gateway/releases/download/v1.4.4/SHA256SUMS.txt) |\n\nFollow the [release archive install path](docs/installation.md#install-from-a-release-archive) for checksum verification, local config setup, runtime directories, temporary local tokens, and `aigw supervise` startup.\n\nContainer trial:\n\n```bash\ncp configs/config.example.yaml configs/config.yaml\ncat \u003e deploy/secrets.env \u003c\u003c'EOF'\nADMIN_BOOTSTRAP_TOKEN=change-me-32-characters-minimum-0\nCOOKIE_SIGNING_KEY=change-me-32-characters-minimum-0\nADMIN_TOKEN=change-me-admin-token\nVIEWER_TOKEN=change-me-viewer-token\nEOF\ndocker compose -f deploy/docker-compose.yaml up -d\ncurl http://127.0.0.1:18081/-/health\n```\n\nSee [Docker Compose deployment](docs/deployment.md#docker-compose) for logs, published ports, and provider-key setup.\n\nIf you prefer to audit or modify the code before running it, build from source:\n\n```bash\ngit clone https://github.com/SSC-STUDIO/Ai-Model-Gateway.git\ncd Ai-Model-Gateway\ngo build -o ./dist/aigw ./cmd/aigw\ngo build -o ./dist/gatewayd ./cmd/gatewayd\ngo build -o ./dist/controld ./cmd/controld\ngo build -o ./dist/telemetryd ./cmd/telemetryd\ncp configs/config.example.yaml configs/config.yaml\nmkdir -p .gateway-runtime/telemetry .gateway-runtime/gateway .gateway-runtime/control\nADMIN_BOOTSTRAP_TOKEN=change-me-32-characters-minimum-0 \\\nCOOKIE_SIGNING_KEY=change-me-32-characters-minimum-0 \\\nADMIN_TOKEN=change-me-admin-token \\\nVIEWER_TOKEN=change-me-viewer-token \\\n./dist/aigw supervise -runtime-root .gateway-runtime -config-dir configs -bin-dir ./dist\n```\n\nThen open `http://localhost:18080/admin` and check `http://localhost:18080/-/health`.\n\n## Choose A Setup Path\n\n| Goal | Start here |\n| --- | --- |\n| Share a visual overview | [Project website](https://ssc-studio.github.io/Ai-Model-Gateway/) |\n| Share copy-ready links and short posts | [Share kit](https://ssc-studio.github.io/Ai-Model-Gateway/share-kit.html) |\n| Share with Chinese developer communities | [Chinese share kit](https://ssc-studio.github.io/Ai-Model-Gateway/share-kit-zh.html) |\n| Evaluate from a Chinese landing page | [Chinese self-hosted LLM gateway page](https://ssc-studio.github.io/Ai-Model-Gateway/self-hosted-llm-gateway-zh.html) |\n| Try the packaged runtime | [Release archive install path](docs/installation.md#install-from-a-release-archive) |\n| Try with Docker Compose | [Docker Compose deployment](docs/deployment.md#docker-compose) |\n| Build from source locally | [Installation guide](docs/installation.md#build-from-source) |\n| Decide quickly whether to spend more time | [15-minute evaluation path](docs/evaluate-in-15-minutes.md) |\n| Match it to your team's workflow | [Use cases](docs/use-cases.md) |\n| Evaluate whether self-hosting fits | [Self-hosted LLM gateway checklist](docs/self-hosted-llm-gateway-checklist.md) |\n| Check adoption fit from a shareable page | [LLM gateway adoption checklist](https://ssc-studio.github.io/Ai-Model-Gateway/llm-gateway-adoption-checklist.html) |\n| Review CI, tests, runtime smoke, and maturity evidence | [Quality evidence](docs/quality-evidence.md) |\n| Review auth, secret, SSRF, telemetry, and deployment trust boundaries | [Security and trust model](docs/security-trust-model.md) |\n| Understand project direction | [Project roadmap](docs/roadmap.md) |\n| Compare LLM gateway options | [LLM gateway comparison guide](docs/llm-gateway-comparison.md) |\n| Start from a gateway comparison search page | [LLM gateway comparison page](https://ssc-studio.github.io/Ai-Model-Gateway/llm-gateway-comparison.html) |\n| Start from a self-hosted gateway search page | [Self-hosted LLM gateway page](https://ssc-studio.github.io/Ai-Model-Gateway/self-hosted-llm-gateway.html) |\n| Start from an OpenAI-compatible gateway search page | [OpenAI-compatible LLM gateway page](https://ssc-studio.github.io/Ai-Model-Gateway/openai-compatible-llm-gateway.html) |\n| Start from a client integration search page | [LLM client integrations page](https://ssc-studio.github.io/Ai-Model-Gateway/client-integrations.html) |\n| Start from an adoption checklist search page | [LLM gateway adoption checklist](https://ssc-studio.github.io/Ai-Model-Gateway/llm-gateway-adoption-checklist.html) |\n| Start from a Codex CLI gateway search page | [Codex CLI gateway page](https://ssc-studio.github.io/Ai-Model-Gateway/codex-cli-gateway.html) |\n| Start from a Claude Code gateway search page | [Claude Code gateway page](https://ssc-studio.github.io/Ai-Model-Gateway/claude-code-gateway.html) |\n| Start from an OpenAI and Anthropic gateway search page | [OpenAI Anthropic gateway page](https://ssc-studio.github.io/Ai-Model-Gateway/openai-anthropic-gateway.html) |\n| Start from a provider fallback search page | [LLM provider fallback gateway page](https://ssc-studio.github.io/Ai-Model-Gateway/llm-provider-fallback-gateway.html) |\n| Understand config publish and rollback | [Config publish and rollback](docs/config-publish-rollback.md) |\n| Operate provider fallback and health | [Provider fallback and health operations](docs/provider-fallback-health.md) |\n| Run a provider fallback proof | [Provider fallback demo](examples/provider-fallback/) |\n| Connect an OpenAI-compatible upstream | [OpenAI-compatible upstreams](docs/openai-compatible-upstreams.md) |\n| Point clients at the gateway | [Client integrations](docs/client-integrations.md) |\n| Run it as an operations service | [Deployment guide](docs/deployment.md) |\n| Control it from scripts or terminals | [CLI guide](docs/cli.md) |\n| Point local AI tools at the gateway | [`aigw clients`](#point-local-ai-tools-at-the-gateway) |\n| Debug startup, routing, or admin access | [Troubleshooting](docs/troubleshooting.md) |\n| Ask what to improve next | [Maintainer discussion](https://github.com/SSC-STUDIO/Ai-Model-Gateway/discussions/25) |\n\n## More Links\n\n[Self-Hosted Gateway](https://ssc-studio.github.io/Ai-Model-Gateway/self-hosted-llm-gateway.html) | [OpenAI-Compatible Gateway](https://ssc-studio.github.io/Ai-Model-Gateway/openai-compatible-llm-gateway.html) | [Adoption Checklist](https://ssc-studio.github.io/Ai-Model-Gateway/llm-gateway-adoption-checklist.html) | [Client Integrations](https://ssc-studio.github.io/Ai-Model-Gateway/client-integrations.html) | [Codex CLI Gateway](https://ssc-studio.github.io/Ai-Model-Gateway/codex-cli-gateway.html) | [Claude Code Gateway](https://ssc-studio.github.io/Ai-Model-Gateway/claude-code-gateway.html) | [OpenAI-Compatible Upstreams](docs/openai-compatible-upstreams.md) | [OpenAI Anthropic Gateway](https://ssc-studio.github.io/Ai-Model-Gateway/openai-anthropic-gateway.html) | [Provider Fallback Gateway](https://ssc-studio.github.io/Ai-Model-Gateway/llm-provider-fallback-gateway.html) | [Gateway Comparison Page](https://ssc-studio.github.io/Ai-Model-Gateway/llm-gateway-comparison.html) | [Quality Evidence](docs/quality-evidence.md) | [Security Model](docs/security-trust-model.md) | [Docs](docs/) | [Roadmap](docs/roadmap.md) | [Promotion Kit](docs/promotion-kit.md) | [100-Star Campaign](docs/100-star-campaign.md)\n\n## Why This Exists\n\nThe AI gateway space already has strong projects:\n\n| Project type | Good at | AI Model Gateway difference |\n| --- | --- | --- |\n| [LiteLLM](https://github.com/BerriAI/litellm) / [Portkey](https://github.com/Portkey-AI/gateway)-style gateways | Broad provider coverage, unified APIs, spend controls, guardrails | Adds a native three-plane runtime, local config publishing, rollback, diagnostics, and an ops-first admin console |\n| [Helicone](https://github.com/Helicone/helicone)-style observability | Request tracing, analytics, evaluations, experiments | Treats observability as one part of the gateway lifecycle instead of the whole product |\n| [OpenRouter](https://openrouter.ai/)-style hosted routers | Fast access to many public models through a hosted broker | Keeps routing, keys, telemetry, and policy inside the user's own environment |\n| Kong / [Envoy AI Gateway](https://github.com/envoyproxy/ai-gateway) stacks | Enterprise gateway ecosystem, plugins, Kubernetes-native traffic policy | Focuses on LLM-specific operations with fewer moving parts and a small self-hosted binary set |\n\nSee [docs/differentiation.md](docs/differentiation.md) for positioning notes and [docs/llm-gateway-comparison.md](docs/llm-gateway-comparison.md) for a practical selection guide.\n\n## Core Capabilities\n\n| Capability | What it does |\n| --- | --- |\n| Multi-protocol gateway | OpenAI Chat Completions, Anthropic Messages, and OpenAI Responses compatibility |\n| Provider routing | Model matching, provider-level routing, fallback policy, and loop detection |\n| Rate limiting | Token-bucket limits by API key, IP, and model |\n| Request cache | In-memory LRU cache with configurable TTL and item count |\n| SSRF protection | DNS pinning, private IP detection, and allowlist support |\n| Config publishing | Authoring YAML -\u003e compiled snapshot -\u003e zero-interruption publish and rollback |\n| Provider health operations | Health-aware weighted routing, probes, cooldown state, and incident checks |\n| Telemetry plane | Async event ingestion, cost aggregation, timeseries projections, and query APIs |\n| Audit log | Searchable control-plane operation history |\n| Admin UI | Overview, Monitoring, Benchmark, Ops, Config, and Logs workspaces |\n| Benchmarking | Multi-model comparison with exact, judge, JSON, tool, and stream scoring modes |\n| Local CLI | Runtime status, preflight, diagnostics, provider probes, config diff, publish history, and rollback |\n\n## Architecture\n\nThe runtime uses one operator entry point and three internal planes:\n\n```text\n                  external supervisor / systemd / k8s\n                                |\n                         +--------------+\n                         | aigw         |\n                         | supervise    |\n                         +------+-------+\n                                |\n             +------------------+------------------+\n             |                                     |\n      +------+-------+                     +-------+------+\n      | Data Plane   |                     | Control Plane|\n      | gatewayd     |                     | controld     |\n      | :18080       |                     | :18081       |\n      +------+-------+                     +-------+------+\n             |                                     |\n             +------------------+------------------+\n                                |\n                         +------+-------+\n                         | Telemetry    |\n                         | telemetryd   |\n                         | IPC only     |\n                         +--------------+\n```\n\n- `aigw` is the local operations entry point for `supervise`, `doctor`, bundle verification, upgrades, and rollback workflows.\n- `gatewayd` handles client inference traffic, compatible API routes, health checks, and telemetry event emission.\n- `controld` serves the admin APIs and owns authoring config, compile/publish/rollback, audit, probing, and benchmark workflows.\n- `telemetryd` ingests events over IPC and exposes projections through the control plane.\n\nThe old `gateway` / `gateway.exe` launcher has been removed. Production deployments should supervise `aigw supervise`.\n\n## Admin UI\n\nOpen the admin console at `http://localhost:18080/admin` after the runtime starts.\n\n| Workspace | Primary jobs |\n| --- | --- |\n| Overview | Gateway health, time windows, runtime state, provider health |\n| Monitoring | Traffic, latency, cost, model usage, and pricing visibility |\n| Benchmark | Model capability comparison, scoring, and promotion signals |\n| Ops | Runtime status, provider probes, audit log, diagnostics, replay |\n| Config | YAML/JSON/visual config editing, publish history, revision diff |\n| Logs | Request search, error filtering, and CSV export |\n\n### Screenshots\n\n| Overview | Monitoring |\n| --- | --- |\n| ![Admin overview](docs/assets/admin-overview.png) | ![Admin monitoring](docs/assets/admin-monitoring.png) |\n\n| Ops mobile | Benchmark mobile |\n| --- | --- |\n| ![Admin ops mobile](docs/assets/admin-ops-mobile.png) | ![Admin benchmark mobile](docs/assets/admin-benchmark-mobile.png) |\n\n## Quick Start\n\n### Build\n\n```bash\ngo build -o ./dist/aigw        ./cmd/aigw\ngo build -o ./dist/gatewayd    ./cmd/gatewayd\ngo build -o ./dist/controld    ./cmd/controld\ngo build -o ./dist/telemetryd  ./cmd/telemetryd\ngo build -o ./dist/gateway-cli ./cmd/gateway-cli\n```\n\nGenerate and verify a release manifest before packaging:\n\n```bash\n./dist/aigw bundle build -root . -out aigw-manifest.json\n./dist/aigw bundle verify -root . -manifest aigw-manifest.json\n```\n\n### Configure\n\n```powershell\nCopy-Item .\\configs\\config.example.yaml .\\configs\\config.yaml\n$env:ADMIN_BOOTSTRAP_TOKEN = \"\u003c32+ chars\u003e\"\n$env:COOKIE_SIGNING_KEY = \"\u003c32+ chars\u003e\"\n$env:ADMIN_TOKEN = \"\u003cadmin token\u003e\"\n$env:VIEWER_TOKEN = \"\u003cviewer token\u003e\"\n```\n\n`config.yaml` is the operator authoring config. The daemon bootstrap files are separate:\n\n- `configs/gatewayd.json`\n- `configs/controld.json`\n- `configs/telemetryd.json`\n\n### Run\n\n```bash\nmkdir -p .gateway-runtime/telemetry .gateway-runtime/gateway .gateway-runtime/control\n./dist/aigw supervise -runtime-root .gateway-runtime -config-dir configs -bin-dir ./dist\n```\n\n### Verify\n\n```bash\ncurl http://127.0.0.1:18080/-/health\ncurl http://127.0.0.1:18080/v1/models\ncurl http://127.0.0.1:18081/admin\n```\n\nLocal development note: if another live service already owns `127.0.0.1:18080`, stop it or move the development runtime to different ports before starting the three-plane runtime.\n\n## Point Local AI Tools At The Gateway\n\n`aigw clients` can print environment snippets or update local tool config for Codex, Claude Code, and OpenClaw. See [client integrations](docs/client-integrations.md) for generic OpenAI SDK, curl, and local tool setup notes.\n\n```bash\n./dist/aigw clients print -config-dir configs\n./dist/aigw clients apply -config-dir configs -api-key \"\u003cAPI key\u003e\"\n./dist/aigw clients apply -dry-run\n```\n\n## CLI Examples\n\n`gateway-cli` is the remote management CLI:\n\n```bash\n# Config\n./dist/gateway-cli config show\n./dist/gateway-cli config preview configs/config.yaml\n./dist/gateway-cli config diff --file configs/config.yaml\n\n# Runtime\n./dist/gateway-cli runtime status\n./dist/gateway-cli runtime preflight\n\n# Audit and diagnostics\n./dist/gateway-cli audit 50\n./dist/gateway-cli diagnostics\n./dist/gateway-cli secrets check\n\n# Provider probes\n./dist/gateway-cli probe model gpt-4 openai-demo\n./dist/gateway-cli provider list\n./dist/gateway-cli provider test openai\n\n# Telemetry\n./dist/gateway-cli telemetry events\n\n# Publish management\n./dist/gateway-cli publish history\n./dist/gateway-cli publish rollback rev-001\n```\n\nUseful options:\n\n- `-server url`: control-plane URL, default `http://127.0.0.1:18081`\n- `-token token`: admin token, or use `ADMIN_TOKEN`\n- `-format text|json|csv`: output format\n\n## Tests\n\n```bash\n# Go tests\ngo test ./... -count=1\n\n# Focused Go tests with coverage\ngo test ./internal/gateway/... -count=1 -cover\n\n# Admin unit/component tests\nnpm --prefix web/admin test\n\n# Admin production build\nnpm --prefix web/admin run build\n\n# Admin Playwright audit\nnpm --prefix web/admin run test:e2e\n```\n\n## Repository Layout\n\n| Path | Purpose |\n| --- | --- |\n| `cmd/aigw/` | Operations entry point |\n| `cmd/gatewayd/` | Data-plane daemon |\n| `cmd/controld/` | Control-plane daemon |\n| `cmd/telemetryd/` | Telemetry daemon |\n| `cmd/gateway-cli/` | Remote management CLI |\n| `internal/control/` | Control-plane API, compiler, publisher |\n| `internal/gateway/` | Snapshot runtime, API handlers, telemetry client |\n| `internal/telemetry/` | Event log, projections, query layer |\n| `internal/contracts/` | Cross-plane RPC and transport contracts |\n| `internal/infra/` | Shared auth, config loader, pricing, and infrastructure |\n| `internal/proxy/` | SSRF-safe proxy helpers |\n| `web/admin/` | Admin SPA built with Preact and Vite |\n| `configs/` | Example and bootstrap configuration |\n| `docs/` | Architecture, installation, deployment, and operations docs |\n| `scripts/` | Deployment and verification helpers |\n\n## Operations Constraints\n\n- Do not replace `gatewayd`, `controld`, or `telemetryd` independently during a normal upgrade. Ship one manifest-verified bundle.\n- Run individual daemons only for advanced debugging. Production paths should use `aigw supervise`.\n- Linux deployments can use `deploy/aigw.service` or `aigw service print`. Windows deployments should wrap `aigw.exe supervise` with NSSM or an equivalent service manager.\n\n## Documentation\n\n- [Differentiation](docs/differentiation.md)\n- [Project Roadmap](docs/roadmap.md)\n- [Evaluate In 15 Minutes](docs/evaluate-in-15-minutes.md)\n- [LLM Gateway Comparison Guide](docs/llm-gateway-comparison.md)\n- [Self-Hosted LLM Gateway Checklist](docs/self-hosted-llm-gateway-checklist.md)\n- [LLM Gateway Adoption Checklist](https://ssc-studio.github.io/Ai-Model-Gateway/llm-gateway-adoption-checklist.html)\n- [Config Publish and Rollback](docs/config-publish-rollback.md)\n- [Architecture](docs/architecture.md)\n- [Installation](docs/installation.md)\n- [Deployment](docs/deployment.md)\n- [CLI Guide](docs/cli.md)\n- [Troubleshooting](docs/troubleshooting.md)\n- [API Messages Endpoint](docs/api-messages-endpoint.md)\n- [Chinese Model Integration](docs/chinese-models-integration.md)\n- [Changelog](CHANGELOG.md)\n- [Contributing](CONTRIBUTING.md)\n- [Code of Conduct](CODE_OF_CONDUCT.md)\n- [Security Policy](SECURITY.md)\n\n## License\n\nMIT. See [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSSC-STUDIO%2FAi-Model-Gateway","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSSC-STUDIO%2FAi-Model-Gateway","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSSC-STUDIO%2FAi-Model-Gateway/lists"}