Open WebUI with Ollama and OpenAI-compatible providers

Connecting Open WebUI to Ollama and remote OpenAI-compatible APIs is straightforward to start and easy to get wrong in access control. This page covers the decisions, build sequence, effort drivers and checks.

On this page

How to connect Open WebUI to Ollama and OpenAI-compatible providers

Open WebUI connects to Ollama, OpenAI, Anthropic or any OpenAI-compatible provider from a single interface, so a team can run local models through Ollama alongside one or more remote APIs without giving users a separate tool for each. The connection itself is the easy part. The harder work is governance: deciding which models each group can see, where provider keys are stored, and how usage is traced back to a team or person. Those decisions determine whether the rollout stays manageable once more people depend on it.

The common failure is convenience. A provider added during a pilot, often with a single shared key, tends to stay enabled for every user because nobody scoped it at the start. Once that key is shared, usage cannot be attributed, revoking access means rotating a credential that many people rely on, and a user can reach models that were approved only for another group. Model lists also change as providers add, rename or retire models, so an approved list written once will drift unless someone reviews it on a schedule.

Before connecting anything, confirm three things in your own environment: which providers are approved and under what data terms, which groups should see which models, and who owns each provider account and its key. Then check how your installed version handles model visibility and connection settings, because these controls have changed across releases and the Open WebUI features documentation is the reference to verify against. Treat the provider connection list as a controlled configuration, with an owner, a change record and a regular review, rather than something each administrator edits ad hoc.

Which components carry the connection, the keys and the model list

A working Open WebUI setup with Ollama and remote providers depends on a small set of components: where connections are configured, where models run, where keys live, who can see which models, and where the configuration is stored. Each one needs a clear owner before users arrive.

Admin connection settings

Open WebUI holds the endpoint URLs and credentials for each Ollama server and OpenAI-compatible provider in its admin connection settings. Only administrators should be able to add, edit or remove these connections, because a connection defines which models appear for every user. Check that connection changes are limited to a named admin group and that each connection has a documented owner.

Open WebUI features

Ollama server and pulled models

The Ollama server runs the local models your team pulls and serves them to Open WebUI over its own API. Model files, GPU memory and disk capacity sit with the infrastructure team, not with Open WebUI. Confirm which models are pulled, who approves new pulls, and how the server is exposed so that only the Open WebUI instance can reach it.

Remote provider endpoint and API key

A remote OpenAI-compatible provider needs a base endpoint and an API key stored with the connection. The key is billed to your account and grants whatever access that key carries, so it should be a dedicated key with a spending limit rather than a personal key. Ask the provider which key scopes and usage controls are available before you connect it.

Groups and per-resource model access

Model visibility is controlled through user groups and per-resource permissions, so an approved model can be shown to one group and hidden from others. Map each group to the models it may use and document the mapping. Test with a non-admin account after every change, since an admin view can hide a permission gap.

Open WebUI features

User-issued API keys

Users can create their own API keys to call Open WebUI programmatically, and those keys inherit the user's model access. Decide whether API key creation is allowed at all, who may use it, and how keys are revoked when someone leaves. Keys are a second route into the model list, so they belong in the same access review as sign-in.

Database storing connection configuration

Connection settings, groups, permissions and user records are stored in the Open WebUI database. A single-replica install can use the default SQLite file, while multi-instance deployments require PostgreSQL. Confirm where the database lives, who can read it, and that it is backed up, because losing it means re-entering every provider key.

Scaling Open WebUI

Every model call passes through Open WebUI before it leaves the network

A user opens Open WebUI in a browser or calls its API with an API key. Open WebUI first checks the sign-in and the user's group permissions, which decide which models the user may see. Only then does the backend send the request, either to an Ollama server on the local network or to a remote OpenAI-compatible endpoint. The provider key is stored on the Open WebUI backend and never reaches the user's device. Check that the audit trail is enabled in your own deployment, because the diagram shows where logging belongs, not that it is switched on by default.

