◉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.

Antigravity377Ollama16LM Studio5Local LLM8Gemma4Privacy

✦ 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-24
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.
◈ Agents & Manager2026-09-05
A Custom Tool That Says any_of Loses Its Constraint Without Ever Erroring
I tested ten spelling variants in custom tool parameter definitions to see which ones fail loudly and which slip through unnoticed, then measured how argument validation shifts once normalization lands.
◉ Antigravity2026-04-09
Setting Up Local LLMs in Antigravity for Practical Use
Step-by-step guide to configuring local LLMs in Antigravity. Covers Ollama and LM Studio integration, recommended models, Gemma 4 local setup, and troubleshooting tips for a privacy-first development environment.
📚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