◉ANTIGRAVITY LABJP
Articles/Integrations
⬡ Integrations/2026-04-24Advanced

Antigravity × Ollama: Gemma 4 in Your Editor

A hands-on guide to wiring Ollama into Antigravity so you can run Gemma 4 locally. Covers cross-OS setup, endpoint configuration, model sizing, and two measured fallback routers — including why the naive one costs 4.3x when local goes silent, and how to pick a cooldown.

Antigravity411Ollama16local LLM15Gemma 422offline development

✦ Premium Article

Three pressures keep pushing teams toward local LLMs: sensitive data you don't want leaving the machine, environments with no reliable internet, and inference bills that refuse to come down. With Antigravity at the center of an agentic workflow, the shortest path to addressing all three is running Gemma 4 via Ollama and registering it as an Antigravity API provider.

This guide walks through setup on macOS, Linux, and WSL, shows how to tell Antigravity to split traffic between cloud and local LLMs, and covers the kinds of operational gotchas you only hit a week into real use.

Why Ollama, Not llama.cpp or vLLM

You have options: llama.cpp directly, LM Studio, vLLM, Ollama. Ollama pairs especially well with Antigravity for three reasons.

First, it exposes an OpenAI-compatible endpoint (/v1/chat/completions) out of the box. Antigravity's API client config is one base_url swap away from talking to it. Second, pulling models is a single command (ollama pull gemma3:12b) and versioning is straightforward. Third, it covers Metal on macOS, CUDA on Linux, and DirectML on WSL, so mixed-OS teams can share a single setup flow.

For throughput-sensitive production, you'll still want vLLM or TGI. Ollama shines for solo developers, internal PoCs, and first-pass processing of sensitive data.

Per-OS Setup

macOS (Apple Silicon)

brew install ollama
brew services start ollama
 
# Pull a quantized Gemma 3 4B (fits comfortably in 16GB)
ollama pull gemma3:4b
 
ollama run gemma3:4b "Hello"

Metal GPU acceleration is automatic. M1-class machines with 16GB run 4B-8B models smoothly; 32GB machines handle 12B-27B.

Linux (CUDA GPUs)

curl -fsSL https://ollama.com/install.sh | sh
sudo systemctl enable --now ollama
 
# Sanity-check GPU usage while a request is inflight
nvidia-smi
 
ollama pull gemma3:12b

If CUDA detection fails, Ollama silently falls back to CPU — your inference grinds to a halt. Check ollama serve logs for a CUDA found line before declaring things working.

WSL2 (Windows)

The same Linux install script works inside WSL2. WSL2's kernel tunnels through Windows' GPU driver, so CUDA still works. DirectML support is maturing, but CUDA remains the smoother path when you have an NVIDIA card.

✦

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
✦Exactly how to point Antigravity at an Ollama endpoint, including the `api_key` trick most clients trip over
✦A practical model-size table for Gemma 4 across Mac, Linux, and Windows with realistic tokens-per-second numbers
✦Two fallback routers, measured. When local goes silent the naive one pays 543.3ms per request against 41.6ms for the one that remembers failures — 4.3x total
Secure payment via Stripe · Cancel anytime
✦

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Antigravity Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • ✦Copy-paste ready implementation code
  • ✦New advanced guides published daily
  • ✦$5/mo or $10 for lifetime access
View Membership →

Related Articles

⬡ Integrations2026-07-09
Calling Local LLMs from Antigravity — Ollama and LM Studio Integration in Practice
Running local LLMs from Antigravity via Ollama or LM Studio: a real benchmark harness, how to confirm the model is actually on the GPU, a monthly breakeven model, and a wrapper that forces JSON output.
◉ Antigravity2026-04-09
Connecting a Local LLM to Antigravity — Getting the First Round Trip Working with Ollama
How to connect a local LLM (Ollama or LM Studio) to Antigravity: installing and checking it, pointing Antigravity at the OpenAI-compatible /v1 endpoint, choosing models by task, and narrowing down "won't connect", "model not found" and "unreachable from WSL or a container" in the order I hit them.
⬡ Integrations2026-11-02
Three things to check on a Marketplace partner plugin's page before you install it
Antigravity 2.28.2 put partner plugins into the Marketplace. Here is how I split the decision: check the developer and repository before installing, then manage the connection from the Accounts tab afterward, plus a short command to see whether a repository is still maintained.