Gemini on premise and open-source Gemini alternatives

The closest self-hosted routes are Gemini on Google Distributed Cloud for Google's own models in your facility, and open-weight Gemma models served with vLLM or run with Ollama behind Open WebUI. The main trade-off is control over data and location in exchange for owning hardware, upgrades, security and model quality.

On this page

Which self-hosted route replaces the Gemini API inside our perimeter?

A team that cannot send patient, student or EU personal data to Google's hosted Gemini API or Workspace services has three realistic self-hosted routes: Gemini on Google Distributed Cloud, open-weight Gemma models served with vLLM or Ollama, and Open WebUI as the chat layer on top. The main trade-off is that the first route is a Google product you buy and operate in your own facility, while the second is open software you run yourself, so the work of hardware, patching, access control and logging moves in-house either way. Gemini itself is not released as open weights. That means the open route is Gemma, and the on-premises route is Google's own product, and neither is a drop-in copy of the hosted API. Before choosing, test the task: run your real prompts, documents and summarization or extraction jobs against the candidate model and measure whether output quality is acceptable to the people who will rely on it.

Confirm three things with Google and within your environment before committing. For Gemini on Google Distributed Cloud, ask which Gemini models are generally available in the air-gapped offering and which are only in preview for the connected offering, since the August 28, 2025 announcement distinguished these. For Gemma, read the Gemma Terms of Use and the license page for the specific model version you plan to run, because the terms allow use and distribution subject to a Prohibited Use Policy and newer releases may carry a different license. For vLLM, Ollama and Open WebUI, confirm the license of each component you deploy, including Open WebUI's branding requirement, and record which of them receive updates in your patch cycle. Gemini CLI is a separate case: its code is Apache 2.0 and self-hostable, but inference still goes to Google unless you change the backend, so it does not keep prompts inside your perimeter by itself.

Assign ownership before the pilot starts. Someone must own GPU capacity, model updates, the inference endpoint, user authentication, audit logs of prompts if your policy requires them, and retention of conversation history in Open WebUI. The cost is mostly one-time procurement of accelerators and setup, followed by recurring staff time, power, support contracts and refresh cycles, and these rise with concurrent users, context length and model size. Ask any implementation partner for a fixed written scope covering hardware sizing, security configuration, backup and a retest plan, and ask Google for a written quote for the Distributed Cloud route that lists what is included and what is billed separately. Record each decision in the data protection impact assessment or HIPAA risk analysis your organization already maintains, so the self-hosted route is reviewed like any other system that handles personal data.

License terms for each self-hosted component

This table compares the license for each self-hosted component an organization might run instead of the Gemini API, including Gemma, vLLM, Ollama, Open WebUI and Gemini CLI. Read the license column first, then check the last column to see whether inference stays inside your perimeter. Only Gemma, vLLM, Ollama and Open WebUI can run with no call to a Google service, and Gemini CLI still sends inference to Google.

ComponentLicense and termsWhat it allowsWhat it restricts or requiresRuns fully inside your infrastructure
Gemma modelsGemma Terms of Use (last modified April 1, 2026); Gemma 4 is linked to a separate page with the Apache License 2.0 textUse, modification and distribution of the model weights under the Gemma termsCompliance with the Prohibited Use Policy; confirm which license applies to the specific Gemma version you deployYes
vLLMApache-2.0Commercial use, modification and redistribution with a patent grant and notice requirementsKeep the license and notice files when you redistribute; the model you serve carries its own licenseYes
OllamaMITUse, copy, modify and distribute with a short notice requirementKeep the copyright and permission notice; the models you pull through Ollama each carry their own termsYes
Open WebUIOpen WebUI License, which requires preserving its brandingSelf-hosted chat interface that connects to Ollama and OpenAI-compatible APIs, designed to run offlineKeep the branding as the license requires; have legal confirm the branding terms fit your internal useYes
Gemini CLIApache 2.0 for the source codeSelf-hosting and modifying the code under Apache 2.0Requires Google authentication through a Google account, a Gemini API key or Vertex AI, so inference runs on Google's serviceNo

