This post covers the whole shape of an Open WebUI rollout: the five workstreams that built it, why per-app tokens beat one shared key, what day-one enablement has to say, and how a model swap reached every consumer without touching their code. The supporting posts go deeper on each mechanism: the gateway internals, the browser-tool bridge, failover that actually fails over, shared agent memory and the prose-versus-numbers rule.
What a company AI workspace actually consists of
A company AI workspace is four layers, and only one of them is the thing staff see. From the top: a chat and project interface, an API surface that looks like a standard chat-completions endpoint, a model access layer that talks to whatever actually runs inference, and an identity layer that decides which person and which application may spend which capacity.
Most rollouts stop at the first layer. Someone signs up for a team plan, invites the company, and calls it done. That works until the first internal app needs a model, or the first department wants a different model, or finance asks who is using what. Then the workspace turns out to be a password sharing arrangement with a chat box on top.
The version described here put the gateway in the middle. Every consumer, whether a human in a browser or a service making an HTTP call, authenticates to the gateway. The gateway owns the upstream credentials. The front end is replaceable; the gateway is the contract.
The internal platform stack was Python and Open WebUI, with the gateway containerised on a Proxmox VM and the front end pointed at it as an OpenAI-compatible connection.
Why the gateway, not the chat UI, is the hard part
The gateway is where five separate problems get solved once instead of per application. The first is credential custody: one place holds the upstream secret, so rotating it is one change and no application ever stores it. The second is model indirection: callers ask for a stable alias, and the gateway maps that alias to whatever model is current.
The third is concurrency. The upstream here is reached through a command-line tool, not an HTTP API, and each invocation costs seconds before it does any useful work. A gateway can hold warm processes and queue requests against a fixed number of slots; a caller cannot.
The fourth is accounting. Per-token or per-app counters tell you which service is expensive, which one is retrying in a loop, and which one is idle. A shared key tells you none of that.
The fifth is failure policy. Retries, cooldowns, fallbacks and timeouts belong in one place, because that is the only place that can see all the traffic and make a consistent decision.
That is also why a gateway is a liability if it is treated as a thin proxy. A forty-line forwarding layer adds a hop without adding any of the five. The value comes from owning the process lifecycle, not from renaming the path.
The five workstreams that made the rollout shippable
The build was split into five streams with non-overlapping files, which is the same shape used on the other platform work: each stream owns its files, and a reviewer runs the suites rather than trusting the reports. Here is what each one does.
1. The ACP driver
The upstream tool has a long-lived protocol mode. The ACP driver speaks that protocol, manages the handshake, and keeps the process attached to a session. This is the mode that makes a warm pool possible at all: a process that stays alive keeps its conversation state.
2. The print-mode driver with process pooling
Not every call needs a conversation. Print mode runs one prompt and exits, which is simple and stateless, and also slow: a fresh process pays the full startup cost on every request. The print-mode driver adds a pool, so the startup cost is paid ahead of time and a request waits for a free slot rather than for a cold start. The two drivers coexist because chat and batch work have different shapes.
3. The bridge server: quota, sessions, store
The server is the OpenAI-compatible face. It exposes the chat-completions route, validates the bearer token, maps a requested model to an upstream model, enforces a concurrency limit and a queue depth, and translates upstream failures into HTTP status codes a normal client can handle. Sessions and the store are what let it remember a conversation across calls without asking the caller to resend everything.
4. The Open WebUI pipe function
Open WebUI supports custom pipe functions, which is how the chat surface gets behaviour the base product does not ship. The pipe function handles the workspace-specific parts: which model list to show, how to present errors, and how to keep the gateway’s limits visible instead of turning them into a generic failure.
5. The hardened container
The container is deliberately boring: non-root user, no capabilities, one writable volume for the upstream authentication material, and no secrets in the image. The point is that the gateway is the one process holding a credential that can spend money, so it should be the least privileged thing on the host.
That split is not project management decoration. It is what made the rollout reviewable: five small surfaces, each with a test suite, instead of one service that nobody could reason about.
Per-app tokens: how to scope access without one shared key
Per-app tokens are the difference between “the company has an AI account” and “each system has a named, revocable identity”. The workspace issues a token per consumer: the reporting dashboard, the internal tools, and the chat front end each present their own.
The practical benefits are immediate. Revoking one integration is a one-line change rather than a company-wide password reset. Usage can be attributed without parsing request bodies. A runaway loop in one service can be throttled without touching the others. And when a token leaks, the blast radius is the one service it belonged to.
Three rules keep this from degenerating:
- The token identifies the application, not the person. People authenticate to the front end. The front end authenticates to the gateway as itself. Mixing the two makes revocation impossible.
- Tokens are compared in constant time and never logged. The gateway logs a request id, the model, the prompt size, the wall time and the token counts. It does not log the prompt or the bearer token.
- Every token has a budget. A named token with no limit is a shared key with extra steps.
The same pattern applies inside the workspace: the person’s session decides what they can open, and the application’s token decides how much model capacity it can draw. Two identities, two jobs.
What day-one enablement has to cover
Day-one enablement is a document and an email, and both have to answer the questions people are too polite to ask. The workspace shipped with a Getting Started guide and a launch email rather than a link and a shrug.
The guide covered four things. What the workspace is for, in the language of the work rather than the technology. Which material is allowed in and which is not, because “do not paste client data” is not obvious to someone who has been doing it in a browser tab for a year. What the limits are, so a slow answer is understood as a queue rather than a broken tool. And who to ask when something fails, with a named person rather than a ticket queue.
The launch email did the same job in three paragraphs: what changed, one example task per team, and where the guide lives. The failure mode to avoid is the launch email that lists every feature. Nobody reads it, and the features are not the reason people adopt the tool.
Adoption measurement is deliberately not quoted here. Counting logins is easy and tells you almost nothing; the useful signal is which recurring tasks moved into the workspace and stayed there.
Moving every consumer to a new model in one change
A model migration is one change when callers never name a model directly. The standard way to get there is an alias layer: the gateway exposes a stable alias, the alias resolves to a current model in one configuration file, and every consumer keeps asking for the alias it always asked for. That is the design used here.
The sequence that makes this safe:
- Add the new model behind a new alias. Do not repoint the existing alias yet. Both models are reachable.
- Run the contract test against both. Same request shape, same response shape, same error codes. The test does not check prose quality; it checks that the boundary did not move.
- Repoint the alias. This is the single change. Consumers see a different answer, not a different API.
- Watch the error rate and the token counts for a day. A new model with a different verbosity changes cost and latency even when it is correct.
- Remove the old entry. Leaving it reachable is how a stale caller quietly keeps running the old model for six months.
The alternative, telling every application to change its model string, is a coordinated deploy across systems with different release cadences. It is also how you end up with four models in production and no record of which one produced a given output.
Direct keys vs a shared key vs a gateway
| Approach | Credential scope | Blast radius of a leak | Model migration | Usage attribution | Operational cost |
|---|---|---|---|---|---|
| Vendor key per person | Per person | One person’s access | Every person changes a setting | Per person, if the vendor reports it | Low to start, high to govern |
| One shared company key | Company-wide | Everything | Every caller changes code | None worth having | Low, until the first incident |
| Gateway with per-app tokens | Per application | One application | One alias change | Per token, per model | One service to run |
Which should you choose? A vendor key per person is fine for a pilot with five people and no internal integrations. A shared key is fine only while nothing else calls the model. Once a second system needs access, or a department needs a different model, the gateway pays for itself: it turns credential custody, model choice and limits into configuration rather than code changes in every consumer.
What broke and what we changed
A health check that stayed green while the gateway was unusable. The bridge reports ok: true even when the upstream is not signed in, because otherwise the container restarts in a loop during a device-code login. That is the right call for the container and the wrong signal for everything downstream: a caller sees a healthy service and gets a 503 on the first real request. The fix was to expose the authentication state as its own field and have the pipe function fail loudly with a message that names the actual problem.
One key for everything. The first version had a single credential, which meant no revocation story and no attribution. Splitting it into per-app tokens was the change that made the workspace operable rather than merely working.
Model names in consumer code. The first integration hard-coded a model id. When the model changed, that integration kept working and quietly produced different output. The alias layer removed the possibility.
A container that could not verify a certificate. A later deployment on the same bridge pattern shipped on a slim base image with no CA bundle. Every outbound call failed certificate validation while the container’s own version check passed, so the health check was green and the service was completely broken. Installing the CA bundle and adding a real end-to-end probe, not a version probe, fixed it.
The pattern across all four is the same: the health check measured the process, not the job. A probe should exercise one real unit of work, or it is decoration.
Related
- Building an OpenAI-compatible gateway in front of tools that are not APIs — the pooling, session and quota mechanics behind this rollout.
- Turning a browser-only AI tool into an HTTP API — the same wrapper pattern applied to image and video generation.
- LLM failover that actually fails over — what happens when the upstream, not the caller, is the unreliable part.
- One memory layer shared by several coding agents — the identity and provenance problem in a different setting.
- LLMs write prose, never the numbers — the rule that shapes what an internal AI platform is allowed to output.
- Model gateways and bridges — the discipline this work sits in.
Frequently asked questions
What is an AI workspace rollout?
An AI workspace rollout is the work of giving a whole company a shared AI surface: a chat front end, a way to authenticate people and applications, a gateway that holds model credentials and enforces limits, and enablement material that tells staff what the tool is for. The software is the easy part; the identity and credential boundaries are what take the time.
Do we need a gateway if we only use one model?
Not at first. A single front end pointed at a single provider is a legitimate starting point. The gateway earns its place when a second consumer appears, when you need per-application revocation, when limits have to be enforced, or when a model change should not require a deploy in every system. Those arrive faster than most rollouts expect.
Why per-app tokens instead of one API key?
Per-app tokens make revocation and attribution possible. If one integration is compromised or starts looping, you revoke or throttle that token and nothing else breaks. A single key means every incident is company-wide, and usage reports cannot tell you which system caused the bill. The cost is a small amount of token management.
What should the employee guide cover?
Four things: what the workspace is for, what data may and may not go into it, what the limits are so slow answers are understood, and who to contact when it fails. Keep it short enough to read in one sitting. A feature list is not a guide, and a link to vendor documentation is not enablement.
Can Open WebUI talk to a self-hosted gateway?
Yes. Open WebUI connects to any OpenAI-compatible endpoint by base URL and API key, so a gateway that implements the chat-completions route appears as just another connection. That is what lets the front end stay generic while the gateway handles pooling, quotas and model mapping behind it.
How do you migrate every app to a new model safely?
Put the new model behind a new alias, test both aliases with the same contract test, repoint the existing alias in one configuration change, watch error rates and token counts for a day, then remove the old entry. Callers never learn a model id, so the migration is invisible to them and reversible in one step.
What is the biggest risk in a company-wide rollout?
The biggest risk is treating it as a software purchase rather than an operating change. A workspace that nobody is told how to use, with no data rules and no named owner, produces either no adoption or uncontrolled use. The technology is the part you can buy; the boundaries, the guide and the review are the part you have to build.
