Agent prototypes are only 20%; the remaining 80% is best done on a MacBook first
Google Cloud Tech splits Gemma 4 and the ADK Agent into two local services, drives the cloud bill to 0 on Apple Silicon, cuts reload from 20 seconds to 0.5 seconds, and then uses K=2, golden eval, and four promotion gates to push the prototype toward production. In the comments, someone asks about L4 in the Australia region, while someone else sees only the zero bill.
Building an Agent prototype is not slow; what is slow is the 80% of engineering work that comes after the prototype: evaluation, deployment, and verifying tool behavior. This Google Cloud Tech article offers a very concrete starting point: run Gemma 4 on a MacBook, develop the Agent locally, and keep cloud costs at 0. The authors, Pedro Melendez and Sergio Villani, used ADK to build a Cloud FinOps & GPU Capacity Advisor; all three tools are deterministic Python functions, and they first get the tool math right before talking about production.
The most common local development pitfall is stuffing the model weights into the same Python process as the Agent. Change one system instruction, restart the script, and Python reloads several GB of weights; 15 to 25 seconds are gone. The article splits them into two services: model_serving/gemma_server.py is a FastAPI model server with Gemma 4 resident in memory, exposing an OpenAI-compatible HTTP endpoint; app/agent.py is the Agent harness, which speaks HTTP directly through ADK's BaseLlm adapter. With the model running in another terminal, Agent reload drops from 20 seconds to under 0.5 seconds. General readers can think of it as separating the engine from the chassis: you don't have to lift the engine out every time you change the prompt. More importantly, this HTTP boundary matches the production boundary between the Cloud Run agent runtime and serverless model serving, so in Stage 2 you can switch to Gemma 4 MaaS by changing environment variables without rewriting code.
A MacBook can run it, but the math needs to be done carefully. On Apple Silicon, the CPU and Metal GPU share unified memory, avoiding PCIe transfers. Gemma 4 uses 4-bit quantization, about half a byte per parameter, cutting RAM requirements by roughly 4x; you also need to leave KV cache headroom, since the longer the conversation, the larger the cache. The article's example is gemma-4-26B-A4B-it: 26B total parameters, with MoE activating only 4B parameters per token, about 20.8GB of memory at 4-bit, including 14.3GB of weights plus 6.5GB of KV cache, at roughly 35 to 60 tokens/s. An 8GB Mac can run E2B/E4B, 16 to 18GB runs 12B 4-bit, 24 to 36GB runs 26B-A4B 4-bit, and 48GB or more runs 31B or bfloat16. Not every Mac is suited to forcing a large model onto it; this tiering is more useful than saying “Apple Silicon can run it.”
The article introduces a cost concept: Work Multiplier, K. One user request triggers one tool query, which behind the scenes involves at least two LLM calls: first select the tool, then use the tool result to write the answer, so K=2. If the prompt is broken, the model hesitates and calls three tools in a row, K may jump from 2 to 4, token cost roughly doubles, the backend request rate also doubles, and serving capacity is cut in half first. This math should be tested locally, not discovered only when the cloud bill arrives.
AgentOps is split into three stages: dev on a local Mac, with manual iteration, running pytest, golden eval, and K<=2 auditing; staging on Cloud Run, deploying a zero-traffic dark revision, using an independent LLM-as-a-judge to check accuracy and hallucinations, and then enforcing P95<=35s; main with a 10% canary, going fully live only after it is green. Four promotion gates are placed at local, PR CI, staging, and production canary respectively. The article also emphasizes data hygiene: development machines do not connect to production databases, the dev environment only allows synthetic_fixtures_only, and session state lives at memory://. For ordinary teams, this point is more practical than model parameters.
In the comments, someone asks that the Australia region has no GPU testing option such as NVIDIA L4; the article does not expand on regional availability, so the question remains open. Someone else says directly that the zero cloud bill is a great selling point. The zero cloud bill is the hook; what is truly useful is that it draws the boundary between local development and production in advance: model serving, Agent harness, evaluation data, and deployment gates are set up to look like production from day one. The full commands, workflow files, and test fixtures are in the companion repo linked by the article, under the subdirectory adk-gemma-agentops. Original article: https://x.com/i/article/2128567701639467008 Tweet: https://x.com/GoogleCloudTech/status/2128569858082123931
发布时间: 2026-12-04 11:36