Home / LLM gateway

Every team’s AI, through one door.

An open-source gateway for language models on Google Cloud, built on LiteLLM. One private address for every team, a project and a budget for each, every message and answer checked, and a spare when something is down. In 1.1.0: a door for coding tools, agents with their own identity, tool servers, and governance switches. With a free book that explains it to people new to AI.

Apache 2.0Signed images on GHCR1.1.0: every switch tested live
The cover of One Door to AI, a beginner's guide to running an LLM gateway with LiteLLM on Google Cloud, by Rakesh Gupta
The problem

Every team bought its own AI. Nobody can answer the questions.

A key in the code, a key in a chat, a personal card. It works until someone asks what it costs, where customers’ words go and how to turn a leaked key off. A gateway puts the answers in one place and is easier for teams than buying their own.

Who pays?

Each team’s calls run in its own Google Cloud project, on its own bill, with a monthly budget and limits.

Where does it go?

The EU by default. Leaving it needs a name on a list, and a failover never goes where a team is not allowed.

What stops a mistake?

Model Armor reads every message and every answer. If it cannot check all of it, the call is refused.

How it works

One address, many teams. The key decides the rest.

Two example apps, in two projects, call the same URL with the same request. The key says which team it is, and the team’s file says which project pays, which models and places it may use, and what happens when one is down.

The orders and support apps, each in its own project with its own key, call the same gateway address. The gateway checks the key, models, budget and safety, then calls the models in each team's own project.
Two teams, two projects, one address. Neither app can call a model directly, use the other’s model, or name another project in its request. Each of those is a check that runs after every deploy.
The architecture: team apps reach a cross-region internal load balancer and LiteLLM gateways in two regions with Model Armor and Redis, a database, private endpoints to Google, and models in each team's project.
No road to the internet. Two regions, private endpoints to Google, keys that are never in Terraform state, and GitHub Actions with no stored password. Dashed: a switch, off unless set.
The steps of one request: load balancer, request filter, key and team, budget and limits, Model Armor on the prompt, router, model, Model Armor on the answer, usage record, with what each step refuses.
A filter in front. Without it, we sent one team’s request to another team’s project, and to another continent, with one extra line. The filter reads the raw request and refuses what it does not know, including a provider’s own tools.
New in 1.1.0

Coding tools, agents, tools, and the rules round them.

Every addition is a switch, off unless set: a running 1.0.0 upgrades with no change except the new images. Then turn on what you need, one at a time.

An onboarding repository

A private repository per organisation holds the settings. A pull request is checked against every rule; a merge deploys. Weekly: key rotation, a new release, a model near its date.

The developers’ door

Codex CLI and Gemini CLI through the gateway, with a key and a daily budget for each person, fetched with their Google sign-in.

Agents and tools

An agent signs in with its own Google identity, with a budget, a cap per task and a stop switch. Tool servers per team and agent, their traffic checked on the way.

Governance

Safety rules per team, words kept only by choice, a daily admin record nobody can change, a data perimeter, your own encryption keys.

Running it

Budget alerts, a weekly price check against the bill, a database copy with failover and fail-back, an upgrade lane that tries one region first.

onedoorai

The gateway’s Python parts on PyPI: pip install onedoorai for your key, your spend and the admin route.

Every secret in Secret Manager, in the gateway project and in each team's project, with what it holds, who writes it and who reads it; and every service account with what it may do.
Every secret and every identity. What each secret holds, who writes it and who reads it, and what each service account may do. No key or password is ever in Terraform state, a log or a workflow’s output.
The private onboarding repository, its workflows (plan, deploy, rotate, release watch, model watch), key rotation in four steps, and the jobs that run on their own.
The onboarding repository. The gateway’s code and an organisation’s settings live apart; the platform team does onboarding from app teams’ requests.
The developers' door: Codex CLI and Gemini CLI on a developer's machine call dev.domain with the person's own key, read with onedoorai key; the door's paths, checks and measured results.
The developers’ door. The same checks on every question; answers arrive as they come.
An agent's call: its Google ID token is checked by the request filter, swapped for the agent's own key from a secret, and recorded with its task. Tool servers granted per team and agent, tool traffic checked, and the provider's own tools refused unless asked for.
Agents and tools. The gateway is where an agent is seen and stopped; what a tool may do stays with the tool.
The governance switches: safety rules per team, keeping words, the admin record, the data perimeter, your own keys, budget alerts and price check, model watch, with what each builds and what was measured.
Governance switches. What each builds, and what the live test measured.
Built, broken, measured

We broke it on purpose. Here is what happened.

