Local AI Agents with Google Antigravity: Run Them Offline on Your Computer with Ollama and Gemma 4

Simon Gütter · 16 November 2026 · Reading time about 18 minutes

Cover image “Local AI agents with Google Antigravity”: an open laptop on a wooden table in front of a mountain panorama, an orange network cable plugged into the laptop with the other end lying loose, next to trays of sorted letters

How much money and how many nerves does the weekly limit of your AI tool actually cost you? For me, the quota is usually used up just when I'm in the middle of a task, and on top of that, with every customer email I wonder whether it belongs on someone else's server at all. That's exactly where Google Antigravity with local AI agents comes in, because then the AI doesn't run in the cloud but on your own computer, so you can run AI locally. Since 23 September 2026, the Antigravity SDK can also work with AI models that sit on your hard drive.1 That means you build yourself an agent on the same foundation that the Antigravity app runs on, and let it work with Gemma 4 via Ollama, for example, with no API key, no credits and, after setup, even without internet. There is one catch, though, because Google recommends a computer with at least 24 GB of graphics memory or shared memory for the main variant.1,2 In this article I'll therefore show you which model suits your computer, how to set up a local agent, which five agents are worthwhile in a small business and where the limits are.

In short

The Antigravity SDK is Google's Python toolkit for your own AI agents. Since September 2026, these agents also run with local AI models (a local LLM), officially optimised for Gemma 4 26B via Google's LiteRT and additionally via any OpenAI-compatible server such as Ollama, LM Studio or vLLM.1 A smaller Gemma 4 model via Ollama also fits on a laptop with 16 GB of RAM, but it works more slowly and delivers results you should proofread.4,5 You use policies to decide what the agent is allowed to do, triggers start it on its own, and your data stays on your device.2

Key figures

  • 23/09/2026: Google announces local models in the Antigravity SDK.1
  • 24 GB of graphics or shared memory is what Google recommends for the main variant with Gemma 4 26B A4B.1,2
  • 64,000 tokens of context is what Google recommends for local agents, while Ollama starts with 4,096 by default.2,6
  • 4.5 GB of memory is what Gemma 4 E4B needs in the 4-bit version, and the 26B variant needs 14.4 GB.4
  • 97.2% of all tokens ran locally in Google's hybrid demo, and the planner in the cloud needed only 95 tokens.1
  • US$0 a month is what Antigravity costs for individuals, with basic weekly limits.7

What is the Antigravity SDK?

Antigravity now comes in five forms: as an app, as its own development environment (IDE), as an extension for other editors, as a command line and as an SDK.7 The SDK is the variant for your own programs and automations. You install it with pip install google-antigravity, write a few lines of Python, and the SDK takes care of the whole loop of thinking, calling a tool, checking and carrying on.2 According to Google, it contains the same capabilities that power the Antigravity app.1

For you, that means you don't have to program an AI agent from scratch. You describe a task, give the agent a folder it may work in, and it reads files, writes results and, if you want, also runs commands. On top of that come your own tools built from Python functions, the connection of MCP servers, policies for permitted actions and triggers for recurring tasks.2 The SDK is released under the Apache 2.0 licence and runs on macOS, Linux and Windows. It does, however, ship with a precompiled runtime file that only exists in the package on PyPI and not in the source code on GitHub.2,3

Local or cloud: what changes?

Without further configuration, the SDK talks to Gemini in the cloud and needs an API key for that.2 For local operation, you basically just swap the configuration, because your agent's tasks, policies and tools stay the same, and Google gives four reasons for it:1

  • no running costs, because API fees and rate limits disappear,
  • data protection, because your code and your requests stay entirely on your computer,
  • offline operation, so the agent also works as offline AI without a stable internet connection, for example on the road or in a van,
  • hybrid operation, where you combine cheap local work with a large cloud model when a task does turn out to be too hard.

I wouldn't underestimate the point about limits. A local agent runs as often as you like, because the only limit is your computer and not a quota that's already empty by Wednesday.