Which self-hosted option fits which situation

A pilot on one workstation or single server is the quickest way to test whether an open-weight model handles the work your staff need, while prompts stay on a host you control. Ollama, licensed MIT, runs open-weight models locally, and Gemma 4 starts with the command ollama run gemma4. This setup suits a small group of testers evaluating output quality, ideally with synthetic or de-identified records, rather than production patient or student data.

  • Data boundary: prompts stay on the host, so you can confine the pilot to one network segment and one approved group of testers.
  • Licensing: Gemma 4 is linked to a separate license page that contains the Apache License 2.0 text; confirm the license of every other Gemma version you pull.
  • Controls you must add: the pilot has no built-in multi-user access control, central audit logging or single sign-on, so you need to supply these before wider use.
  • Capacity: one machine limits concurrent users and the model sizes you can run, so pilot results will not predict performance at organizational scale.
  • Operations: your team owns patching, backups and incident response for the host.

Before the pilot grows, confirm who approves the host, which data classes are excluded and what evidence the pilot produces for your security review.

How the self-hosted stack fits together

The diagram starts with a staff member's browser connecting to Open WebUI inside the organization's network. Open WebUI hands requests to either Ollama or a vLLM server, and both load Gemma model weights stored on the organization's own hardware, so prompts and responses stay in that perimeter. The lower branch shows Gemini CLI, which is self-hostable as code but still authenticates through Google and sends inference to Google's service, so that path leaves the perimeter. Before approving either path, confirm which endpoints each component calls and who controls the hardware running the weights.

Self-hosted Gemma path inside the perimeter, with the Gemini CLI path leaving it.

What the license fee leaves you to pay for and run

Most open-weight models and serving tools carry no license fee, but the hardware, people and controls around them do. Cost and risk sit in the parts a team must buy, staff and keep running, and several of them recur for as long as the system stays in service.

GPU or CPU hardware

Hardware is usually the largest one-time purchase and the first cost that determines what models you can serve. Google's on-premises announcement names NVIDIA Blackwell systems, including DGX B200 and HGX B200 systems available from Dell, and vLLM runs on NVIDIA, AMD and Intel GPUs as well as CPUs. No sizing figures are supplied here, so request a written sizing for your target models, concurrency and context length from the vendor or integrator before approving a budget. Ask whether the quote covers power, cooling and rack space, which recur.

Google on-prem announcement

Staff to operate serving and chat

Running an inference server and a chat interface is ongoing operational work: monitoring GPU load, handling failed requests, patching containers and answering user tickets. Open-source projects publish releases on their own schedules, so someone must own the stack after go-live. Ask who on your team or your partner's team carries this on-call duty, how many hours per week it needs in your environment, and whether that role is funded as a recurring cost.

Upgrades and model swaps

Open-weight models and serving versions change often, and each change can alter output quality, memory use and compatibility with the chat front end. A model swap is a retest, not a file copy. Plan for a staging environment, a regression set of your own prompts and a rollback path. Ask whether upgrades are in a fixed-scope engagement or a recurring retainer, and who approves a change that affects data handling.

Security hardening and access control

Self-hosting moves the vendor's controls into your hands. Open WebUI and Ollama need SSO integration, role-based access, network restriction and secrets handling configured and tested, and the Gemma Terms of Use add a Prohibited Use Policy you must enforce internally. Testing before and after rollout is a one-time cost, but permissions review recurs with each new user group. Confirm who signs off on access to patient or student data.

Backup, logging and retention

Prompts, uploads and chat histories are your records once they stay inside your perimeter, so backup and audit logging become your obligations. Define retention periods, deletion procedures for data subject requests and log storage sizes before launch, and test a restore. Unlike a hosted Gemini product, no vendor retention default applies to you, so the retention policy is one you must write, implement and keep running.

Paid Gemini on Google Distributed Cloud

If you choose Google's own on-premises route, the fee covers Google's Gemini models on Google Distributed Cloud, with the terms, support and hardware arrangements set in your contract. Google announced general availability of Gemini on Google Distributed Cloud air-gapped and a preview of the connected version on August 28, 2025, so confirm which variant and which models your contract covers. Ask for the fee structure, whether it is recurring or licensed per period, what hardware is included, and who operates the environment day to day.

