◉ANTIGRAVITY LABJP
Articles/AI Tools
⚙ AI Tools/2026-11-18Beginner

Trying a Local LLM Without Slowing Down Your Mac — The First 30 Minutes of Running Ollama on an SSH Linux Host from Antigravity

Using the SSH host connection added in Antigravity App v2.33.0, I put Ollama on a separate Linux machine and had the agent write a check script that runs on that host. Why you do not need to open any port, and how to tell what runs where.

Antigravity416Ollama17SSH3local LLM16Gemma 423indie dev25

One evening I was trying to see whether a local LLM could draft category descriptions for my wallpaper app. I started Ollama on my iMac at home, and as soon as the model loaded, everything else on the machine slowed down noticeably. I had image exports running in parallel too, and I ended up just sitting there listening to the fan.

In the corner of the room there was a 64-bit Linux box I normally use as file storage. Antigravity App v2.33.0, released on November 17, lets you connect to exactly that kind of machine over SSH and run projects, agents and terminals on it.

The first thing I want to say is that this setup removes the step of "opening up your local LLM's port." I got that wrong at first and nearly added a setting I did not need. What follows is the first 30 minutes, from connecting to getting the first round trip back, in the order I stumbled through it.

First, sort out what runs where

The v2.33.0 release notes say the App can connect to a 64-bit Linux machine over SSH, that Antigravity installs its remote server automatically over OpenSSH using your ~/.ssh/config, and that projects, Git worktrees, agents and terminals run on the host and keep working after you close the window.

The part that matters here: localhost in a command the agent runs means the SSH host, not the Mac in front of you.

PieceWhere it runsIn this article
The Antigravity App windowYour MacYou just operate it
Project, terminal and agent workThe SSH Linux hostCalls Ollama from here
Ollama and the modelThe SSH Linux hostStays on 127.0.0.1:11434
The agent's own reasoning modelUnchangedNot swapped

To avoid confusion about that last row: this article goes as far as using the host's Ollama from scripts and small tools the agent builds. It does not replace the agent's own model with a local one. That setup lives in Connecting a Local LLM to Antigravity.

Step 1: Prepare a single SSH entry (5 minutes)

The App reads ~/.ssh/config, so give the host one name there. Confirm key-based login works from a terminal first and you will not get lost later.

# Append to ~/.ssh/config on your Mac
Host llm-box
  HostName 192.168.1.50      # LAN IP of the Linux machine (example)
  User your-name
  IdentityFile ~/.ssh/id_ed25519
  ServerAliveInterval 30     # keeps idle sessions from dropping
 
# Check that the key works (no password prompt)
ssh llm-box 'uname -m && cat /etc/os-release | head -2'

If uname -m prints x86_64 or aarch64, you are on 64-bit. The release notes target 64-bit Linux, so an old 32-bit machine is out at this point.

Then pick llm-box from the App's sidebar, from "SSH Host..." in the project menu, or from "Connect to SSH Host..." in the command palette. The first time, the remote server gets installed on the other side, so expect a short wait.

Step 2: Install Ollama on the host and pull one small model (15 minutes)

From here, type in a terminal opened inside the App. On the first command, check that the prompt shows the llm-box side.

# Ollama's official installer (registers a systemd service on Linux)
curl -fsSL https://ollama.com/install.sh | sh
sudo systemctl status ollama --no-pager | head -5
 
# Pull one small model (gemma4:e2b is listed at 4.6GB and up in the Ollama library)
ollama pull gemma4:e2b
ollama list
 
# Check the listen address. 127.0.0.1:11434 means nothing outside can see it
ss -ltn | grep 11434

I would not start with a big model. I got greedy and tried a large one first, and the download and the shrinking disk pulled my attention away from the one thing I wanted to know: does it connect. A small model is enough for that.

Step 3: Have the agent write a check script that runs on the host (10 minutes)

Keep the request short and include what counts as a pass. This is roughly what I sent:

Write a Python script called check_ollama.py that sends one short question
to the Ollama running on this host (http://127.0.0.1:11434) using gemma4:e2b.
Standard library only. Print the reply text, the processing time in seconds,
and the number of generated tokens.
Do not change any Ollama settings (listen address or service).

Here is what came back, after I tidied it up a little by hand:

import json
import sys
import urllib.request
 
URL = "http://127.0.0.1:11434/api/chat"  # points at the SSH host itself
MODEL = "gemma4:e2b"
 
def ask(prompt: str) -> dict:
    body = json.dumps({
        "model": MODEL,
        "messages": [{"role": "user", "content": prompt}],
        "stream": False,  # get the full reply in one response
    }).encode("utf-8")
    req = urllib.request.Request(URL, data=body, headers={"Content-Type": "application/json"})
    # the first call includes model loading, so allow a long wait
    with urllib.request.urlopen(req, timeout=300) as res:
        return json.load(res)
 
if __name__ == "__main__":
    try:
        r = ask("Write one caption under 15 words for a night-city wallpaper.")
    except OSError as e:
        sys.exit(f"Could not reach Ollama: {e}")
    print(r["message"]["content"].strip())
    # total_duration comes back in nanoseconds
    print(f"Time: {r.get('total_duration', 0) / 1e9:.1f} s / generated tokens: {r.get('eval_count', 0)}")

stream is False because for a first check I only want to know whether the whole reply comes back at once. Streaming output can wait until the connection is proven. The 300-second timeout is there because the first call includes loading the model, and once that wait made it look like a failure when it was not.

Run python3 check_ollama.py in the App's terminal. If you get one caption back, the goal of these 30 minutes is met. The second run should come back clearly faster than the first, and that gap is the model load time.

Where I tripped: I nearly changed OLLAMA_HOST

Local LLM write-ups often say that to use Ollama from another machine you set OLLAMA_HOST=0.0.0.0:11434. I reached for that reflexively. I was sure that since my Mac was calling the host's Ollama, I had to open it up.

But the script was not running on my Mac. It was running on the SSH host itself. Calling 127.0.0.1 from inside the host gives no reason to widen the listen address. Widening it would actually let anyone on the same LAN hit an API with no authentication.

Put the caller on the same machine, and you never have to open the door. Since then I leave the listen address at its default, and I write "do not change any Ollama settings" into every request I give the agent.

What this actually makes possible

What I like about this shape is that it separates where the heavy work lives from where the judgment lives. The machine in the quiet corner holds the model. What stays with me is the screen and the job of reading each reply and deciding whether to keep it.

When people hear that an agent acts autonomously, they tend to picture handing everything over. In practice it felt plainer than that. A person decides where things run, a person decides not to open the door, and inside that frame the agent does the work. Maybe autonomy is only something you can watch calmly once the frame is already in place.

If replies start to slow down over time, I wrote about that in Keeping Ollama's Latency Flat by Working Backward from Context Length.

The next step

Tonight, just check whether ssh llm-box gets you in without a password. If it does, most of the remaining 25 minutes is waiting. That is where I started too, as an indie developer with one spare Linux box.

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

⬡ 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.
⚙ AI Tools2026-10-18
The Terminal Stayed on Running Forever: Three Ways the Finish Signal Never Arrives, Checked Before Raising the Timeout
When a command you handed to an agent sits on Running, it may not be slow at all; the finish signal may simply never arrive. I measured three shapes in a plain shell: waiting on stdin, a child process holding the output pipe, and waiting on a prompt. One run was cut off at 3.0 seconds, another held for 30.0, and I note where the fixes break.
◉ 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.