Requests pass through Open WebUI's permission check before reaching any model provider.

Local Ollama or remote OpenAI-compatible provider: which to connect and when

This table compares four ways to supply models to Open WebUI and the operational cost each one leaves with your team. Read each row against your data handling rules, hardware position and budget ownership, then confirm current provider terms and hardware needs before committing. Most organizations end up with a mixed catalog, so the useful question is which sources each user group is allowed to reach.

OptionWhen it fitsWhat it costs you operationally
Local Ollama models on infrastructure you controlPrompts and documents must stay inside your network or data center, and you can staff GPU or CPU capacity for inferenceYou own hardware sizing, model downloads, patching and capacity planning. Model quality depends on what you can run locally, so confirm hardware needs for each model before selecting it.
Remote OpenAI-compatible API through a managed providerUsers need the strongest hosted models quickly, and your data terms with the provider are acceptable after legal reviewYou manage provider contracts, data retention terms, regional options and spend limits. Usage is billed per request or token, so cost follows adoption unless you set quotas.
Self-hosted OpenAI-compatible serverYou want the OpenAI-style interface for internal models, but the serving layer must run in your own environmentYou operate the serving stack, its authentication, logging and upgrades. Open WebUI sees one compatible endpoint, so compatibility gaps show up in your testing, not in the UI.
Mixed model catalogDifferent teams need different models, for example local models for sensitive work and hosted models for general draftingYou maintain more connections, more keys and more access rules. Each source needs its own owner, rotation schedule and approval record, and misrouted prompts become a governance issue.
Provider key handlingAny remote or self-hosted endpoint that requires a keyKeys should be stored by administrators and never shown to end users. Plan a rotation procedure and confirm how Open WebUI stores and scopes each connection.
Who pays for usageHosted APIs bill by consumption, while local models shift cost to hardware and staff timeAsk finance to agree on a budget owner and per-group limits before rollout. Quotes should separate one-time setup from recurring usage and infrastructure.

How to configure Ollama and OpenAI-compatible connections step by step

This sequence takes an Open WebUI instance from a bare install to a set of model connections that only approved groups can reach, with provider keys held by the admin and model use recorded. Each step ends with a check so the admin knows it is safe to move on.

  1. Confirm the install method and version

    The admin records how Open WebUI was installed (Docker, Docker Compose, Kubernetes with Helm, or pip with open-webui serve) and the exact release in use. The release matters because connection settings, menus and admin options change between versions, and the project publishes new releases often. Check the version in the admin panel and compare it with the current entries on the project's GitHub releases page before changing anything. Done when the admin can state the install method and version in the change record.

  2. Confirm multi-replica prerequisites first

    If more than one Open WebUI replica runs, PostgreSQL and Redis must be in place before connection settings are created, because connections and application state need to be shared across replicas. Single-instance evaluations can skip this, but the database should be a locally attached SSD or NVMe volume if SQLite is used. Follow the scaling guide for PostgreSQL, Redis, shared file storage and an external vector database before continuing. Done when every replica reads the same database and Redis instance and a settings change made on one replica appears on the others.

  3. Reach Ollama from the Open WebUI backend

    Open WebUI calls Ollama from its server side, not from the user's browser, so the address must resolve from the Open WebUI container or host. In a container setup, localhost points at the container itself, so the admin needs the host address or the Compose service name. Add the Ollama base URL under the admin connection settings. Done when the admin confirms the model list loads from Ollama and a short test prompt returns an answer from a local model.

  4. Add the remote OpenAI-compatible endpoint

    Open WebUI can connect to OpenAI, Anthropic or any OpenAI-compatible provider. The admin enters the base URL and the API key in the admin connection settings, so the key is stored by the server and not handed to end users. Confirm the provider's documentation for the exact base URL format and any extra headers it requires. Use a key scoped to this deployment where the provider allows it. Done when the provider's model list appears in the admin panel and a test prompt succeeds.

  5. Verify the key stays out of browser traffic

    Open a signed-in user session in a browser, open the developer tools network panel, and load the model selector and run a chat. The provider key should not appear in any request or response the browser sends or receives, and the model list should come from the Open WebUI server. Check any proxy or load balancer logs as well, since a key in a URL or header logged upstream is still a leak. If a key appears in browser traffic, remove the connection and fix the configuration before any user receives access. Done when a captured session shows no provider credential.

  6. Restrict connections and models to groups

    Create groups that match your access policy, then set each connection and each model to be visible only to the groups allowed to use it. Use role-based access control with groups and per-resource permissions rather than leaving connections open to all users. Confirm the default role for new sign-ups does not grant access to restricted models. Done when the admin can list, for each group, exactly which connections and models appear in its selector.

  7. Test a user in each group

    Sign in as a test user in every group and confirm the model selector shows only the models that group is approved to use. Send one prompt through each visible model and try to reach a model outside the group, which should be hidden or refused. Repeat this after any change to groups or permissions, because the selector and direct model links can behave differently. Done when each group's test user sees the expected list and no restricted model can be reached by any path the test covers.

  8. Enable audit logging of model use

    Turn on audit logging for model use and confirm which events are captured, such as who sent a prompt, which model answered and when. Confirm where the log is stored, who can read it, and how long it is kept under your policy. Confirm the feature and its settings in the current Open WebUI documentation for your version, since logging options vary by release. Done when a test prompt from a test user appears in the log with the user, model and timestamp, and the admin has recorded where the log lives.

