Models

Atlas with Gemma 4 31B IT: Running Google's Open Weights Locally in 2026

Updated 6 min read

Gemma 4 31B IT is Google's April 2026 open-weights release, and inside Atlas it is the model to run when the weights need to stay on your own hardware. Gemma 4 31B IT carries a 262,144 token window with reasoning and tool calling support, and it is the largest Gemma you can realistically run on a single high-memory workstation. Pricing is free when self-hosted, or $0.99 / $1.49 per Mtok if served through Cerebras. The hardware cost is real: 31B parameters needs roughly 20GB or more of VRAM at 4-bit quantization.

What is Gemma 4 31B IT best at inside Atlas?

Gemma 4 31B IT is best inside Atlas for privacy-constrained work, because Google's April 2026 open-weights release runs entirely on your own machine and still carries a 262,144 token window. That context is far beyond the 32K to 128K typical of self-hostable models in 2026.

Context is usually where open-weights models fall down. Gemma 4 31B IT does not: 262,144 tokens is enough to hold a substantial slice of an Atlas code index in a single turn. That pairs directly with the Atlas privacy story, since Atlas can build its code index with local Ollama embeddings, keeping code off third-party servers. Running Gemma 4 31B IT through the same local Ollama endpoint means both halves of the loop, the embeddings and the generation, stay on your hardware. For teams whose data policy forbids sending source to a hosted API, that combination is the whole reason to choose Gemma 4 31B IT.

How do you run Gemma 4 31B IT locally with Ollama and Atlas?

Run `ollama pull gemma4:31b` to fetch the weights, then add an ollama provider block to atlas.json with `"npm": "@ai-sdk/openai-compatible"` and `"options": { "baseURL": "http://localhost:11434/v1" }`. Register Gemma 4 31B IT in that block's `models` map with a `limit` of `{ "context": 262144 }`.

The `limit` entry matters. Atlas needs to know the real window to budget context correctly, and Gemma 4 31B IT carries 262,144 tokens, so `{ "context": 262144 }` is the value to declare. The provider block routes Atlas through `@ai-sdk/openai-compatible` at `http://localhost:11434/v1`, which is the Ollama OpenAI-compatible endpoint. Once the block is in atlas.json, select Gemma 4 31B IT with `/models` and it joins favorites and recents like any hosted model, since Atlas lets you switch the active model and provider on the fly.

What hardware does Gemma 4 31B IT need to run?

Gemma 4 31B IT needs roughly 20GB or more of VRAM at 4-bit quantization, because it is a 31B parameter model. That requirement rules out most laptops in 2026 and makes Gemma 4 31B IT a workstation model rather than something you run on the machine in your bag.

Be clear-eyed about the hardware bill before pulling 31B weights. Roughly 20GB or more of VRAM at 4-bit quantization is the floor, and Gemma 4 31B IT is the largest Gemma you can realistically run on a single high-memory workstation. If you do not have that hardware yet, evaluate first rather than buying blind: Gemma 4 31B IT is available free on OpenRouter as google/gemma-4-31b-it:free, so you can set `OPENROUTER_API_KEY`, drive real Atlas sessions against it, and decide whether the quality justifies the GPU before you commit.

Does Gemma 4 31B IT support tool calling for Atlas agents?

Yes. Gemma 4 31B IT supports both reasoning and tool calling, which most open-weights models in its size class still lack in 2026. That is what lets Gemma 4 31B IT actually drive an Atlas agent loop instead of sitting at the end of it producing text.

Atlas connects to Model Context Protocol servers and exposes their tools to the agent, and it is extensible through plugins that contribute tools and hook into agent lifecycle events. A model that cannot emit structured tool calls cannot use any of that. Gemma 4 31B IT supports tool calling, so the MCP surface is available to it. Every Atlas tool call is permission-gated against allow, ask, and deny rules before it runs, which is a useful backstop with an open-weights model whose tool discipline is less battle-tested than a hosted frontier tier.

When should you pick a different model instead of Gemma 4 31B IT?

Pick Qwen3-Coder or Devstral instead of Gemma 4 31B IT for agentic coding, because both are specifically post-trained for it and Gemma 4 31B IT is weaker there. Gemma 4 31B IT is a general open-weights model with a 262,144 token window, not a dedicated coding-agent model.

Gemma 4 31B IT earns its slot on context length, privacy, and open weights. It does not win on agentic coding. Qwen3-Coder and Devstral are post-trained for the agent loop, and that training shows up as fewer wasted turns inside Atlas. If your requirement is that source code never leaves your machine, Gemma 4 31B IT with local Ollama embeddings is a strong answer. If your requirement is the best local coding agent regardless of family, look at Devstral or Qwen3-Coder first, and consider $0.99 / $1.49 per Mtok on Cerebras only if you want Gemma quality without owning the GPU.