Gemini in the cloud Gemma 4 via LiteRT Gemma 4 via Ollama
Configuration in the SDK LocalAgentConfig with Gemini API key LiteRTAgentConfig LocalOpenAIAgentConfig
Internet required yes no (after the download) no (after the download)
Cost per task by usage or plan limit none none
Recommended hardware any from 24 GB of graphics or shared memory depends on the model, E4B already on laptops with 16 GB
Data leaves the computer yes no no
Optimised by Google yes yes, for Gemma 4 26B A4B supported, not specially optimised

Sources: Google Developers Blog, README of the Antigravity SDK, Gemma 4 model overview.1,2,4

Which Gemma 4 model suits your computer?

This is the most important question before you start. Gemma 4 comes in five sizes, from E2B for phones and browsers up to 31B for powerful computers.4 The bigger the model, the better the results, but the more memory you need and the slower it gets on weak hardware. The table shows the approximate memory requirement according to Google, alongside the download sizes on Ollama.

Model 4-bit version (Google) Download on Ollama Context Suitable for
Gemma 4 E2B 2.9 GB 4.6 to 7.5 GB 128K older laptops, simple sorting tasks
Gemma 4 E4B 4.5 GB 6.6 to 9.5 GB 128K normal laptops with 16 GB of RAM
Gemma 4 12B 6.7 GB 7.7 to 8.0 GB 256K computers with 16 to 32 GB and a graphics card
Gemma 4 26B A4B 14.4 GB 16 to 19 GB 256K Google's main variant, 24 GB or more recommended
Gemma 4 31B 17.5 GB 19 to 20 GB 256K powerful workstations or Macs with plenty of memory

Sources: Google's Gemma 4 model overview and the Ollama library, as of 16/11/2026.4,5

As a rule of thumb, I take the biggest model that fits entirely into graphics memory (on a Mac, into shared memory) and leave some headroom for the context. On a laptop with 16 GB of RAM and no dedicated graphics card, which is what I use myself, E4B is the sensible choice. E2B is smaller and faster, but for agents that are supposed to complete several steps in a row, I'd take at least E4B.

Building local AI agents: step by step to your own Ollama agent

Before you get going with the SDK, I'd try the task out first in the Antigravity app or in your editor. There you quickly see whether the agent understands the task at all, and only once that works is it worth automating it with the SDK. The setup itself then takes about a quarter of an hour, depending on how fast the model download runs.

  1. Install Ollama and download the model. You can get Ollama at ollama.com, and you fetch the model with ollama pull gemma4:e4b, for example.5
  2. Increase the context. Without any setting, Ollama works with 4,096 tokens of context, which is far too little for agents. So start Ollama with OLLAMA_CONTEXT_LENGTH=16384 ollama serve, for example. A larger context needs more RAM, so on a laptop with 16 GB I'd stay at 16,384 or 32,768 tokens for now and only move towards the 64,000 tokens Google recommends with 24 GB or more.6,2 If Ollama runs as a background service on your machine, you enter the variable in its settings and restart the service.6
  3. Create a Python environment with python3 -m venv .venv and source .venv/bin/activate on macOS or Linux, and on Windows in PowerShell with python -m venv .venv and .venv\Scripts\Activate.ps1.2
  4. Install the SDK with pip install google-antigravity.2
  5. Write the agent. Three details matter most: the model name, the address of the local server and the folder the agent may work in.
import asyncio
from google.antigravity import Agent, LocalOpenAIAgentConfig
from google.antigravity.hooks import policy

ORDNER = "/home/du/agenten/postfach"

async def main():
    config = LocalOpenAIAgentConfig(
        model="gemma4:e4b",
        base_url="http://127.0.0.1:11434/v1",
        workspaces=[ORDNER],
        policies=[policy.deny("*"), policy.allow("view_file"), policy.allow("list_directory")],
    )
    async with Agent(config) as agent:
        antwort = await agent.chat("Read all the files in the folder and summarise each one in a single sentence.")
        async for teil in antwort:
            print(teil, end="", flush=True)

asyncio.run(main())