How single-node, multi-replica and air-gapped setups change provider connections

On a single node, Open WebUI runs as one process with its connection settings, users and sessions held in one database. Ollama and any OpenAI-compatible endpoints are added once in the admin settings, and every user request goes through the same process. The main risk is storage: the scaling guide says SQLite remains acceptable for a single replica, evaluation or a small team only when the database file sits on locally attached SSD or NVMe storage rather than network storage.

  • Database location: Confirm that the SQLite file, typically under the data directory mounted into the container, is on local SSD or NVMe, not an NFS or network volume.
  • Backup of connection settings: Provider endpoints and stored credentials live in that database, so include it in backup and restore tests.
  • Ollama reachability: If Ollama runs on another host, confirm the URL, port and firewall rules from the Open WebUI container, not from your workstation.
  • Token lifetime without Redis: Signing out does not revoke tokens, which stay valid until they expire, by default after 4 weeks. Plan for that if users leave the organization.
  • Model list checks: After adding each provider, confirm the expected models appear and that a test prompt returns a response.

Confirm these items on the actual host before onboarding users, because a single node has no second instance to absorb a failed database or a misconfigured endpoint.

What drives effort in a provider connection rollout

This table lists the factors that make a connection rollout of Open WebUI with Ollama and OpenAI-compatible providers take more or less work, why each one adds effort, and how to keep it contained. Read each row alongside the question of who on your side or the partner's side owns that piece of work. The main takeaway is that model access rules, identity and evidence needs usually cost more than the initial provider connection itself.

