Building a self-service LLM gateway with Amazon Bedrock and LiteLLM
AWS•How-to••by Sitaraman Vijay Krishna, Eric Christensen and Saurav Bhattacharya•AWS Artificial Intelligence Blog
Build a self-service LLM gateway with LiteLLM on AWS Fargate that puts Amazon Bedrock foundation models behind an OpenAI-compatible API. Developers get instant access through a single API key, while platform teams gain per-user cost controls, quota isolation, and observability.
Shows how to put Amazon Bedrock models behind a LiteLLM proxy on AWS Fargate with an OpenAI-compatible API, per-key spend limits, and CloudWatch token metrics.
Who it is for
Platform teams running coding assistants for developers on Amazon Bedrock who need per-user cost limits and quota alarms.
Key points
Spend limits need per-model costs set in model_info, otherwise inference-profile ARNs record $0 and budgets never enforce.
Global cross-Region inference needs IAM permissions on foundation-model ARNs as well as the inference profile.
Post notes LiteLLM self-service key issuance requires the Enterprise version.
AI:Both give enterprise model calls a gateway layer for access and routing, but Foundry adds external gateways while the item builds its own LiteLLM proxy.
AI:Gives a reference deployment for the Claude apps gateway on AWS, with a self-hosted layer for SSO sign-in, per-group model policy, per-user telemetry, upstream failover and spend caps.
AI:Bedrock cost per task depends on tokenizer efficiency, output verbosity, agent loop turns and reasoning tokens, so the post proposes measuring cost per successful outcome instead of per-token price.
AI:A five-stage operating model for Bedrock cost: attribute spend to IAM identities and tags, log every request, enforce budgets, set routing and caching defaults, and review a scorecard.