Gemini availability post

What drives total cost of ownership beyond the license

This table lists the cost drivers that appear once a team runs Gemini-class or open-weight models inside its own perimeter, showing who is paid, whether each cost is one-time or recurring, and what moves it up or down. Use it to structure written quote requests to Google, hardware resellers, integrators and support providers, since no figures for these items are published here. The main takeaway is that the license or model weights are often the smallest line, while accelerators, staffing and retesting recur for as long as the system runs.

DriverWho is paid or what it consumesOne-time or recurringWhat raises or lowers it
Hardware and accelerator availabilityHardware vendor or reseller for GPU or accelerator systems; data center or facility provider for power and coolingOne-time purchase or lease, plus recurring power and facility costsAccelerator generation, lead times, and whether the chosen hardware is on the vendor's supported list for the model. Confirm the supported configurations in writing before buying.
Concurrent users and peak loadConsumes accelerator capacity and cluster sizingRecurring as headcount and usage growMore simultaneous sessions and longer prompts require more capacity. Ask for sizing based on your own peak concurrency, not average use.
Model size selectedConsumes memory and compute on each serving nodeRecurring, through hardware and powerLarger models need more accelerator memory and slower throughput. Smaller models may suit narrow tasks; test quality before committing to a size.
Google Distributed Cloud support and subscriptionGoogle, for the on-premises Gemini offering and its support tierRecurring, usually under a contract termSupport level, number of environments, and whether connected or air-gapped deployment is chosen. Request the written scope and what is excluded.
Open-source software operationsInternal platform or DevOps staff, or an implementation partner, for vLLM, Ollama, Open WebUI or similar componentsInitial setup is one-time; upkeep is recurringNumber of components, hardening requirements, SSO and audit logging needs, and how many versions must be supported at once.
Staff time for upgradesInternal engineers or a retained partner; the cost is internal time rather than a feeRecurring with each release of serving software, model or chat interfaceFrequency of upstream releases, change control rules, and the depth of testing required before production rollout.
Retesting after license or model changesInternal security and compliance staff, or a security testing providerRecurring with each model swap, license revision or major configuration changeChanges to Gemma license terms, switching to a different Gemma or Gemini model version, and any change to access controls or logging. Keep a written list of triggers.
Evidence and documentation for assessorsInternal compliance staff or an external assessorRecurring for each review cycleDepth of configuration records, logging and data handling documentation. Agree with your assessor which evidence they expect before the system goes live.

What the Gemma terms and open-source licenses require of us

Gemma weights, Gemini CLI, vLLM, Ollama and Open WebUI each arrive under different terms, and none of them removes the obligation to keep notices and review use. The cards below separate what each license lets the organization do from what it must keep, check and confirm before a self-hosted deployment reaches users or customers.

Gemma Terms of Use obligations

The Gemma Terms of Use allow use, modification and distribution of Gemma models, but only subject to the Prohibited Use Policy. Your internal deployment has to fit that policy for every use case your staff or products will run, not only the first pilot. Record which use cases you approved, who reviews new ones, and what happens when a team wants to fine-tune or redistribute a model. Confirm the current version of the terms before approval, since the page was last modified on April 1, 2026.

Gemma terms

Gemma 4 Apache 2.0 license

The Gemma docs link Gemma 4 to a separate license page that contains the Apache License 2.0 text, so Gemma 4 may fall under different terms from earlier Gemma releases. Check the license attached to the exact model file you download, not only the Gemma family terms. Keep the license and any notice files with the model artifacts in your registry, because the notice obligations travel with redistribution. Ask counsel whether a model version under the Gemma terms and one under Apache 2.0 can sit side by side in one internal catalog.

Apache 2.0 text

Apache 2.0 for vLLM and Gemini CLI

