Gemma 4 31B as a coding agent in your terminal

Gemma 4 31B by Google, one of 250+ models you can use in Darce, the open source AI coding agent you can undo.

ModelGemma 4 31B
VendorGoogle
Model idgoogle/gemma-4-31b-it
Context window262k tokens
Price per 1M tokens$0.090 input · $0.34 output (OpenRouter)
Can dotool calling · reads images · reasoning
CategoryOpen weights and budget

Strengths

Google's open-weight Gemma model. Inexpensive, useful for simple tasks.

OpenRouter's description:

Gemma 4 31B Instruct is Google DeepMind's 30.7B dense multimodal model supporting text and image input with text output. Features a 256K token context window, configurable thinking/reasoning mode, native function...

Use Gemma 4 31B as a coding agent in your terminal

Start Darce in your project with Gemma 4 31B:

npm install -g darce-cli
darce --model google/gemma-4-31b-it

Already in a session? Type /model google/gemma-4-31b-it, or open the picker with Ctrl+P. Darce then reads your code, edits files and runs commands with Gemma 4 31B; risky commands ask first, and /undo reverses any change, including what shell commands did. No account yet? npx darce-cli lets you try it free. Which plan includes which models is on the pricing page.

Make it your default or a gear

In ~/.darcerc, set it as the starting model or add it to the gears you move between with Shift+↑ / Shift+↓ (see configuration):

{
  "router": { "default": "google/gemma-4-31b-it" },
  "gears": ["qwen/qwen3-coder", "google/gemma-4-31b-it"]
}

Compare it on your own code

Benchmarks rarely match your repository. Race Gemma 4 31B against two other models on a real task and keep the best diff:

/derby --models google/gemma-4-31b-it,google/gemini-3.1-pro-preview,google/gemini-3.8-flash fix the failing test

Read more about /derby and /swarm.

Related models

All models · Getting started · Claude Code alternative

Model data from OpenRouter, refreshed daily. Prices are OpenRouter's list rates and show relative cost; your Darce allowance is used in proportion to them.