◉ANTIGRAVITY LABJP
Articles/Antigravity Basics
◉ Antigravity Basics/2026-05-23Intermediate

Which Local-LLM Path to Keep with Antigravity: Ollama, LM Studio, or Raw Gemma 4 (Indie Judgment Notes)

After running three local-LLM paths from Antigravity in parallel, here is what I kept and what I cut, written from a one-Mac-mini indie operation.

antigravity476local-llm17ollama7lm-studio6gemma-419

Once the Antigravity local-LLM integration had settled, I used the May break to consolidate my own setup. I had been running Ollama, LM Studio, and a direct MLX Gemma 4 server in parallel, and they were starting to fight over disk and RAM on a single Mac mini M5. These are the notes from that consolidation and the criteria I used.

I lean on local LLMs for work I do not want to send to a cloud API: draft notes that include sensitive material, and formatting AdMob-related log dumps. Keeping that internal processing off the network is the main reason I keep a local path at all.

Why I started consolidating

Carrying three paths in parallel was convenient, but the costs caught up:

  • Duplicate model files were eating about 80 GB of SSD.
  • The three runners fought each other on ports and RAM whenever any of them was active.
  • Three different Antigravity endpoint configurations meant a higher rate of configuration mistakes.

At first I told myself "it's handy, keep all three." The results were not great. So I spent the break deciding what to keep and what to cut.

Three criteria

I compared the three options on:

  1. Boot cost and idle memory footprint.
  2. How clean each endpoint looks from Antigravity.
  3. Model-update cadence and ease of retrieval.

1. Boot cost and idle memory

PathIdle footprintEffort
OllamaBackground daemon at about 500 MB; 8-14 GB once a model is loaded (rough figures from my machine)Almost none
LM StudioThe API only runs while the GUI is open, and just opening it costs 1.5 GBManual launch
MLX directSimplest, since you manage the process yourselfVerbose configuration

The Mac mini's 28 GB is shared with wallpaper-app development, so even 1 GB of idle RAM matters.

2. Endpoint cleanliness from Antigravity

Antigravity's localModels configuration points at Ollama on http://localhost:11434 and the behavior is predictable. LM Studio requires a UI reload on every model switch, which is awkward for automation. The MLX direct route needs you to write your own serving wrapper, and that alone took an hour.

3. Model updates

As of May, the Ollama registry carried the major models including Gemma 4, and one command pulls them. LM Studio's advantage is that MLX-optimized variants land earlier, and on Apple Silicon it was sometimes the faster of the two.

I had the Gemma 4 tags wrong

An earlier version of this post listed gemma-4:9b, "9b / Q4_K_M" and "27b". When I rechecked in October, I found those tags do not exist.

The Gemma 4 tags the Ollama registry publishes right now are these four:

TagTypeParameters
gemma4:e2bEffective 2B2.3B effective (5.1B with embeddings)
gemma4:e4bEffective 4B4.5B effective (8B with embeddings)
gemma4:26bMixture-of-Experts25.2B total, 3.8B active
gemma4:31bDense30.7B

The source is the Ollama gemma4 library page. I removed the earlier "5.8 GB / 9.8 GB / 15 GB" file sizes because I cannot back them up today.

That adds one line to my rules. Budget memory by total parameters, not active parameters. A 26B MoE computes lightly, but all 25.2B parameters of weights still sit in memory. At roughly half a byte per parameter for 4-bit quantization, that is on the order of a dozen-plus GB for weights alone (my back-of-envelope arithmetic, not a measurement). On a 28 GB machine running Xcode and Antigravity, I treat e4b as the daily driver and 26b as a one-off for long-form formatting.

Run ollama list to see the real sizes on your own machine. Look at the tag and the size before writing them down — that is the order I keep now.

What I kept, what I cut

After comparing the three, I kept Ollama as the default and LM Studio as an auxiliary, and dropped the MLX direct route.

This is the configuration from my notes, with the old gemma-4:9b rewritten to current tag names:

Antigravity localModels:
  - name: "gemma4-e4b (default)"
    endpoint: "http://localhost:11434/v1"
    model: "gemma4:e4b"
  - name: "gemma4-26b (heavy)"
    endpoint: "http://localhost:1234/v1"
    model: "lm-studio-loaded-model"

Day-to-day work runs through the smaller model on Ollama. Long-form work that needs more accuracy switches to the larger model in LM Studio, which I only launch when needed. Setting labels in Antigravity can change between versions, so please read the block above as my own note.

Spotting a port conflict fast

While I was running all three, the biggest time sink was diagnosing "Antigravity can't connect." Ollama uses 11434 and LM Studio uses 1234, but an old process can still be squatting on a port. I learned to identify the culprit first with one line:

lsof -nP -iTCP:11434 -sTCP:LISTEN

If the PID that comes back is anything other than ollama, that is your conflict. Running this before second-guessing the Antigravity config cut diagnosis down to a couple of minutes.

One script for all three paths

