ANTIGRAVITY LABJP
Articles/Integrations
Integrations/2026-07-09Advanced

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.

Antigravity356Ollama15LM Studio5Local LLM7Gemma4Privacy

Premium Article

When I first started using Antigravity, I only connected it to cloud LLMs like Gemini and Claude. That seemed sufficient at the time. Then a project came in involving sensitive internal documents I couldn't ship to a cloud API, and the situation flipped. I needed to keep Antigravity but wanted inference to run locally.

Antigravity turned out to be more flexible than I expected. You can wire it up to Ollama or LM Studio for local inference. Not "one click and done" like cloud LLMs, but with the right configuration, the combination is genuinely production-usable.

Here are the configurations I converged on, the cloud-vs-local task splits I learned through use, and the workarounds for the constraints unique to local LLMs. The goal is to nudge the "interested but it sounds like a hassle" reader into actually trying it.

Why Use Local LLMs Through Antigravity

My motivations come down to three:

Sensitive data handling. I sometimes work with NDA-protected client data marked "must not be sent to external APIs." Cloud LLMs are off the table; local-only completion is allowed. This is the most pressing motivator.

Cost. Automation that calls an API hundreds of times a day adds up. If your local hardware has spare capacity, sending routine work to local LLMs and reserving the cloud for hard judgments is economically sound.

Offline resilience. Sounds minor, but if you ever work in flaky network environments, having local inference available is a quiet blessing. I sometimes work overseas, and local LLMs save me when local internet is slow or APIs lag.

When not to use local LLMs: tasks that need state-of-the-art reasoning (complex design judgment, long-form logical consistency checks). Models you can run on your own machine don't reach those heights.

Ollama or LM Studio?

The two main local inference servers Antigravity connects to are Ollama and LM Studio. I've used both and split them by use case.

Ollama's strength: CLI-driven and stable. ollama pull gemma3:27b to fetch a model, ollama serve to expose an OpenAI-compatible API. Simple structure, well-suited to "running in the background, always on" scenarios. I have it parked on a Mac mini and hit it from every device on my home LAN.

LM Studio's strength: All-in-GUI. Model downloads, quantization choice, system-instruction tuning — all on screen. For exploratory prompt iteration, LM Studio is far easier. For ongoing operations, Ollama wins on stability.

My split: "LM Studio for hands-on exploration, Ollama for production." Same GGUF models work in both, so migration cost is low.

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
A 70-line benchmark that measures TTFT and tok/s against the Ollama /v1 endpoint, at p50 and the slow 5%
A monthly breakeven model for local hardware vs cloud API, worked at 20, 400 and 2,000 calls per day
A thin wrapper forcing JSON output without function calling — schema constraint, preamble stripping, one repair retry
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 $15 for lifetime access
View Membership →

Related Articles

Integrations2026-04-25
Antigravity Can't Connect to Ollama or LM Studio: A Diagnostic Guide
Why Antigravity fails to reach a local LLM running in Ollama or LM Studio, and how to walk through ports, CORS, model names, and OpenAI-compatible endpoints to fix it.
Integrations2026-05-04
Integrating Gemma 4 Into Antigravity — A for Offline and Air-Gapped AI Development
With Apache 2.0–licensed Gemma 4, you can now run Antigravity's agent experience inside confidential or offline projects. Here is the full implementation walkthrough — Ollama/vLLM wiring, Architect/Builder prompt tuning, and production gotchas.
Integrations2026-05-14
Antigravity × Gemma 4 API Implementation Guide — Build from Zero with Python & TypeScript
Call Gemma 4 API from Antigravity IDE. Python & TypeScript code examples, streaming, error handling, and Next.js integration — production-ready guide.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links
See all →