How to Use Gemma 3 12B in opencode
Gemma 3 12B is an instruction-tuned model for document summaries, multilingual drafts, and code explanations. Its 128K-token context supports questions across long source texts.
Prompts to try with Gemma 3 12B in opencode
Copy an example into opencode, or ask in your own words.
Use Gemma 3 12B to explain the authentication flow in this project's relevant files. Trace the entry points, checks, and failure paths, cite file paths, and flag any behavior you cannot establish from the code.
Use Gemma 3 12B to compare the README with the current command-line parser. List documented commands that differ from the implementation and propose corrected wording.
Use Gemma 3 12B to review the selected function and its tests. Propose five additional test cases with inputs, expected results, and the behavior each case checks.
Use Gemma 3 12B to draft release notes from this branch's diff. Separate user-visible changes from internal changes and omit benefits the diff does not establish.
Use Gemma 3 12B to draft Spanish translations for the English interface strings in this project. Preserve interpolation tokens and identifiers, and list phrases that need product context.
How to set up Gemma 3 12B in opencode
Pick the way that suits you. Each takes about two minutes.
Use Spiral's MCP server
- Add the server
Leave out --global to add Spiral to the current project only. No header and no client ID or secret: opencode registers itself with Spiral.
opencode mcp add spiral --global --url https://api.spiral.ai/mcp
- Sign in
Your browser opens. Sign in to Spiral, pick the organization and click Authorize, then return to the terminal. No API key. Inside opencode, /mcps starts the same sign-in.
opencode mcp auth spiral
- Check it
Spiral shows as connected.
opencode mcp list
Use the Spiral skill
- Send opencode 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 3 12B
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-3-12b-it", "input": { "messages": [ { "role": "system" } ] } }'
Then paste one of the prompts above: opencode finds Gemma 3 12B on Spiral, shows the price and runs it.
Gemma 3 12B providers and prices
Spiral runs Gemma 3 12B through OpenRouter. Open a card for today's price, with every fee included.
Up to $0.000803 per run at the default inputs. $0.065 per 1M input tokens, $0.195 per 1M output tokens.
Settings you can ask for
Ask opencode 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 | ||
| Max tokens | 1 to 16384 | The most output tokens to generate. | |
| Temperature | 0 to 2 | ||
| Presence penalty | -2 to 2 | ||
| Frequency penalty | -2 to 2 | ||
| Repetition penalty | 0 to 2 |
Every API field of Google: Gemma 3 12B is on its tool page: open its card above.
What can you do with Gemma 3 12B in opencode?
Turn project code and documentation into explanations, test ideas, and release note drafts with Gemma 3 12B. Give it selected files and a specific question, then check proposed changes against the actual behavior.
Research brief summaries
Turn supplied research text into a short brief with findings, supporting passages, and unanswered questions.
Policy comparison
Compare two policy texts and list changed requirements, exceptions, and passages that need clarification.
Multilingual support drafts
Draft replies in the customer's language using a supplied policy and terminology guide.
Code explanations
Explain supplied functions, trace their inputs and outputs, and identify assumptions worth testing.
Structured request extraction
Convert written requests into structured records, using explicit rules for missing information.
Meeting recaps
Summarize meeting transcripts into decisions, action items, owners, and unresolved questions.
Writing practice
Review a learner's paragraph, explain corrections, and suggest a short follow-up exercise.
Release note drafts
Turn supplied change descriptions into reader-facing release notes, keeping confirmed changes separate from open questions.
More on Gemma 3 12B and opencode
Overview
Gemma 3 12B in other agents
Questions about Gemma 3 12B in opencode
Can opencode use Gemma 3 12B?
Yes. Add Spiral to opencode as an MCP server, and opencode can find and run Gemma 3 12B like any built-in tool.
How much does Gemma 3 12B cost in opencode?
Up to $0.000803 per run at the default inputs. $0.065 per 1M input tokens, $0.195 per 1M output tokens. You pay from your Spiral balance as you go, with no subscription, and a failed run is not charged. Your opencode plan is separate.
Do I need an OpenRouter account to use Gemma 3 12B in opencode?
No. Spiral runs Gemma 3 12B 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 3 12B in opencode?
About two minutes: add the server, then sign in, then check it.
Does opencode wait while Gemma 3 12B runs?
Gemma 3 12B runs in the background. opencode starts the run, checks on it and gives you the text, json when it's ready.
What is Gemma 3 12B useful for?
Use it to summarize long text, answer questions about supplied material, explain code, and draft multilingual content. Give each request a clear deliverable, such as a comparison table or a short explanation.
How much text can Gemma 3 12B work with?
It supports a 128K-token context. Google's current documentation says input tokens reduce the space available for output, so leave room for the response and request long drafts section by section.
Does Gemma 3 12B support languages besides English?
Google reports support for more than 140 languages. Specify the target language, audience, and terms that should stay untranslated.
Can Gemma 3 12B produce structured text?
Yes, Google lists structured outputs among its capabilities. Describe the exact structure, include a completed example, and check the result before using it in another process.
Where does Gemma 3 12B need extra checking?
It can state incorrect or outdated information, and highly complex or open-ended tasks can be challenging. Supply reference material, ask it to flag missing evidence, and verify factual claims against the source.
Start using Gemma 3 12B in opencode
One Spiral account for every tool your agent needs. No subscription; you pay per run.
Paste this into opencode:
set up https://spiral.ai/SKILL.md