A stumbling block I fell over myself: on my first attempt, instead of an answer I only got a timeout when connecting to Ollama, even though Ollama was running. On my machine, localhost pointed to the IPv6 address, where Ollama wasn't reachable, which is why the example uses 127.0.0.1. If you still only get a timeout with that, check your desktop firewall. If it approves outgoing connections one by one, the SDK's runtime file must also be allowed to access the local port 11434.

Let Antigravity build the agent for you

You don't have to type the code yourself. In the Antigravity app, you can also have the agent built for you, with a request like this:

Build a Python agent with the Antigravity SDK. Use LocalOpenAIAgentConfig with the model gemma4:e4b and the Ollama address http://127.0.0.1:11434/v1. Set this folder as the workspace. The agent reads every file in the “inbox” folder, does the task I describe below and writes its results to the “outbox” folder. Print every tool call so I can watch. Then run it. Task: …

Keep in mind that the Antigravity app itself works with cloud models, which means your task description goes to the cloud for the time being while you build, and only the finished agent works locally with your files. So put only sample data in the folder while building, and the real customer data only afterwards. And look at which files the app creates and changes before you accept everything. For your own workflows that's usually enough, but for a customer project with logins or payments, someone with programming experience should still look over the code.

Five local agents that are worthwhile in a business

All five follow the same pattern: a folder with the inputs, a clear task and a second folder for the results. In the request above, you therefore only change the task each time.

1. The inbox sorter for agencies and service providers

You put customer emails into the inbox folder as text files, for example via an export from your email program. The agent reads each email, sorts by urgency, adds a one-line summary and creates a draft reply for each one. At the very top you then get, say, the online shop customer who is unhappy with the results and is thinking about cancelling, together with a calm draft that asks where exactly the problem lies. You still have to send the emails yourself, of course, after reading them. Because emails almost always contain personal data, local operation brings the most here.

2. The contact list sorter for outreach

You have a list of a few hundred contacts from trade fairs, enquiries or old projects, and it contains personal addresses like firstname@company.de mixed in with generic addresses like info@ or practice@. For your outreach you need the two separated, because you write to an owner differently than to a front office. The agent goes through the spreadsheet, marks each address as personal or generic and writes the result into a new column. With lists like these in particular, it's nice that they don't have to go to a cloud service for this.

3. The first-contact writer for existing contacts

You give the agent a spreadsheet with companies, industry and a short note about the website. It writes an opening sentence for each company that refers to what the company really does, instead of phrases like “great website”. For an online school with 4,000 participants, for example, it picks up the full support inbox, and for a software offering with a trial period, the question of how trial customers find the right feature. Keep the rules for advertising by email in mind, because unsolicited advertising emails are only permitted within narrow limits in Germany, even to companies. So only use the openers for contacts who have given you their consent, or as a hook for a personal conversation.

4. The note tidier for coaches and consultants

After an appointment, the notes are usually a jumble of half sentences, ideas and things you promised. The agent turns them into a clean plan per client with three tasks and a question to open the next appointment. Conversation notes are confidential, and that's why, for me, they don't belong in a service where I don't know exactly what happens to them.

5. The SEO dashboard from the Search Console export

You export the table with search queries, clicks, impressions, CTR and position from Google Search Console. The agent builds a single HTML page from it: the strongest search queries at the top, below them the quick wins, meaning terms between position 8 and 20 that you can get onto page one with little effort, and a simple bar chart as well. Even clients understand a dashboard like this in a few seconds, and the figures never leave your computer.

Policies and triggers: how your agent runs safely on its own

An agent that is allowed to write files and run commands needs clear boundaries. Without further configuration, the SDK works in read-only mode, and you unlock everything else deliberately.2

  • With policies you forbid everything at first and then allow individual steps deliberately, for example reading files yes, commands only after asking. For this there are deny, allow and ask_user, plus ready-made building blocks like workspace_only, which blocks access outside the working folder, and confirm_run_command, which rejects commands without your approval.2,3 Your inbox sorter can write drafts that way, but not delete anything.
  • With triggers you decide when the agent gets going, for example with every every ten minutes or with on_file_change at the exact moment a new file lands in the inbox folder.2,3
  • With your own tools you make any Python function usable for the agent, and you connect MCP servers in the same way.2 An online shop, for example, gives the agent a tool that reads the product table, and gets descriptions for every new product.

