Google AlloyDB ships proxy models for semantic queries—23,000x faster, 6,000x cheaper
Google announced general availability of AlloyDB AI functions, PostgreSQL-compatible database operations for semantic search, filtering, and ranking alongside a two-phase proxy model pattern that addresses the per-row LLM cost problem at scale. The proxy model inverts the typical database-to-LLM relationship: instead of calling an external model for every row decision, the database learns from a sample using a frontier model, then applies that judgment locally at database speed.
The architecture works in two phases. Phase 1: a PREPARE statement sends a data sample to a frontier model (e.g., Vertex AI) to train a lightweight local proxy. Phase 2: the query executes using the local proxy at database speed, with fallback to the frontier model if confidence is too low. For ai.if semantic filtering in preview, Google reports throughput of 100,000 rows per second with proxy models, compared to row-at-a-time processing of ~4 rows per second—a 23,000x improvement. The cost reduction reaches 6,000x by eliminating per-row API calls and prompt overhead.
The release also adds smart batching (GA for ai.if and ai.rank), grouping multiple rows into single model calls and delivering 2,400x throughput improvement over row-at-a-time. AlloyDB now includes ai.generate, ai.if, ai.rank, ai.forecast, ai.summarize, ai.agg_summarize, and ai.analyze_sentiment. A managed MCP server for AlloyDB lets agents query databases through Model Context Protocol without teams running custom infrastructure.
For platform teams, the distillation-at-query-time pattern is architecturally significant. It applies beyond AlloyDB: any database calling external models per-row faces the same cost and latency wall. AlloyDB positions itself as a PostgreSQL-compatible database where structured queries, semantic search, vector search (up to 10 billion vectors via ScaNN), and LLM-powered analysis coexist. Note: the 23,000x and 6,000x figures are from internal testing of ai.if in preview. Run benchmarks on your own data before committing to production.