DriverWhy it adds effortHow to keep it down
Number of providers and modelsEach Ollama host and each remote OpenAI-compatible endpoint needs its own base URL, credentials, model list checks and health monitoring. Every added model multiplies testing and routing decisions.Start with a short approved model list per provider. Add models through a documented request. Confirm in the provider's own documentation which endpoints and model names it exposes.
User groups needing different model accessEach group that needs a different set of models requires its own permission mapping, and each permission change must be tested from the user's side. Overlapping groups create conflicts that are hard to trace.Define three to five access tiers before configuration begins. Map them to Open WebUI groups and check the resulting access with a test account per tier.
Identity integration (OIDC, LDAP or SCIM 2.0 provisioning)Group names from the identity provider must match Open WebUI groups. Provisioning, deprovisioning and role mapping all need joint work between the identity team and the platform team.Agree the group naming scheme and the source of truth for membership first. Confirm with your identity team which of OIDC, LDAP or SCIM 2.0 is in use before building.
Data classification rules for modelsDeciding which data may go to which model requires input from data owners, legal and security. Remote providers and local Ollama hosts often sit under different approval paths, which splits the decision.Write a one-page matrix of data classes and permitted model endpoints before routing is configured. The security or compliance team signs off once, then the platform team enforces it.
Environments (dev, test, production)Each environment needs its own provider keys, endpoints and access groups. Keys copied between environments are a common source of exposure, and promotion steps must be repeated for every change.Keep provider keys in each environment's secret store, never in shared configuration. Use separate test providers where possible and promote configuration through a single documented path.
Evidence requirements for compliance reviewsAssessors usually ask who can reach which model, how keys are stored, and whether access and usage are logged. Producing this evidence means exporting configuration, access records and test results on a schedule.Ask the assessor which evidence they expect before setup. Capture configuration snapshots and access test results as part of each change. Note that DeployOpen prepares evidence but does not issue audit reports or certifications.

Keeping provider keys and model access out of end users' hands

Provider keys and model access are separate controls, and both need to be set by administrators rather than end users. The cards below cover where keys live, how access is granted, how sessions end, and what the network allows, so that the model list reflects what the organization has approved.

Provider keys stay in admin settings

Store Ollama endpoints and OpenAI-compatible API keys only in the admin-level connection settings. Confirm that the keys are not exposed to the browser or to non-admin users, and check that the connection list returned to a regular user shows models but not credentials. Rotate keys through the admin screen when staff leave or when a key may have been exposed. Keep a record of who holds admin rights, because those users can see and change every provider connection.

Open WebUI features

Grant models through groups

Give users access to models through Open WebUI groups and per-resource permissions, not through a shared credential that everyone inherits. Map each approved model to the groups that need it, and test with a standard user account to confirm that unapproved models do not appear. Review group membership on a fixed schedule, since access follows group membership rather than the individual's request.

Scope personal API keys

Personal API keys let users call Open WebUI programmatically, so they need the same scrutiny as sign-in. Decide whether your policy allows users to create them at all, and if it does, confirm that each key belongs to one user and can be revoked by an administrator. Check which models and endpoints a personal key can reach. Ask the vendor or your own test environment to confirm how key scope is enforced in the version you run.

Token revocation needs Redis

Without Redis, signing out does not revoke tokens. They remain valid until they expire, which is by default 4 weeks. For a deployment where a departing user or a stolen laptop must lose access at once, Redis is part of the access control, not an optional performance component. Test sign-out with a session token in a second browser to confirm that the token stops working, and record the expiry setting in your standard.

Scaling Open WebUI

Disable open sign-up

Turn off open sign-up so that only users provisioned through your identity process can reach the model list. Confirm the setting from an unauthenticated browser session, and check that a new visitor cannot create an account and see the providers you have connected. Pair this with your identity provider or SCIM provisioning so that account creation and removal follow the joiner and leaver process.

Restrict outbound provider endpoints

Limit the Open WebUI server's outbound network access to the Ollama hosts and the OpenAI-compatible endpoints you have approved. A misconfigured or injected connection URL should not be able to send prompts or keys to an unapproved destination. Review egress rules in your firewall or cloud security groups, and test by attempting a connection to an unlisted host from the application server.

How to test that routing works and fails safely

Test routing before any user touches the setup, and treat each failure as a blocker. Start with access: sign in as a test user who is outside the group approved for a restricted model and confirm that the model does not appear in the model selector, cannot be chosen from a chat, and returns a refusal when its identifier is sent directly to the chat API. Then repeat the check from the group side with a user who should have access, so you know the restriction is doing the work and not a broken connection. Use a test account for every role you have defined, and record the group membership used for each run.

