Status: [UNTESTED] Endpoints found: http://127.0.0.1:8080/anthropic/v1/messages` Source: https://github.com/joeycumines/ai-concurrency-shaper # ai-concurrency-shaper Reverse proxy with bounded concurrency for AI/LLM API endpoints. Sits in front of an upstream HTTP API (e.g. Anthropic, OpenAI) and limits concurrent requests to configured routes. Requests that exceed the limit block until a slot opens, so clients need no backoff of their own. Non-matching requests pass through unmodified. The goal is that the upstream never *observes* more concurrency than you configured. Providers detect excess concurrency on their side, with their own accounting lag, and answer with 429s or temporary bans. So the proxy does more than count in-flight requests: it holds slots across the provider's accounting window after releases, cancellations, and failures, and a circuit breaker stops a failing upstream from being hammered. Optionally, it also transcodes between the OpenAI Responses, OpenAI Chat Completions, and Anthropic Messages APIs (see [Transcoding](#transcoding)). Run with `-tui` for a terminal dashboard with live metrics and request inspection.

TUI dashboard showing live request metrics

## Install ```sh go install github.com/joeycumines/ai-concurrency-shaper@latest ``` ## Usage ```sh ai-concurrency-shaper -upstream https://api.anthropic.com ``` Every tuning flag below applies to that single upstream. To front several upstreams through one port, see [Multiple Providers](#multiple-providers); the same flags then apply per `--provider` section. ### Flags Every flag lives in one of two scopes. **Server-scope** flags configure the process (listener, TUI, model table, catalog suites, embedded RC server); **provider-scope** flags configure one upstream (limiting, retry, breaker, cooldowns, auth, transcoding). With a single upstream both scopes share one command line. With `--provider` sections, server-scope flags go before the first marker and each provider-scope flag goes in the section it configures. Run `ai-concurrency-shaper -h`