Data + AI Anywhere: AlloyDB Omni integration with local models
Google's AlloyDB Omni can now call local models such as Gemma 4 and Qwen3.8 straight from SQL, keeping prompts and data inside air-gapped or on-prem setups.
By Dillip Chowdary • Nov 28, 2026 • Source: Google Cloud Blog

At a glance
- Product
- AlloyDB Omni local model integration
- Announced
- November 24, 2026
- Local models
- Gemma 4, Qwen3.8
- Database version
- 18.4.0 (walkthrough)
- Operator version
- 1.9.0
- SQL function
- ai.generate
In this post
Google Cloud's AlloyDB Omni, the downloadable, PostgreSQL-compatible edition of AlloyDB, now integrates with locally hosted large language models such as Gemma 4 and Qwen3.8, according to Google Cloud's post on AlloyDB Omni and local models from November 24, 2026. The database can call a local model server directly from SQL, so prompts, data and responses stay inside the user's own environment.
This piece covers what the integration does, why Google pitches it for air-gapped and data-locality setups, and the five-step Kubernetes deployment Rob Yavitch, Senior Software Engineering Manager for AlloyDB Omni, laid out. It is aimed at database and platform teams who want AI features on on-premises data without sending that data to a cloud model.
01Built-in AI in a run-anywhere AlloyDB
Google describes AlloyDB Omni as a 100% PostgreSQL-compatible database that runs anywhere: in the cloud, in a datacenter or on a laptop. It deploys to a team's own infrastructure, including on-premises, under the "Data + AI Anywhere" banner.
The edition ships with built-in AI, including the same ScaNN indexing technology that powers Google Search. Paired with a model, AlloyDB Omni can store vector embeddings at scale, search them semantically and query the database in natural language. Users can choose a frontier cloud-hosted model such as Gemini or a local model, and local hosting keeps full control of the data environment.
02Gemma 4 and Qwen3.8 called from SQL
AlloyDB Omni can now connect to local models such as Gemma 4 from Google DeepMind and Qwen3.8, and Google says the architecture is the same whichever model is chosen. The database calls the local model server directly from SQL.
Google pitches three gains. Because the database and model sit in the same local environment, data never crosses the public internet; local inference cuts network transit time; and standard SQL queries can invoke machine learning functions that process data locally.
SELECT customer_name,
ai.generate('Summarize in 1 short sentence: ' || comment,
model_id => 'gemma4_llm') AS summary
FROM customer_feedback;In Google's example, that query turned a customer comment from Alice into "The customer demands a refund for a double charge or they will cancel" and one from Bob into "The user likes the product but requests dark mode support."
03Air-gapped networks and data locality
Advertisement
Tech Pulse Daily
Get tomorrow's pulse first
Join engineers who read Tech Pulse before stand-up. Free, weekday mornings.
Google says the setup opens use cases for environments that were previously blocked from adopting agentic capabilities. Teams running air-gapped networks or working under data locality requirements can still build intelligent applications.
The examples Google gives are analyzing local logs, generating summaries of proprietary internal documents and powering localized chatbots, all while keeping strict data governance.
04Five-step deployment on GKE
The walkthrough uses Google Kubernetes Engine for a standardized, reproducible environment, though Google says the same setup works on-premises or almost anywhere. It assumes an existing GKE cluster plus kubectl and Helm. Google says the AlloyDB Omni Kubernetes operator makes deploying and maintaining the database simple.
- Deploy the operator Install cert-manager v1.21.3 with Helm, then the AlloyDB Omni Kubernetes operator version 1.9.0 into the alloydb-omni-system namespace.
- Create the database Apply a DBCluster named my-omni in an ai-demo namespace with databaseVersion 18.4.0, 2 CPUs, 4Gi memory, a 20Gi data disk and the googleMLExtension feature enabled.
- Deploy the model Run Ollama as a Kubernetes Deployment on port 11434, requesting 4 CPUs and 16Gi of memory (24Gi for Qwen3.8), pulling gemma4:12b or qwen3.8 onto a 30Gi volume.
- Register the model Connect with psql, enable the google_ml_integration extension, raise the request timeout to 600 seconds, and register the model with google_ml.create_model.
- Query it Create a customer_feedback table, insert sample comments and call ai.generate from the SQL client.
The Ollama deployment sets OLLAMA_KEEP_ALIVE to -1 to keep the model in RAM and OLLAMA_LOAD_TIMEOUT to 20m. The database is exposed through an internal GKE load balancer, and its admin password is stored in a Kubernetes Secret named db-pw-my-omni. Switching the example from Gemma 4 to Qwen3.8 means changing a few commented lines in the Ollama manifest.
Note: Google says a connection error right after setup may mean the database is still provisioning, and a "Resource not found" error may mean the model is still loading; in both cases, waiting a moment fixes it.
05Model registration and output transforms
Registration uses google_ml.create_model with model_id gemma4_llm (or qwen3_8_llm), a model_request_url pointing at the in-cluster Ollama service's /v1/chat/completions endpoint, model_provider set to custom and model_type set to llm. Two SQL functions translate between the database and the model server.
Before registering, the script runs ALTER SYSTEM to set google_ml_integration.request_timeout_in_seconds to 600 and calls pg_reload_conf() to apply it. The psql session itself is opened with kubectl exec into the database container of the AlloyDB Omni pod, logging in as the postgres user.
The input transform, google_ml.ollama_llm_input_transform, maps gemma4_llm to gemma4:12b and qwen3_8_llm to qwen3.8, and builds a system message (defaulting to "You are a helpful assistant.") plus the user prompt. The output transform, google_ml.ollama_llm_output_transform, reads the first choice's message content.
That output transform also strips chain-of-thought reasoning that the model returns inside think tags, since the example does not want it in query results. Google closes by pointing teams to AlloyDB Omni's other features, including fast vector search and built-in AI functions.
Frequently asked questions
Can AlloyDB Omni use local LLMs?
Yes. Google said on November 24, 2026 that AlloyDB Omni now integrates with locally hosted models such as Gemma 4 and Qwen3.8, calling the local model server directly from SQL.
How do you call a local model from SQL in AlloyDB Omni?
After registering the model with google_ml.create_model, queries call ai.generate with a prompt and a model_id such as gemma4_llm. Google's example summarizes each row of a customer_feedback table in one sentence.
What does the AlloyDB Omni local model setup need?
Google's walkthrough uses a GKE cluster with kubectl and Helm, the AlloyDB Omni Kubernetes operator 1.9.0, a database with googleMLExtension enabled, and Ollama serving gemma4:12b or qwen3.8.
Why run AlloyDB Omni with a local model?
Keeping the database and model in the same environment means data never crosses the public internet and network transit time drops. Google says this suits air-gapped networks and data locality requirements.
Sources
Author
Dillip Chowdary
Writes Tech Bytes coverage of AI, engineering, and the tools that actually ship. Editor of Tech Pulse Daily.
Related on Tech Bytes
Electric boat maker Zin Boats raises $5M and launches propulsion business beyond the water
Read →
Hex Package Manager Warns of Potential Data Breach
Read →
Most Unicorns Are Worth More Than Their Last Funding-Round Valuations, Crunchbase…
Read →
Run local models in your .NET apps with Llama on Windows
Read →
Today's Tech Pulse briefing
Full briefing →
Advertisement