# Building a self-service LLM gateway with Amazon Bedrock and LiteLLM

DevFeed: [Building a self-service LLM gateway with Amazon Bedrock and LiteLLM](<https://devfeed.tech/articles/building-a-self-service-llm-gateway-with-amazon-bedrock-and-litellm-130770.md>)

Original publisher: [Read original article](<https://aws.amazon.com/blogs/machine-learning/building-a-self-service-llm-gateway-with-amazon-bedrock-and-litellm/>)

Author: Sitaraman Vijay Krishna

Published: 2026-11-12T18:41:12Z

Content type: tutorial

Language: en

Sources: [Artificial Intelligence](<https://devfeed.tech/sources/artificial-intelligence.md>)

Topics: [litellm](<https://devfeed.tech/topics/litellm.md>), [Amazon Bedrock](<https://devfeed.tech/topics/amazon-bedrock.md>), [LLM observability](<https://devfeed.tech/topics/llm-observability.md>), [self-service](<https://devfeed.tech/topics/self-service.md>), [internal developer portal](<https://devfeed.tech/topics/internal-developer-portal.md>), [Amazon CloudWatch](<https://devfeed.tech/topics/amazon-cloudwatch.md>), [rate-limiting](<https://devfeed.tech/topics/rate-limiting.md>), [Amazon RDS](<https://devfeed.tech/topics/amazon-rds.md>), [CI/CD](<https://devfeed.tech/topics/cicd.md>)

Tags: [advanced-300](<https://devfeed.tech/tags/advanced-300.md>), [amazon](<https://devfeed.tech/tags/amazon.md>), [amazon-bedrock](<https://devfeed.tech/tags/amazon-bedrock.md>), [api](<https://devfeed.tech/tags/api.md>), [api-key](<https://devfeed.tech/tags/api-key.md>), [aws](<https://devfeed.tech/tags/aws.md>), [aws-fargate](<https://devfeed.tech/tags/aws-fargate.md>), [bedrock](<https://devfeed.tech/tags/bedrock.md>), [build](<https://devfeed.tech/tags/build.md>), [building](<https://devfeed.tech/tags/building.md>), [controls](<https://devfeed.tech/tags/controls.md>), [cost](<https://devfeed.tech/tags/cost.md>), [developers](<https://devfeed.tech/tags/developers.md>), [foundation](<https://devfeed.tech/tags/foundation.md>), [gateway](<https://devfeed.tech/tags/gateway.md>), [litellm](<https://devfeed.tech/tags/litellm.md>), [llm](<https://devfeed.tech/tags/llm.md>), [llm-gateway](<https://devfeed.tech/tags/llm-gateway.md>), [self-service](<https://devfeed.tech/tags/self-service.md>), [service](<https://devfeed.tech/tags/service.md>), [technical-how-to](<https://devfeed.tech/tags/technical-how-to.md>), [with](<https://devfeed.tech/tags/with.md>)

## AI overview

The article presents a self-service LLM gateway pattern that puts Amazon Bedrock behind LiteLLM's OpenAI-compatible API on AWS Fargate. Developers use a single base URL and per-user keys; LiteLLM manages key budgets and rate limits, PostgreSQL stores key and spend state, Valkey provides caching and distributed rate limiting, and Bedrock inference profiles provide model-level quota isolation and routing. Langfuse captures prompt-level traces while CloudWatch tracks operational metrics; prompt logging requires suitable redaction, retention, and access controls. Key implementation requirements include LiteLLM Enterprise for SSO-based self-service key issuance, explicit per-model token pricing for budget enforcement, PostgreSQL for persistent state, and IAM permissions for both inference-profile and underlying model resources. The authors recommend long request timeouts for extended thinking, retrying throttled requests on the same model, and separating automation traffic. The post offers illustrative snippets rather than a complete deployable stack, and its examples use Claude models.

## Source excerpt

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.