Next, confirm that the provider key never leaves the server. Inspect the browser network traffic, the page source and the JSON returned by model listing and chat endpoints, and search for the key value and its prefix. Also check any admin screens that display connection settings to non-admin roles. Failure modes to probe include an unreachable Ollama host or remote endpoint: stop the Ollama service or point a connection at a closed port, then send a prompt. The correct result is a clear error that names the connection problem, with no silent retry against a different, unapproved model. Confirm the same behavior when the remote provider returns an error status.

Revocation and audit come last. Sign in as a user, disable that account or remove them from their group, sign out, and confirm that the old session token no longer works. Without Redis, the scaling guide notes that sign-out does not revoke tokens, which lets them remain valid until expiry (by default after 4 weeks), so this test should fail on a single-container install without Redis and pass once Redis is configured. Finally, check that the audit log records the user, model and timestamp for each request. Ask your team which log sink holds these entries and how long they are kept. Run this full set after every connection change and after each Open WebUI upgrade, and keep dated results, configuration snapshots and screenshots as evidence for your assessors.

What to monitor, back up, upgrade and document after go-live

Once users are on the platform, the connections to Ollama and remote providers keep changing: endpoints move, keys expire, and new releases arrive. The four items below are the ones that keep those connections dependable and auditable, and each needs a named owner before launch.

Monitor provider reachability and errors

Track availability and error rates separately for each provider connection, including the local Ollama host and every remote OpenAI-compatible endpoint. A single failing provider can look like a general outage to users, so alerts should name the connection. Owner: platform engineering runs the alerts, and the model owner for each connection reviews weekly error trends. Check that alerts fire when a key is rejected or a remote endpoint times out, not only when the Open WebUI container stops.

Back up configuration and protect stored keys

The database holds connection configuration, user records and, depending on how the connections were set up, provider credentials. Back it up on a schedule and test restores into a separate environment. Confirm with the vendor and your own environment how provider keys are stored and encrypted at rest, who holds the encryption key, and how it is rotated. Owner: the infrastructure team runs backups and restore tests, and the security team approves the key handling.

Open WebUI features

Test every upgrade before rollout

Open WebUI publishes releases often. v0.12.0 was followed by v0.12.3 in October, so an upgrade calendar matters. Before each release reaches users, rerun the connection tests and the permission tests against a staging copy, including checks that each group still sees only its approved models. Owner: platform engineering owns the test run and the rollback decision. The release process itself is covered in the upgrades and support topic.

Open WebUI releases

Document models, owners and key rotation

Keep a single register of approved models, the provider connection each one uses, the named owner, the key rotation schedule and a dated change log. Auditors and security reviewers ask for exactly this record when they assess who can reach which model. Owner: the service owner maintains the register, and each model owner confirms their entries each quarter. Record every change to a connection, group permission or key, with the date and the person who approved it.

Questions buyers ask before connecting providers to Open WebUI

Can our team connect Open WebUI to providers without outside help?

Yes, for a small single-node setup with a short, clear model list and one or two people who can administer it. The work gets harder once you add user groups, SSO, separate environments and compliance evidence, because each of those touches who can see which model and how provider credentials are stored. Open WebUI supports Ollama, OpenAI, Anthropic and any OpenAI-compatible provider from one interface, so the connection step itself is rarely the hard part. The decisions around access and evidence are. Ask yourself whether someone on your team can document those decisions and test them before users arrive.

What drives the cost and effort of connecting model providers?

Effort rises with the number of providers, the number of user groups that need different model access, the identity integration, the number of environments (for example, test and production) and the evidence your security or compliance team will ask for. Each provider adds its own account setup, key handling and model list. Each group adds a permission design and a test pass. Identity and environments multiply the testing. Ask any partner to price these items separately in a written scope, and confirm which are one-time work and which recur as ongoing support.

What do we need to provide before the work starts?