On real two-region deployments at trial size: 1.0.0 on 22 November 2026, and 1.1.0 on 24 and 25 November, upgraded from a running 1.0.0 through a private onboarding repository.

The database1.1.0: copy promoted, then home

Failover about 6 minutes, fail-back about 6, a new copy 7.5; every team’s checks passed on the copy and after. The test found that an apply after a failover would have replaced the live database: plans now refuse it.

A new LiteLLM1.1.0: one region first

A gateway that could not start stopped the lane at the first region; traffic stayed on the last good version and every check passed while it was broken.

An agent1.1.0: stopped

Refused 2 seconds after its key was blocked in one region, 27 in the other. Its fourth call of a task was refused; a stranger’s identity, always.

A perimeter1.1.0: enforced

Round every project for six minutes: every team’s checks passed, and only a laptop and the apps’ direct model calls were stopped.

A regiondatabase restarted, London barred

Traffic moved to Belgium and back. 1 of 379 calls failed.

A model locationthe EU cut off

The team allowed to leave the EU was served from elsewhere. The team that is not got an error, and never left. The alert opened about four minutes after the first failure.

A change by handa budget raised in the UI

Found by the drift check, with an alert, and put back by the next run.

A keyrotated while running

Both keys worked during the change; the old one was refused after it.

Our own checkfound short, and mended

In the first build, on LiteLLM’s own guardrail, Model Armor read only the last thing the user said. Now it reads every message, the tools and the model’s reasoning, and what cannot be read whole is refused. Tests hide a forbidden word in every place a request can hold one; they fail on the first build and run on every change.

The 1.0.0 failures were caused on its first build; the rebuilt 1.0.0 was deployed whole from the published images the same day, and all 35 checks passed as each team. The 1.1.0 test turned on every switch, found and fixed what it found before the release, and recorded the numbers. Not tested: the loss of a whole Google Cloud region, production sizes, sustained load, Shared VPC and on-premises callers. The published images leave out LiteLLM’s Enterprise parts. The README lists everything.

What you see

The facts of every call, and never the words.

LiteLLM’s own admin screens, from the test deployment, with project names replaced.

One request in LiteLLM's log: the model, the EU address it was sent to, tokens, cost, two guardrail checks, and no stored prompt or answer.
One call. Sent to the EU address, checked twice, a fraction of a cent, and no prompt kept.
The orders team in LiteLLM: a ten dollar monthly budget, limits, and its two models.
One team. Its budget, limits and models, all from one reviewed file.
The support chat example app refusing a prompt injection: content blocked by Model Armor.
A blocked prompt. The model never saw it.
Try it

On your laptop, free, with pretend models.

Docker, two commands, no cloud account. The same image, the same filter and the same screens.

the local example
$ git clone https://github.com/fluxorsoft/llm-gateway
$ cd llm-gateway/local && docker compose up -d
admin     http://127.0.0.1:4000/ui/   admin, sk-local-admin
gateway   http://127.0.0.1:4001       what apps call

# the images, signed
ghcr.io/fluxorsoft/llm-gateway/gateway:1.1.0
ghcr.io/fluxorsoft/llm-gateway/runner:1.1.0
ghcr.io/fluxorsoft/llm-gateway/app:1.1.0

# the Python parts: your key, your spend, the admin route
$ pip install onedoorai
The free book

One Door to AI. For people new to it.

You do not need to know anything about AI. Follow a made-up company from four teams with four secret keys to one door that everyone uses, with a picture in every chapter and nothing claimed that was not measured.

Inside28 chapters, 130 pages
  • Language models, tokens and cost, in plain words
  • The seven questions your head of security will ask
  • LiteLLM: the Python library in one chapter, the gateway in the rest
  • Keys, budgets, limits, and who really pays
  • The holes in our own fence, and how we closed them
  • Failover that never breaks a promise about place
  • Two teams, two projects, one address
  • Answers from your own documents, with RAG Engine
  • Reading invoices, with Document AI
  • Every AI tool through the proxy: how a platform team installs them, what to keep, a budget for each person
  • Every other team, in five questions
  • Alarms that ring, keys that rotate, updates you can trust
  • New for 1.1.0: a home for the rules, a spare database, a door for coding tools, agents, tools, and the rules a regulator will ask about

By Rakesh Gupta, founder of Pipewright. Free to share, unchanged and with credit, under CC BY-NC-ND 4.0.

LiteLLM is a product of BerriAI. This project and book are independent of BerriAI and Google. LiteLLM’s core is MIT; its Enterprise parts are not used here.