Setup

  1. 01Pull the weights locally: `ollama pull gemma4:31b`.
  2. 02Add an ollama provider block to atlas.json with `"npm": "@ai-sdk/openai-compatible"` and `"options": { "baseURL": "http://localhost:11434/v1" }`.
  3. 03Register the model in that block's `models` map with a `limit` of `{ "context": 262144 }`.
  4. 04Select it with `/models` inside the Atlas TUI.
  5. 05To try it hosted first, set `OPENROUTER_API_KEY` and pick google/gemma-4-31b-it:free.

Frequently asked questions

How do I run Gemma 4 31B IT with Atlas?
Run `ollama pull gemma4:31b`, add an ollama provider block to atlas.json with `"npm": "@ai-sdk/openai-compatible"` and baseURL `http://localhost:11434/v1`, register the model with a `limit` of `{ "context": 262144 }`, then select it from `/models`.
How much VRAM does Gemma 4 31B need?
Gemma 4 31B IT needs roughly 20GB or more of VRAM at 4-bit quantization, so it runs on a high-memory workstation rather than a typical laptop.
What is the Gemma 4 31B IT context window?
Gemma 4 31B IT carries a 262,144 token window, far beyond the 32K to 128K typical of self-hostable models.
Is Gemma 4 31B IT free?
Gemma 4 31B IT is free when self-hosted, and it is also available free on OpenRouter as google/gemma-4-31b-it:free. Served through Cerebras it costs $0.99 / $1.49 per Mtok.
Does Gemma 4 31B IT support tool calling?
Yes. Gemma 4 31B IT supports reasoning and tool calling, which most open-weights models in this size class still lack, so it can drive Atlas agents and MCP tools.
Is Gemma 4 31B IT good for coding agents?
Gemma 4 31B IT is weaker on agentic coding than Qwen3-Coder or Devstral, which are specifically post-trained for it. Choose Gemma 4 31B IT for open weights and its 262,144 token window rather than for peak coding-agent quality.
Can I keep my source code off third-party servers with Gemma 4 31B IT?
Yes. Atlas can build its code index with local Ollama embeddings, keeping code off third-party servers, and running Gemma 4 31B IT through the same local Ollama endpoint keeps generation local too.

Try Atlas in your terminal

The terminal-native AI coding agent. Free core, single binary.

Install Atlas

Related guides

Atlas for Nim: A Terminal-Native AI Coding Agent for Nimble Packages and Macros in 2026

Atlas is a terminal-native AI coding agent for Nim in 2026. It reads .nimble requires and asterisk-exported symbols, adds std/unittest suites, runs nimble test, formats with nph.

Document a Module with a README Using Atlas (2026 Workflow)

How to document a module with a README using Atlas in 2026: the lsp tool's documentSymbol enumerates the real exports, read supplies the behavior, write emits the README.

Atlas for Pandas: Terminal-Native AI Coding in 2026

Atlas is a terminal-native AI coding agent for Pandas. Vectorize df.apply, fix chained assignment under Copy-on-Write, and pin DataFrames with assert_frame_equal.

Atlas vs Kiro in 2026: Terminal Agent Compared to AWS's Spec-Driven IDE and CLI

Atlas vs Kiro in 2026. Kiro writes EARS-notation specs before code and charges credits; Atlas is a free, open source terminal agent with diff-before-write review.

Atlas for Julia: A Terminal-Native AI Coding Agent for Project.toml Packages in 2026

Atlas is a terminal-native AI coding agent for Julia in 2026. It reads dispatch signatures and Project.toml [deps], fixes type instabilities, runs Pkg.test(), and applies JuliaFormatter.

Add a Regression Test for a Bug Fix with Atlas in 2026

How to add a regression test with Atlas in 2026: red first, then green. bash records the exit code, write creates the failing test, and edit applies the fix.

Research a Third-Party API Before Integrating It with Atlas in 2026

How to research a third-party API with Atlas in 2026: websearch finds the current docs, webfetch pulls the page as markdown or text, and grep checks repo conventions.

Atlas for R: A Terminal-Native AI Coding Agent for tidyverse, roxygen2, and testthat in 2026

Atlas is a terminal-native AI coding agent for R in 2026. It reads roxygen2 docblocks and renv.lock, rewrites loops as dplyr or purrr pipelines, and runs devtools::test().

Browse this resource hub