Typing lsof and curl every time got old, so I folded the liveness check into a script. It prints the HTTP code if something answers, and down if not.

#!/usr/bin/env bash
# Liveness check for the three paths: HTTP code if something answers, otherwise down
check() {
  local name="$1" url="$2" code
  if code=$(curl -s -m 2 -o /dev/null -w '%{http_code}' "$url"); then
    echo "${name}: ${code}  ${url}"
  else
    echo "${name}: down  ${url}"
  fi
}
check ollama   http://localhost:11434/api/tags
check lmstudio http://localhost:1234/v1/models
check mlx      http://localhost:8080/v1/models

While revising this in October I ran the script itself on Linux. With nothing listening, all three lines printed down; with a throwaway HTTP server on port 11434, only the first line changed, to a status code (404, since it was a dummy). So the down/up branching works as intended — but this was not a run against real Ollama or LM Studio. I assumed 8080 as the default port for mlx_lm.server; change it if you start the server with --port.

Why I cut the MLX direct route

The MLX direct route is technically interesting, and I enjoyed running mlx_lm.server myself for the first two weeks. But writing my own launcher, managing ports and logs, and rolling my own restart logic is overhead that does not earn its keep against indie operating time.

Running several wallpaper apps and a few sites as one person, "infrastructure I write and I have to maintain" is something I want fewer of, not more.

Ollama did start using MLX, but the official Ollama blog describes it as a preview tied to Ollama 0.19, accelerating a single model (Qwen3.5-35B-A3B) and requiring a Mac with more than 32 GB of unified memory. My earlier claim that Ollama's MLX use had erased the speed gap was overstated, and on a 28 GB machine I cannot use it yet. My decision to drop MLX direct was about operational load, not speed — that is how I read it now.

Tightening idle memory with OLLAMA_KEEP_ALIVE

Once Ollama was the default, the next lever was how long a model stays resident. By default Ollama keeps a model in memory for five minutes after the last call, but I only call it between writing sessions, so those five minutes were quietly holding RAM. I shortened the retention to 60 seconds:

launchctl setenv OLLAMA_KEEP_ALIVE 60s
# to unload immediately
curl http://localhost:11434/api/generate -d '{"model":"gemma4:e4b","keep_alive":0}'

launchctl setenv takes effect after Ollama restarts. You can see what is resident with ollama ps; if the PROCESSOR column shows CPU mixed in rather than 100% GPU, memory is spilling to CPU. "Resident or load-on-demand" has a different answer depending on how much RAM the machine has; on a 28 GB box, my conclusion is to keep it short.

May consolidation numbers

ItemFreed (approx.)
Duplicate model filesabout 52 GB
LM Studio cache clearabout 8 GB
MLX direct filesabout 18 GB
Totalabout 78 GB

The SSD gained about 30 GB of free space, which lets me keep Xcode's derived data and Crashlytics dSYMs around without rationing.

An unexpected upside after switching

Two benefits showed up that I had not planned for. One was that Antigravity became more stable. With three runners I kept losing time to port-conflict detection; centering on Ollama took that to almost zero. It is only about ten minutes a day, but over a month that is roughly five hours.

The other was that the Mac mini ran cooler. With LM Studio no longer resident, idle CPU temperature dropped by about five degrees and the fan spun up perhaps half as often.

I only realized after the cleanup that the physical quality of a working environment belongs in the evaluation too. Choosing a tool on benchmark numbers alone accumulates as invisible fatigue over a long relationship.

Where I am landing

The May end-state is a lean two-path setup — Ollama as default, LM Studio for heavy jobs — used for sensitive log formatting and draft notes for my sites. I also gave myself the rule that the localModels list will not grow.

Before adding a tool, decide which one you would drop. That is the line this cleanup left me with.

If you are starting to combine Antigravity with local LLMs, install one path, live with it for a week, and add a second only when you can name what the first cannot do. As a first step, run ollama list and write down the tags and sizes you actually have.

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 →

If you found this article helpful, a small tip ($1.50) would mean a lot to us. Your support helps keep this site ad-free and covers server and hosting costs.

Related Articles

◉ Antigravity2026-06-12
Running Antigravity Behind a Proxy
Keep Antigravity working behind corporate proxies, SSL inspection, and hotel Wi-Fi: layer-by-layer diagnosis, certificate trust, NO_PROXY design, and connection profiles with a local LLM fallback.
⚙ AI Tools2026-06-12
Cutting Down 'Plausible but Wrong' RAG Answers — A Retrieval Evaluation Harness for Gemma 4 and Antigravity
Replace gut feeling with recall@5, MRR and faithfulness scores — a 30-question golden dataset and a small Python harness for evaluating a local Gemma 4 RAG stack.
⚙ AI Tools2026-04-24
A Daily LM Studio Workflow in Antigravity
A practical guide to making LM Studio your everyday model provider inside Antigravity — how to pick a model, wire up the OpenAI-compatible server, and survive the small surprises that come with daily use.