Hybrid mode: the cloud plans, your computer works

If a task is too big for a small local model, you don't have to send everything to the cloud straight away. Google compares the division of labour to an architect and their building crew: a cloud model, Gemini 3.8 Flash in the demo, plans the task and distributes it, but only sees file names and short descriptions, while several local Gemma 4 instances on your computer do the actual work on the contents.1

Google's example involved three Python files with security vulnerabilities. The planner in the cloud needed 95 tokens for it. The local models reproduced the vulnerabilities, wrote fixes, criticised each other and checked everything against the tests. In the end, 97.2% of all tokens ran locally, which was 3,322 tokens.1 For a business, that means file names go to the cloud and can reveal something, but the content stays with you.

Antigravity costs: what do you pay locally in euros?

Locally there are no fees per task, you only pay for electricity and the hardware you already have. Take a laptop that draws about 60 watts under load and computes for your agents two hours a day. It uses around 3.6 kWh a month, and at 35 cents per kWh that comes to about €1.30 a month. The values are estimates and depend on the device and your electricity tariff, but the order of magnitude is right.

Antigravity itself costs US$0 a month for individuals, with basic weekly limits for the cloud models. There is more headroom with Google AI Pro and Ultra, and companies book through Google Cloud, where Gemini Enterprise plans start at US$30 per seat per month.7 For your local agents, these limits don't matter, they only count when you use the app or cloud models.

What brings you more, though, is the time you save. If the inbox sorter takes just 20 minutes of daily pre-sorting off your plate, that's just under seven hours a month over 20 working days. At an internal hourly rate of €50, that corresponds to around €330.

My tips for making local agents work reliably

  1. Give every agent its own working folder. That keeps it on topic, and with workspace_only it can't get at anything else.3
  2. One clear task instead of a wish list. Small local models work much better with a narrow brief and exact file names for the results. Better three agents with one task each than one that is supposed to do everything.
  3. Raise the context before you doubt the agent. If an agent breaks off in the middle of a long task or loses the thread, it is often down to a context that is too small. The 4,096 tokens Ollama starts with aren't enough for agents.6
  4. Plan for patience. Even Google's own example script points out that local processing can take several minutes.1 So let the agent run in the background via triggers instead of sitting in front of it.
  5. Proofread the results. A small local model makes more mistakes on difficult tasks than the large cloud models. For the many routine jobs with confidential files it still fits, you just shouldn't send anything unread.
  6. Start with sample data. Test every agent first with made-up emails, notes or spreadsheets and only then let it loose on real data.
  7. Watch file formats and sleep mode. The agent works most reliably with plain text files like .txt, .md or .csv. For Excel workbooks, it's best to give it a small Python function as a tool. And remember that a local agent only works while your computer is awake: if you close the laptop, the agent pauses too.

Limits of local AI and data protection

Local AI has its drawbacks too, and you should know a few of them before you rely on it in day-to-day business.

  • Google has optimised local operation for Gemma 4 26B A4B via LiteRT, and other LiteRT model files may run poorly or not at all, according to the README.2 Ollama with smaller models is supported, but it isn't Google's main route.
  • The recommendation of 24 GB of graphics or shared memory applies to the 26B variant. With less memory, a smaller model runs that can do noticeably less.1,4
  • For difficult tasks such as larger programming jobs, the big cloud models are still clearly ahead. Local operation is mainly worthwhile for the many small tasks that come back every day.
  • The SDK ships with a precompiled runtime file whose source code isn't in the public repository.2
  • When building in the Antigravity app and in hybrid mode, parts go to a cloud model, namely your task description and the file names respectively.1
  • Gemma 4 is released under the Apache 2.0 licence, like the SDK, which means you may also use the models commercially and without licence fees in your business.8

