I Built a Private ChatGPT with LibreChat, LiteLLM and Bedrock. Here Are the Bugs That Bit Me An engineer built a company-wide private ChatGPT-style platform on Amazon Bedrock using LibreChat for the UI, LiteLLM as the LLM gateway, and EKS Auto Mode for compute, running at roughly $340 a month in infrastructure before token costs. The build uses a single allowed-models YAML file that Terraform turns into both the LiteLLM model list and scoped IAM policies, with RDS Postgres and pgvector for keys, spend and document embeddings and MongoDB for LibreChat. Most of the effort went into sign-in, per-person budgets, config validation and patching rather than the chat interface itself. LibreChat for the UI, LiteLLM as the gateway, open models on Amazon Bedrock, all on EKS. About $340 a month of infrastructure before tokens. Claude Code and OpenCode use the same models, and two small connectors of my own add downloadable documents and image generation to any chat. Getting a chat window on screen was the easy part. Sign-in, budgets, config checks and patching took most of the time. It started with messages like these, from people on my team, in their normal daily work: "My 5-hour session limit is reached." "My weekly limit is exhausted." "I used 50% of my limit on the first day itself." "I'm over 90%." Nobody was doing anything unusual. Everyday use was simply more than a standard seat covers. I also wanted to explore this myself, properly, with a real architecture rather than a quick hack. I had unused AWS Activate credits. So I built a private ChatGPT for the whole company: one sign-in, models I choose, rules I set, chat with files, connectors to the tools I use, and coding agents for developers on the same models. This post covers the build, the choices I made and why, and the bugs that cost me the most time. Everything here runs in production for my team today. Per-seat AI subscriptions are simple until half the company needs them and the heavy users hit limits by Wednesday. A private ChatGPT-style app gives you: The catch is that you now run software yourself, and someone has to keep it patched. | Piece | What I used | Why | |---|---|---| | Chat UI | LibreChat | MIT licence, agents, MCP, skills, memory, file search, SSO, admin roles | | LLM gateway | LiteLLM proxy | One OpenAI- and Anthropic-compatible API, keys with budgets, spend per person, fallbacks | | Models | Amazon Bedrock open models | Pay per token, no GPUs to run | | Compute | EKS Auto Mode | AWS runs nodes, load balancer and storage; GPU nodes later for self-hosted models | | Data | RDS Postgres gateway, file search vectors , MongoDB LibreChat | LibreChat requires MongoDB; Postgres with pgvector holds keys, spend and document embeddings | | Secrets | AWS Secrets Manager + External Secrets | Nothing secret in Git or Helm values | I compared both. Open WebUI is lighter, but its licence https://docs.openwebui.com/license/ only lets you remove its branding up to 50 users. LibreChat is MIT, and its agents and MCP support were further along for a team. If you are a small team and do not mind the branding, Open WebUI is a fine choice too. Do not trust a pricing page for this. Make a few tiny calls per model, wait a day, and read the bill. list text models and inference profiles in your region aws bedrock list-foundation-models --region ap-south-1 \ --query 'modelSummaries ?contains outputModalities, TEXT . providerName, modelId ' --output text a few cheap calls per candidate aws bedrock-runtime converse --region ap-south-1 --model-id deepseek.v3.2 \ --messages ' {"role":"user","content": {"text":"Reply with one word: ok"} } ' \ --inference-config '{"maxTokens":20}' The next day, group Cost Explorer by service and record type. A model is covered when its usage line is matched by an equal credit line. Drop anything that shows real cost. What caught me out in the Mumbai region: in. India and global. profiles. The list output, never from a blog post including this one . If you copy one thing from this post, copy this. One YAML file lists the allowed models, and Terraform builds two things from it. allowed-models.yaml models: - name: kimi-k3.1 aliases: default, kimi-k3 old name keeps older setups working model id: in.moonshotai.kimi-k3.1 profile: true - name: qwen3-coder-480b aliases: coder model id: qwen.qwen3-coder-480b-a35b-v1:0 model list . No wildcards, and store model in db: false , so nobody can add a model from the admin UI. bedrock:InvokeModel and bedrock:InvokeModelWithResponseStream on exactly those model and inference-profile ARNs. For a profile, include the foundation-model ARN in every region the profile routes to. If the gateway is ever misconfigured, Bedrock still says AccessDenied. A smoke test proves it on every deploy: it calls every allowed model and alias, then asks for a model that is not on the list and expects a rejection. When you upgrade a model in place, keep the old name as an alias. Saved agents, presets and developer configs that still say kimi-k3 keep working. LiteLLM's Helm chart has a single-pod "monolith" mode. Use it for a team: the split gateway, backend and UI mode asks for 9 GiB of memory before you send a request. Settings I changed: x-litellm-end-user-id and records spend per email. validate end user id in db: true . Claude Code sends a JSON session blob in the user field; this setting drops JSON-shaped IDs so each session does not become its own "user". turn off message logging: true and store prompts in spend logs: false . You keep who, model, tokens and cost, not the prompt. A LiteLLM virtual key stores the list of models it may call at the moment you create it. When I upgraded Kimi K3 to K3.1 and added GLM 5.3 and MiniMax M2.5, every existing developer key kept the old list, and the new models answered with 403 "not available for this API key". The fix is one step in the deploy script: compare every personal key's model list with the current allow-list and update the ones that differ. Model upgrades now reach existing keys without reissuing them. LiteLLM had a rough 2026. Its GitHub security advisories https://github.com/BerriAI/litellm/security/advisories list five critical issues this year, including an SQL injection in API key verification, an authentication bypass through the Host header and another through the OIDC userinfo cache. It also had two supply-chain incidents: malicious PyPI releases in March https://docs.litellm.ai/blog/security-update-march-2026 , and on 21 October a compromised release pipeline https://docs.litellm.ai/blog/security-incident-oct-21-2026 pushed a credential-stealing v1.107.0 to PyPI and the official Docker images for about two and a half hours. What I did about it: /v1/chat/completions , /v1/messages , /v1/models , /v1/embeddings , /v1/responses . Everything else, including the admin UI, key management, SSO and metrics, returns 404 at the load balancer. Admin goes through kubectl port-forward . cosign verify \ --certificate-identity https://github.com/BerriAI/project-releaser/.github/workflows/release.yml@refs/heads/main \ --certificate-oidc-issuer https://token.actions.githubusercontent.com \ ghcr.io/berriai/litellm@sha256: