AlloyDB Ships Proxy Models That Replace LLM Calls with Local Inference Inside the Database
Summary
Google announced the general availability of AlloyDB AI functions on July 9, 2026, enabling direct LLM calls within standard SQL queries for tasks like text generation, semantic filtering, and sentiment analysis. To address the scalability and cost issues of per-row LLM calls, AlloyDB introduces two acceleration techniques. Smart batching, now generally available for ai.if and ai.rank, groups multiple rows into a single model call, achieving a 2,400x throughput improvement, processing up to 10,000 rows per second. More significantly, the optimized proxy model, currently in preview for ai.if, uses a two-phase process: a PREPARE statement trains a lightweight local model from a frontier LLM using sample data, and an EXECUTE statement then runs queries locally. This approach delivers a 23,000x throughput increase, reaching 100,000 rows per second, and a 6,000x cost reduction, effectively turning the LLM into a teacher rather than a runtime dependency.
Key takeaway
For AI Engineers and MLOps teams integrating LLMs with databases, AlloyDB's proxy model architecture offers a compelling path to reduce inference costs and latency. If evaluating database-integrated AI functions, benchmark AlloyDB's ai.if proxy model with your data and query patterns, especially for high-volume semantic filtering. Start with read-heavy workflows and track model costs distinctly from standard query costs to manage operational expenses effectively.
Key insights
AlloyDB's proxy models invert LLM interaction, enabling local inference for massive cost and throughput gains.
Principles
- Distill frontier LLM knowledge into local models.
- Batching significantly reduces LLM round trips.
- LLMs can serve as teachers, not just runtime dependencies.
Method
AlloyDB's proxy model uses a PREPARE statement to train a local model from a frontier LLM using sample data, then an EXECUTE statement runs queries locally, falling back to the frontier model if confidence is low.
In practice
- Benchmark AI functions with your own data.
- Start with read-heavy review workflows.
- Track model costs separately from query costs.
Topics
- AlloyDB
- LLM Inference
- Proxy Models
- Smart Batching
- SQL AI Functions
- Cost Optimization
- Semantic Filtering
Best for: Machine Learning Engineer, CTO, AI Architect, AI Engineer, MLOps Engineer, Data Engineer
Related on AIssential
Editorial summary, takeaway, and curation by AIssential. Original article published by InfoQ.