Google's Antigravity SDK Lets Gemma 4 Run Agent Workflows Without the Cloud
Google's Antigravity SDK now runs agentic workflows entirely offline using Gemma 4 26B and LiteRT, with hybrid cloud-local orchestration for privacy-sensitive code.
- Antigravity SDK now runs agents fully offline with Gemma 4 26B and LiteRT.
- Install with
pip install google-antigravity litert-lm; recommended 24GB+ VRAM or unified memory. - Supports OpenAI-compatible endpoints: Ollama, LM Studio, llama.cpp, vLLM as drop-in backends.
- Architect-Builder pattern: cloud Gemini plans, local Gemma swarm executes without exposing source code.
- Demo: 97.2% of 3,322 tokens ran locally while patching vulnerable Python modules end to end.
- Python SDK repo exposes workspace and policy hooks for safe file access.
Google’s Antigravity SDK adds local agent execution
Google has added local model execution to its Antigravity SDK docs, allowing agent workflows to run without cloud inference after developers download the required packages and model weights. The SDK uses Gemma 4 26B A4B as its default local model and Google AI Edge’s LiteRT as the on-device runtime.
An agent workflow repeatedly sends prompts to a model, invokes tools, evaluates results, and decides what to do next. Running that loop locally can keep source code and prompts on the device, remove per-token API charges, and support environments with limited connectivity. Tools that call remote services can still transmit data, so offline inference does not automatically make every part of an agent offline.
One agent loop, two runtimes
The initial integration runs Gemma 4 26B A4B directly through LiteRT. Antigravity can also connect to an OpenAI-compatible server, allowing developers to use Ollama, LM Studio, or vLLM without replacing the surrounding agent loop, tools, and policies.
| Backend | How it runs | Best fit |
|---|---|---|
| LiteRT | Loads the supported Gemma model through Google’s on-device runtime | Direct local deployment with the documented default model |
| OpenAI-compatible server | Connects Antigravity to a separately managed inference endpoint | Existing Ollama, LM Studio, llama.cpp, or vLLM installations |
OpenAI API compatibility covers the connection layer, while model behavior and tool-calling reliability still depend on the selected model, prompt format, and server implementation. Teams should rerun tool-use and policy tests whenever they change backends.
Setup and hardware budget
Google recommends more than 24GB of VRAM or unified memory for the default model. Available memory must also accommodate the runtime, context cache, tool processes, and any concurrent agents, so workflows with several local workers may require additional capacity.
The following POSIX shell commands create an environment, install the packages, and import the model from Hugging Face:
python -m venv .venv
source .venv/bin/activate
python -m pip install google-antigravity litert-lm
litert-lm import \
--from-huggingface-repo=litert-community/gemma-4-26B-A4B-it-litert-lm \
gemma-4-26B-A4B-it-gpu.litertlm \
gemma4-26bAfter the import completes, developers point a LiteRTAgentConfig at the resulting model file and pass that configuration to an Agent context manager. The agent returns generated tokens asynchronously, which lets an application update its interface or process tool requests while inference continues.
Antigravity scopes file-system tools to a configured workspace and exposes a policy hook for approving operations. That boundary limits the SDK’s file tools; stronger controls over subprocesses, network access, and operating-system resources require separate sandboxing.
Local execution changes the constraints
| Concern | Local execution | Remaining consideration |
|---|---|---|
| Cost | Avoids per-token inference fees and service rate limits | Hardware, power, and maintenance still carry costs |
| Data handling | Can keep prompts, code, and model outputs on the machine | Remote tools, telemetry, and hybrid planners need separate review |
| Connectivity | Can run after packages and weights are available locally | Installation, updates, and external tools may need a network |
| Performance | Avoids network latency and cloud queues | Generation speed depends on local memory bandwidth and compute |
Split planning from code access
Google’s proposed “Architect-Builder” pattern assigns planning to a cloud model and code-intensive work to local agents. In the published demo, Gemini 3.8 Flash decomposes the task using filenames and task descriptions, while local Gemma 4 26B instances inspect, patch, and test three vulnerable Python modules covering authentication, billing, and database access.
- The cloud planner receives task metadata, selects a strategy, and delegates bounded jobs without receiving source files.
- Local agents reproduce vulnerabilities, draft patches, critique proposed changes, and run regression tests.
- The orchestrator collects the local results and determines whether another audit cycle is required.
The recorded run used 95 cloud tokens for planning and 3,322 local tokens for implementation and verification. Local inference therefore accounted for 97.2% of the tokens, while filenames and task descriptions were the only project information sent to the cloud model. Organizations with strict data policies still need to decide whether that metadata may leave the device.
The adversarial audit loop divides the work into narrow, testable steps: one agent proposes a fix, another searches for ways to break it, and a third checks the regression suite. This structure reduces the amount of context each local worker must manage and gives the orchestrator concrete signals such as failing tests, reproduced exploits, and patch diffs.
Where the local model fits
Google highlights self-contained code generation as a practical use case. In one example, the agent creates a live terminal resource monitor from a single prompt, writes a Python program using psutil and rich, generates requirements.txt, and tests the result. The task has clear dependencies, observable output, and a bounded validation path.
The current hardware recommendation excludes many systems without a large discrete GPU or sufficient unified memory. Google’s sample also warns that runs can take several minutes, and workloads involving long contexts, broad factual knowledge, or complex planning may benefit from a larger cloud model. Quantization, context length, concurrency, and the selected inference server will further affect memory use and latency.
Choosing a deployment shape
- Fully local: Use LiteRT or a local OpenAI-compatible server when prompts, code, tool execution, and outputs must remain on the machine.
- Hybrid: Use a cloud model for planning and local workers for source-code access when policy permits limited metadata sharing.
- Existing model server: Connect Antigravity to an established Ollama, LM Studio, llama.cpp, or vLLM deployment to preserve current model operations.
Support for both LiteRT and OpenAI-compatible endpoints gives teams a common orchestration layer across these configurations. Developers evaluating the SDK should measure task success, tool-call accuracy, peak memory, latency, and data exposure with their own repositories before selecting a backend. Implementation details and updates are available in the GitHub repository.