How to Use Gemma 4 31B in Google Antigravity
Gemma 4 31B suits code fixes, complex questions, and analysis of long documents. Google positions its dense architecture for answer quality, while Gemma 4 26B A4B prioritizes speed.
Prompts to try with Gemma 4 31B in Google Antigravity
Copy an example into Google Antigravity, or ask in your own words.
Use Gemma 4 31B with thinking enabled to trace the failing test through the relevant project files. Propose the smallest fix, apply it, and run the affected tests.
Use Gemma 4 31B to compare the API implementation with the project's documentation. List mismatches with file locations and propose corrections.
Use Gemma 4 31B to review the current diff for incorrect assumptions and missing edge cases. Return findings with file locations, evidence, and suggested regression checks.
Use Gemma 4 31B to explain the request path through this repository. Identify entry points, validation, state changes, and error handling, citing the relevant files.
Use Gemma 4 31B to draft a migration plan from the project's current implementation to the behavior described in its issue. Check dependencies and return ordered steps with verification criteria.
How to set up Gemma 4 31B in Google Antigravity
Pick the way that suits you. Each takes about two minutes.
Use Spiral's MCP server
- Open the MCP config
* Antigravity App: click Customizations, then Installed. In the MCP Servers section, click Copy Config File Path and open that file. * Antigravity IDE: click … at the top of the agent side panel, select MCP Servers, then Manage MCP Servers › View raw config. * Antigravity CLI: edit ~/.gemini/config/mcp_config.json.
- Add the server
Add Spiral under mcpServers:
{ "mcpServers": { "spiral": { "serverUrl": "https://api.spiral.ai/mcp" } } } - Sign in
In the Antigravity App, open Customizations › Installed. Under MCP Servers, click Authenticate next to Spiral. Sign in to Spiral, pick the organization and click Authorize. Copy the authorization code the browser shows, paste it into Enter authorization code and click Submit. No API key.
Use the Spiral skill
- Send Google Antigravity this message
Your agent reads Spiral's skill and sets itself up.
set up https://spiral.ai/SKILL.md
- Sign in or paste a key
Approve Spiral in the browser, or give the agent a key from the console.
Use the Spiral CLI
- Install and sign in
Installs the Spiral CLI, signs you in and adds its skill to your coding agents.
npx -y spiral-cli@latest init
Call the Spiral API
- Create an API key
In the console, under API keys.
- Run Gemma 4 31B
One request; the result comes back by polling or a webhook.
curl https://api.spiral.ai/v1/runs \ -H "Authorization: Bearer $SPIRAL_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: $(uuidgen)" \ -d '{ "provider": "openrouter", "model": "google/gemma-4-31b-it", "input": { "messages": [ { "role": "system" } ] } }'
Then paste one of the prompts above: Google Antigravity finds Gemma 4 31B on Spiral, shows the price and runs it.
Gemma 4 31B providers and prices
Spiral runs Gemma 4 31B through OpenRouter. Open a card for today's price, with every fee included.
Up to $0.00214 per run at the default inputs. $0.26 per 1M input tokens, $0.52 per 1M output tokens.
Settings you can ask for
Ask Google Antigravity for any of these in your prompt.
| Setting | Allowed values | Default | Description |
|---|---|---|---|
| Seed | a whole number | ||
| Min p | 0 to 1 | ||
| Top k | a whole number from 0 | ||
| Top p | 0 to 1 | ||
| Logprobs | on or off | ||
| Max tokens | 1 to 16384 | The most output tokens to generate. | |
| Temperature | 0 to 2 | ||
| Top logprobs | 0 to 20 | ||
| Presence penalty | -2 to 2 | ||
| Frequency penalty | -2 to 2 | ||
| Repetition penalty | 0 to 2 |
Every API field of Google: Gemma 4 31B is on its tool page: open its card above.
What can you do with Gemma 4 31B in Google Antigravity?
Turn project code and documentation into proposed fixes, explanations, and review findings with Gemma 4 31B. Have the coding agent inspect relevant files and verify proposed changes with the project's checks.
Diagnose a code defect
Ask Gemma 4 31B to trace a failing path, propose a small correction, and suggest a regression check.
Compare long documents
Use Gemma 4 31B to compare requirements, identify contradictions, and attach supporting passages to each finding.
Extract structured records
Ask Gemma 4 31B to turn supplied text into JSON records, using null when information is absent.
Draft multilingual responses
Use Gemma 4 31B to draft replies in a requested language while preserving names and approved terminology.
Summarize research
Ask Gemma 4 31B to condense supplied research into findings, disagreements, and unanswered questions.
Check a plan against constraints
Give Gemma 4 31B a proposed plan and explicit constraints, then request conflicts and a revised sequence.
Answer questions from reference text
Use Gemma 4 31B to draft answers grounded in supplied reference material, with evidence for each conclusion.
More on Gemma 4 31B and Google Antigravity
Gemma 4 31B in other agents
More Google Antigravity guides
Questions about Gemma 4 31B in Google Antigravity
Can Google Antigravity use Gemma 4 31B?
Yes. Add Spiral to Google Antigravity as an MCP server, and Google Antigravity can find and run Gemma 4 31B like any built-in tool.
How much does Gemma 4 31B cost in Google Antigravity?
Up to $0.00214 per run at the default inputs. $0.26 per 1M input tokens, $0.52 per 1M output tokens. You pay from your Spiral balance as you go, with no subscription, and a failed run is not charged. Your Google Antigravity plan is separate.
Do I need an OpenRouter account to use Gemma 4 31B in Google Antigravity?
No. Spiral runs Gemma 4 31B on its own OpenRouter account. You sign in to Spiral once and never paste a key.
How long does it take to set up Gemma 4 31B in Google Antigravity?
About two minutes: open the MCP config, then add the server, then sign in.
Does Google Antigravity wait while Gemma 4 31B runs?
Gemma 4 31B runs in the background. Google Antigravity starts the run, checks on it and gives you the text, json when it's ready.
What is Gemma 4 31B useful for?
Use it for code fixes, questions that require reasoning, summaries of long documents, and extracting information into JSON. Google positions the dense 31B model for answer quality.
How much context can Gemma 4 31B handle?
Google specifies a model context window of up to 256K tokens. That describes context capacity, not the length of a single answer.
Can Gemma 4 31B work in languages other than English?
Yes. Google describes Gemma 4 as supporting 140 languages; name the target language and explain which terms, names, or quotations should stay unchanged.
Does Gemma 4 31B have a thinking mode?
Yes. Thinking mode produces reasoning before the final answer; try it for code diagnosis, constraint checking, or questions with several dependent steps.
Which generation settings should I start with?
Google recommends temperature 1.0, nucleus sampling at 0.95, and a top-k value of 64 across use cases. Use those as a baseline before comparing changes on examples from your task.
Start using Gemma 4 31B in Google Antigravity
One Spiral account for every tool your agent needs. No subscription; you pay per run.
Paste this into Google Antigravity:
set up https://spiral.ai/SKILL.md