Four things make the work move quickly. First, a named owner for each provider account, including who holds billing and who can rotate keys. Second, a model approval decision: which models users may use, for which purposes and by which groups. Third, network rules that allow Open WebUI to reach Ollama hosts or remote API endpoints, and that restrict outbound traffic to approved destinations. Fourth, a test environment with non-production provider keys, so connections and permissions can be checked before real users sign in. Missing any of these usually adds rework rather than delay in the design phase.

Can provider API keys be kept off end users' devices?

Yes, when provider connections are configured by administrators only and users reach models through group permissions rather than by holding credentials. In Open WebUI, administrators add the provider connection, and the key is stored on the server. Users sign in and see only the models their group allows. You should still confirm this behavior against the release you deploy, test it with a non-admin account, and check that API keys issued to users cannot be used to call providers directly. Document the test result, because security reviewers will ask how the separation was verified.

Is Ollama cheaper than a remote OpenAI-compatible API?

It depends on your hardware, your usage pattern and the terms of each provider, and you should confirm all three before deciding. Ollama runs models on hardware you control, so cost is driven by the servers or GPUs you buy or rent, their power and cooling, and the staff who run them. A remote API is billed by usage under the provider's terms, so cost is driven by how many requests users send and which models they choose. Light, steady use often favors a usage bill, while heavy, predictable use can favor owned capacity. Ask your provider for current pricing and terms in writing, and model your expected usage before comparing.

Do we need the enterprise license to connect providers?

No. Connecting Ollama and OpenAI-compatible providers is a configuration task that does not depend on the license. The licensing question is separate: under the Open WebUI License, deployments that exceed 50 users in any rolling 30-day period must keep Open WebUI branding unless the operator holds an enterprise license or written contributor permission. Enterprise licenses allow white-labeling and custom branding and include dedicated support options, with pricing quoted after contacting enterprise sales with an expected seat count. Review the license terms against your expected user count before go-live, and see the editions topic for the full cost comparison.

What should we test before giving users access to models?

Test four things in a non-production environment. Confirm that each provider connection works and returns responses from the models you approved. Confirm that a user in each group sees only the models that group should use, and that a user outside the group sees none of them. Confirm that provider keys are not visible in the user interface, in API responses or in browser storage for non-admin accounts. Confirm that sign-out and key rotation behave as you expect in your chosen deployment. Keep the results as dated evidence, since your auditors or security reviewers may ask for them.

How DeployOpen scopes, builds and hands over provider connections

DeployOpen plans and builds Open WebUI with Ollama and OpenAI-compatible providers inside your own infrastructure, so you control which local and remote models users can reach. Each engagement starts from a written scope and ends with documented provider connections, routing rules and key handling that your team can review and run.

How we scope

  • We agree the written scope before work starts, listing which Ollama hosts and remote providers are in it.
  • We record which models each user group may reach and which models stay out of reach.
  • We confirm where provider keys will be stored and who in your organization owns rotation.
  • We identify whether Open WebUI will run as a single instance or several replicas, which changes the database and vector store choice.

How we build

  • We install Open WebUI by an official method agreed in scope, such as Docker Compose, Helm or pip.
  • We connect Ollama and OpenAI-compatible endpoints, and set provider keys server-side so end users never see them.
  • We configure model visibility by group and test that restricted models do not appear for unapproved users.
  • We check network paths from Open WebUI to each provider and document any egress rules your security team needs.

How we hand over

  • You receive a runbook covering each provider connection, its owner, its key location and its rotation steps.
  • You receive the group-to-model routing matrix, so access reviews can be repeated without us.
  • We walk your platform and security staff through adding a model, removing a provider and revoking a key.
  • Test results and configuration evidence are delivered in a form your compliance team can file.

How we support

  • Ongoing support, upgrades and continuous testing are available as a retainer after go-live.
  • Retainer scope, response expectations and service levels are written into the agreement, not assumed.
  • Where Open WebUI releases change provider settings, we test the change in a staging copy before production.
  • Ask us to confirm in the quote which provider changes, model additions and key rotations the retainer covers.

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.