The big advantage remains that you process customer data on your own device without an AI provider getting to see it, as long as the agent runs purely locally. For this step you then don't need a data processing agreement with an AI provider. The remaining obligations under the GDPR, such as purpose limitation and retention periods, of course still apply. If you're generally interested in self-hosting, also take a look at my experiences with Nemotron 3.5 Bolt as a local assistant.

Conclusion

Do local AI agents with Antigravity now replace the big cloud models? Not for difficult and creative tasks, where the big models are clearly better. For the many small tasks with confidential data, though, meaning pre-sorting emails, splitting contact lists, tidying notes or evaluating exports, it's a very practical solution, because you set it up once and the agent then runs as often as you like, with no cost per task and no weekly limit. I'd start with exactly one agent, namely for the task that annoys you most every week, and test it for two weeks with sample data before real data comes into play. And if you notice along the way that there are many more such tasks in your business, let's have a quick chat about which one is worth doing first.

Frequently asked questions about Google Antigravity and local AI agents

Is Google Antigravity free?

For individuals, yes: the plan costs US$0 a month and has basic weekly limits. There is more headroom with Google AI Pro and Ultra.7 Local agents via the SDK incur no fees per task and don't even need an API key.1

Do I need internet for local Antigravity agents?

Only for the setup, meaning for downloading the SDK and the model. After that, the agent runs completely offline, as long as you don't use hybrid mode with a planner in the cloud.1

What is the minimum hardware I need?

For the main variant with Gemma 4 26B, Google recommends at least 24 GB of graphics or shared memory.1 With Ollama and Gemma 4 E4B, which needs around 4.5 GB in the 4-bit version, a model also fits on a laptop with 16 GB of RAM, but the answers then come more slowly.4

Does this also work with LM Studio instead of Ollama?

Yes, via LocalOpenAIAgentConfig the SDK talks to any OpenAI-compatible server. Google explicitly names Ollama, LM Studio and vLLM.1

What is the difference between LiteRT and Ollama?

LiteRT is Google's own runtime for on-device models, and the SDK is specially optimised for it with LiteRTAgentConfig. Ollama is a widely used local model server that the SDK addresses through the OpenAI-compatible interface. LiteRT is the optimised route for Gemma 4 26B, while Ollama gives you more choice of models.1,2

Does the Antigravity SDK run on Windows and Linux?

Yes, on PyPI there are ready-made packages for Windows, Linux and macOS, each for Intel and ARM processors.3

May I use Gemma 4 commercially?

Yes, Google provides Gemma 4 with open weights under the Apache 2.0 licence, which means you may also use the models commercially in your business.4,8

Suggested citation

Gütter, Simon (2026): Local AI Agents with Google Antigravity: Run Them Offline on Your Computer with Ollama and Gemma 4. Simon Traffic, 16 November 2026. https://simon-traffic.com/blog/ki-automatisierung/antigravity-lokal-ollama/

Sources

  1. Google Developers Blog: Introducing Support for Local AI Models in the Antigravity SDK, 23/09/2026. https://developers.googleblog.com/introducing-support-for-local-ai-models-in-the-antigravity-sdk/
  2. Google: Antigravity SDK for Python, README, retrieved on 16/11/2026. https://github.com/google-antigravity/antigravity-sdk-python
  3. PyPI: google-antigravity 0.1.23, package data and documentation in the package, retrieved on 16/11/2026. https://pypi.org/project/google-antigravity/
  4. Google AI for Developers: Gemma 4 model overview, retrieved on 16/11/2026. https://ai.google.dev/gemma/docs/core
  5. Ollama: gemma4, model library, retrieved on 16/11/2026. https://ollama.com/library/gemma4
  6. Ollama: FAQ, How can I specify the context window size?, retrieved on 16/11/2026. https://docs.ollama.com/faq
  7. Google Antigravity: Pricing, retrieved on 16/11/2026. https://antigravity.google/pricing
  8. Google AI for Developers: Gemma 4, Apache License 2.0, retrieved on 16/11/2026. https://ai.google.dev/gemma/docs/gemma_4_license

As of 16 November 2026. The Antigravity SDK is at version 0.1.x, so features and recommendations may change.