vLLM and Gemini CLI are both licensed under Apache-2.0, which permits internal use and modification with conditions such as keeping the license text and notices. The serving stack is the component that handles prompts and responses on your hardware, so its patches and forks become part of your security baseline. Track which vLLM version you run and record any local changes. Gemini CLI is self-hostable as code, but it still requires Google authentication, a Gemini API key or Vertex AI for inference, so the license alone does not keep data inside your perimeter.

vLLM repository

MIT terms for Ollama

Ollama is licensed under MIT, which is one of the most permissive open-source licenses. Its conditions are mainly to keep the copyright and permission notice in copies or substantial portions of the software. The license does not say anything about the model weights you pull through Ollama, so each model needs its own license review. Confirm that the Ollama binary and any packaged images in your environment carry the notice, and check the model license for every model you pull, including Gemma 4, before giving staff access.

Ollama repository

Open WebUI branding requirement

Open WebUI is released under the Open WebUI License, which requires that its branding be preserved. This is different from a standard permissive license, so an internal rebrand or a white-label chat front end for customers may breach the terms. Decide whether staff will see the Open WebUI name and logo before rollout, and ask counsel whether a customer-facing deployment counts as distribution. Keep the license file in your configuration repository so the requirement is visible to whoever changes the interface later.

Open WebUI repository

Distribution to customers and counsel review

Internal use of these licenses is usually simpler than giving a model, container image or chat interface to customers or partners. Distribution can trigger notice, source and branding duties under Apache 2.0, MIT and the Open WebUI License, and the Gemma terms add the Prohibited Use Policy to downstream users. Write down whether any product you ship includes these components, and have counsel confirm how distribution to customers would be treated before you promise the stack to them. Ask for a written list of every model and component with its license version.

Gemma terms

Where the open stack falls short of the hosted Gemini products

The open stack gives you control over where inference runs, but it does not give you the same model. Gemma is an open-weight model family. It is not the Gemini 2.5 Flash and Pro models that Google offers through its hosted products and on Google Distributed Cloud. Output quality, context length handling, multimodal input, and tool or function calling can differ from the Gemini models, and the gap depends on your tasks. Before approval, run a fixed test set drawn from real workflows (clinical summaries, student feedback, customer correspondence, or whatever your staff will use the tool for), score the outputs with your own reviewers, and record which tasks fall below the bar. Do not assume parity from benchmark claims or from the Gemini name.

The Workspace features are the largest gap. Gemini in Gmail, Docs, Sheets and Meet is delivered inside Google's own applications and under the Workspace terms, and the facts supplied for this topic do not identify an open-source equivalent that sits inside those applications. If staff rely on those features, the self-hosted route means building or buying a replacement, with its own mailbox access, permissions, audit logging and user experience. Confirm with your platform team whether the open chat interface can meet the workflow, or whether the Workspace features stay on the hosted side under their own BAA, DPA and data region settings, which are covered elsewhere on this page.

Gemini CLI is open source under Apache 2.0, so you can inspect and host its code. It still needs Google authentication through a Google account, a Gemini API key, or Vertex AI, and inference still runs on Google's service. Self-hosting the CLI therefore does not keep prompts inside your perimeter. Treat it as a hosted Gemini client, and apply the terms that govern the account or key it uses. Before approval, ask each capability question in writing: model parity on your tasks, Workspace feature coverage, tool use, multimodal support, and where inference runs for every component in the stack.

Approval checklist before choosing a self-hosted Gemini route

