Choose Google: Gemma 4 31B if…
- you want to prototype at zero cost — a free variant is listed
Neither wins outright: Google: Gemma 4 31B is the pick when you want to prototype at zero cost, PrismML: Ternary Bonsai 2 9B when cost matters at scale.
| Spec | Google: Gemma 4 31B | PrismML: Ternary Bonsai 2 9B |
|---|---|---|
| Provider | Prism ML | |
| Input price (per 1M tokens) | $0.20 | $0.08 |
| Output price (per 1M tokens) | $0.40 | $0.13 |
| Blended price (3:1 input/output) | $0.25 | $0.09 |
| Cheaper than … of all models we track | 66% | 82% |
| Context window | 262K tokens (~393 pages) | 262K tokens (~393 pages) |
| Larger context than … of all models | 47% | 47% |
| Max output per response | 16K tokens (~12,300 words) | 66K tokens (~49,200 words) |
| Input types | image, text, video | text, image |
| Output types | text | text |
| Free variant | Yes | No |
| Listed since | 2026-04-02 | 2026-10-16 |
Monthly cost at list price for five common workloads. Token counts per unit are stated so you can scale them to your own traffic. A workload that does not fit a model's context window is marked rather than priced.
| Workload (per month) | Google: Gemma 4 31B | PrismML: Ternary Bonsai 2 9B | Difference |
|---|---|---|---|
| Customer-support chatbot 50,000 conversations — each a 6-turn conversation (1,500 in / 400 out tokens) | $23.00 | $8.60 | PrismML: Ternary Bonsai 2 9B saves $14.40 |
| RAG search over documents 20,000 questions — each a question answered from ~8 retrieved passages (6,000 in / 500 out tokens) | $28.00 | $10.90 | PrismML: Ternary Bonsai 2 9B saves $17.10 |
| Coding / tool-using agent 2,000 tasks — each a multi-step task with tool calls and file context (60,000 in / 6,000 out tokens) | $28.80 | $11.16 | PrismML: Ternary Bonsai 2 9B saves $17.64 |
| Batch summarisation 10,000 documents — each a 6,000-word report summarised to a page (8,000 in / 600 out tokens) | $18.40 | $7.18 | PrismML: Ternary Bonsai 2 9B saves $11.22 |
| Long-document analysis 500 documents — each a 150-page contract or codebase read in one pass (100,000 in / 2,000 out tokens) | $10.40 | $4.13 | PrismML: Ternary Bonsai 2 9B saves $6.27 |
| Capability | Google: Gemma 4 31B | PrismML: Ternary Bonsai 2 9B | What it lets you do |
|---|---|---|---|
| Tool / function calling | ✓ Yes | ✓ Yes | call your APIs and run agent loops |
| Structured output (JSON schema) | ✓ Yes | ✓ Yes | return JSON that validates against your schema |
| Reasoning / thinking mode | ✓ Yes | ✓ Yes | spend extra tokens thinking before answering hard problems |
| Image input | ✓ Yes | ✓ Yes | read screenshots, charts and scanned pages |
| Audio input | — | — | take speech or audio directly |
| File / PDF input | — | — | accept documents without your own parsing step |
| Image output | — | — | generate images, not just text |
| Built-in web search | — | — | answer from live web results |
| Seed (reproducible sampling) | ✓ Yes | ✓ Yes | repeat a generation for tests and evals |
| Log-probabilities | ✓ Yes | ✓ Yes | read token confidence for classification and scoring |
From each model's published parameters and input/output types. “—” means not advertised, not proven absent.
| Date | Model | Input / 1M | Output / 1M |
|---|---|---|---|
| 2026-10-27 | Google: Gemma 4 31B | $0.20 | $0.40 |
| 2026-10-26 | Google: Gemma 4 31B | $0.10 | $0.34 |
| 2026-10-15 | Google: Gemma 4 31B | $0.20 | $0.40 |
| 2026-08-27 | Google: Gemma 4 31B | $0.09 | $0.34 |
| 2026-08-21 | Google: Gemma 4 31B | $0.10 | $0.34 |
| 2026-08-19 | Google: Gemma 4 31B | $0.09 | $0.34 |
Neither wins outright: Google: Gemma 4 31B is the pick when you want to prototype at zero cost, PrismML: Ternary Bonsai 2 9B when cost matters at scale. In short: Google: Gemma 4 31B when you want to prototype at zero cost; PrismML: Ternary Bonsai 2 9B when cost matters at scale, you generate long outputs in one go, you want the newer model.
PrismML: Ternary Bonsai 2 9B is cheaper: $0.09 vs $0.25 per 1M tokens at a typical 3:1 input/output mix, 63% less. For 50,000 support conversations a month that is $8.60 against $23.00.
Google: Gemma 4 31B costs $0.20 per 1M input tokens and $0.40 per 1M output tokens; PrismML: Ternary Bonsai 2 9B costs $0.08 input and $0.13 output. Output tokens are billed separately, so long answers shift the gap.
Both take 262K tokens per request — roughly 393 pages of text.
Tool calling — Google: Gemma 4 31B: yes, PrismML: Ternary Bonsai 2 9B: yes. JSON-schema structured output — Google: Gemma 4 31B: yes, PrismML: Ternary Bonsai 2 9B: yes.
Yes, both accept image input.
Google: Gemma 4 31B has a free variant (google/gemma-4-31b-it:free). Free variants usually carry tighter rate limits.
Google: Gemma 4 31B can write up to 16K tokens (about 12,300 words) per response; PrismML: Ternary Bonsai 2 9B up to 66K (about 49,200 words).
Google: Gemma 4 31B was listed on 2026-04-02; PrismML: Ternary Bonsai 2 9B on 2026-10-16.
Google: Gemma 4 31B: input price raised 50% ($0.10 → $0.20/1M), output price raised 15% ($0.34 → $0.40/1M) on 2026-10-27 (6 price changes since 2026-08-06). PrismML: Ternary Bonsai 2 9B: price unchanged since we started tracking it on 2026-10-28.
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...
Full Google: Gemma 4 31B specs →Ternary Bonsai 2 9B is PrismML’s compact, open-weight language model for conversational AI, reasoning, and tool use. Built on Qwen3.5, it uses ternary weights packed into 2 bits for efficient...
Full PrismML: Ternary Bonsai 2 9B specs →