This sequence turns the choice between Google's on-premises Gemini, open-weight Gemma models and an open-source serving stack into a documented decision with licensing, hardware, user, quality, exit and operating evidence that a security or compliance reviewer can sign off on. It runs in the order the decisions depend on each other, so each step's output feeds the next.

  1. Confirm which model family you actually need

    The platform owner and the business sponsor name the tasks the tool must perform, then choose between Gemini models on Google Distributed Cloud (air-gapped or connected), Gemma models you run yourself, or another open-weight model. Google's August 28, 2025 announcement lists Gemini 2.5 Flash and Pro, Vertex AI task-specific models and Gemma models as available on Gemini on GDC air-gapped, and a connected preview. Done when a written model shortlist exists and each entry names its deployment route and the data classes it will touch.

  2. Read the license for the exact model version

    Legal or procurement reads the Gemma Terms of Use and the Apache License 2.0 text that Google links for Gemma 4, and records the version and date of each document. The Gemma terms allow use, modification and distribution subject to a Prohibited Use Policy, so counsel should confirm which license applies to each model in the shortlist and what notices or redistribution duties follow. Done when a license register lists each model, its governing terms, the version checked and the reviewer's sign-off.

  3. Confirm the license of every serving and chat component

    The engineering lead lists each component in the stack, such as the model server, the local runtime, the chat interface and any gateway, and checks its license against the project repository. Examples in the reference set include vLLM under Apache-2.0, Ollama under MIT and Open WebUI under its own license that requires preserving branding. Done when each component has a recorded license, any branding or attribution obligation is assigned to a named owner, and the Gemini CLI route is marked separately because it still authenticates to Google's service for inference.

  4. Confirm hardware and accelerator support in writing

    The infrastructure team asks the model vendor, the hardware supplier and the serving project to state in writing which GPUs, CPUs, TPUs or other accelerators the chosen model and server support, along with the memory and networking they need. Google's April 9, 2025 announcement describes running Gemini on NVIDIA Blackwell systems, with DGX B200 and HGX B200 systems available from Dell, so ask for that configuration in writing if it is in scope. Done when a signed or dated support statement covers every model and server pair, and the capacity plan shows the hardware is on order or in the data center.

  5. Define users, data classes and logging needs

    The security and privacy leads list which groups may use the system, which data classes are allowed (for example, patient records, student records or EU personal data), and which prompts, responses and administrative actions must be logged and for how long. They also confirm that SSO, access control and audit logging exist for the chat layer, since the self-hosted interface does not inherit controls from a cloud product. Done when an approved user population, a data classification rule and a logging specification are written down and reviewed by compliance.

  6. Test output quality on your own tasks

    The business owners run a fixed set of real internal tasks, such as summarizing clinical notes, drafting student communications or classifying customer requests, through each shortlisted model and compare the results against a reviewed baseline. Record accuracy, failure modes and any output that would be unsafe to act on without human review. Done when the test set, scoring rules and results are stored with a decision on which model meets the bar for each task, and tasks that fail are removed from scope.

  7. Document the exit path to another model

    The architecture owner describes how the chat layer, prompts, logs and integrations would move to a different model or server if the chosen model's license changes, a version is withdrawn or the hardware becomes unavailable. Because the serving layer usually exposes an OpenAI-compatible interface, note which application code depends on it and which depends on a specific model. Done when the exit plan names the components to replace, the data to export and the owner who signs off on the switch.

  8. Assign who patches and monitors after go-live

    The operations lead names the team that applies security updates to the operating system, the serving software, the chat interface and the models, monitors availability and watches for misuse or data exposure in the logs. Confirm who receives vulnerability notices for each open-source component and who approves a model change. Done when a written responsibility matrix, an on-call route and a patch cadence agreed with the security team are filed with the approval record.

Questions buyers ask before self-hosting a Gemini-class model

Can we use Gemma commercially under the Gemma Terms of Use?

The Gemma Terms of Use allow use, modification and distribution, subject to a Prohibited Use Policy, so commercial use is permitted on the terms' face. The Gemma documentation also links Gemma 4 to a separate license page that contains the Apache License 2.0 text, which means the license that applies depends on the model version you pick. Check the exact model card and license for each Gemma release you plan to deploy, record which terms you accepted, and have your counsel confirm that your intended use, redistribution and any customer-facing product fit both the Prohibited Use Policy and the license attached to that version. The terms were last modified on April 1, 2026, so confirm you are reading the current version when you approve the model.

How much effort and staff time does self-hosting a model take?

Effort depends on how many users you serve, how fast responses must be, and how many controls you must evidence. A pilot on a single machine with Ollama and Open WebUI is a small task, while a production service adds GPU capacity planning, a serving layer such as vLLM, identity integration, logging, patching, backups and capacity monitoring. The main recurring costs are hardware or cloud GPU time, the staff who run and patch the stack, and re-testing when you change models or upgrade the serving software. Ask any vendor or partner for a written scope listing the hardware, the environments, the controls and the support hours before you compare totals, because the same model can cost very different amounts to run depending on those choices.

Can our own team self-host a model without outside help?

A small team can usually run a pilot alone. Ollama runs open-weight models locally, including Gemma 4 with the command ollama run gemma4, and Open WebUI provides a self-hosted chat interface that connects to Ollama and to OpenAI-compatible APIs. That is enough to test quality and workflows with non-production data. Moving to production usually needs planned staffing for GPU operations, a multi-user serving layer such as vLLM, single sign-on, access control, audit logging, backup and incident response. Name the owner for each of those duties before you go live, and treat any decision to expose the service to patient, student or EU personal data as a security review item.

Does Gemini CLI keep our code and prompts inside our perimeter?

No. Gemini CLI is open source under Apache 2.0, so you can inspect and modify its code, but it requires Google authentication through a Google account, a Gemini API key or Vertex AI. Inference still runs on Google's service, so prompts and code sent through the tool leave your network. Self-hosting the client code does not change where the model runs. If your requirement is that prompts never leave your environment, use a self-hosted serving stack such as vLLM or Ollama with an open-weight model, and confirm with your security and privacy team which Google terms apply to any Google-hosted route you keep.

What does Google's air-gapped on-premises Gemini product require?

Google announced general availability of Gemini on Google Distributed Cloud air-gapped and a preview of Gemini on GDC connected on August 28, 2025. The announcement listed Gemini 2.5 Flash and Pro, Vertex AI task-specific models and Gemma models. Google also said it partnered with NVIDIA to run Gemini on NVIDIA Blackwell systems, with NVIDIA quoting DGX B200 and HGX B200 systems available from Dell. Deployment is handled through a formal engagement with Google and dedicated hardware, so the scope, hardware, support terms and pricing are set by Google's commercial team. Ask Google in writing which models, hardware generations, update cadence, support obligations and data handling terms apply to your deployment before you plan a budget or timeline.

What does a DeployOpen engagement cover for a self-hosted model?

DeployOpen plans, implements, hardens, backs up, documents and supports self-hosted open-source platforms inside your own cloud accounts, data centers or air-gapped networks. For a self-hosted Gemma or other open-weight stack, that can include deploying the serving layer and chat interface, adding single sign-on, access control and audit logging, and preparing the documentation your compliance team needs to review. DeployOpen also runs security testing of AI systems, including prompt injection and data exposure checks, and can prepare evidence for compliance assessments. DeployOpen does not issue audit reports or certifications. Engagements are fixed-scope, with deliverables and timelines agreed in writing before work starts, and ongoing support or continuous testing is available as a retainer. Pricing follows from the written scope.

How DeployOpen helps teams run AI tools in their own infrastructure

DeployOpen plans, implements and hardens self-hosted open-source platforms inside the client's own cloud accounts, data centers or air-gapped networks. For Gemini on premise and open-source Gemini alternatives, we start from the data your staff would send, then agree a written scope before any build work begins.

How we scope

  • Written scope lists which data classes, staff groups and use cases the self-hosted model may serve
  • Scope names the hardware, cloud accounts or air-gapped network where inference and chat will run
  • Engagements are fixed-scope, with deliverables and timelines agreed in writing before work starts

How we build

  • Deploy an open-weight model such as Gemma with a serving layer like vLLM inside your perimeter
  • Connect a chat interface such as Open WebUI to your identity provider with access control and audit logging
  • Test prompt handling, access permissions, data exposure and admin settings before users receive access

How we hand over

  • Documentation covers architecture, data flows, configuration and the controls your compliance team will review
  • Evidence packages map the deployment to the controls your auditors or certification bodies ask about
  • Findings reports include fixes and a retest, so your security team can verify each remediation

How we support

  • Ongoing support, upgrades, backups and continuous testing are available as retainers after handover
  • Model and serving software upgrades are reviewed and tested in your environment before rollout
  • Support scope and retainer terms are set in writing, so your team knows who maintains each component

Sources and further reading

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.