Blog

Gemma 4 Is Now Available in Puter.js

On this page

Puter.js now supports the Gemma 4 family from Google DeepMind — built on the same research foundation as Gemini 3 and released under the Apache 2.0 license. Two models are available: the Gemma 4 31B dense model and the Gemma 4 26B A4B Mixture-of-Experts model.

The Gemma 4 Family

Gemma 4 31B — Dense Flagship

Gemma 4 31B is a dense multimodal model and the most capable in the family. It ranks #3 among all open models globally on the Arena AI text leaderboard. Key highlights:

  • Frontier-Class Benchmarks: 89.2% on AIME 2026, 85.2% on MMLU Pro, 80.0% on LiveCodeBench v6, 84.3% on GPQA Diamond
  • 256K Context Window: Handles large documents, long conversations, and complex multi-step workflows
  • Native Function Calling: Trained-in tool use with structured JSON output and configurable chain-of-thought reasoning
  • Multimodal Input: Accepts text, images, and video natively

Gemma 4 26B A4B — Efficient MoE

Gemma 4 26B A4B is a Mixture-of-Experts model with 26B total parameters but only 3.8B active per forward pass, delivering near-31B quality at a fraction of the compute cost. It ranks #6 among open models on the Arena AI text leaderboard with an estimated LMArena score of 1441.

  • Extreme Efficiency: Near-dense-31B performance while activating only ~15% of parameters
  • 256K Context Window: Same long-context capability as the 31B model
  • Built-in Thinking Mode: Step-by-step reasoning for complex problems
  • Native Function Calling: Agentic tool use with structured output, just like the 31B

Both models support 140+ languages and are released under the Apache 2.0 license.

Examples

Complex reasoning with thinking

const response = await puter.ai.chat(
  "Prove that for any prime p > 3, p^2 - 1 is divisible by 24",
  { model: 'google/gemma-4-31b-it', stream: true }
);

for await (const part of response) {
  if (part?.reasoning) puter.print(part?.reasoning);
  else puter.print(part?.text);
}

Image understanding

puter.ai.chat(
  "Describe what you see in this image and identify any text",
  "https://assets.puter.site/doge.jpeg",
  { model: 'google/gemma-4-26b-a4b-it' }
);

Code generation

puter.ai.chat(
  "Write a Redis-compatible LRU cache in Go with TTL support and concurrent access safety",
  { model: 'google/gemma-4-31b-it' }
);

Structured data extraction

puter.ai.chat(
  "Extract all products, prices, and quantities from this invoice and return structured JSON",
  "https://example.com/invoice.png",
  { model: 'google/gemma-4-26b-a4b-it' }
);

Get Started Now

Just add one library to your project:

// npm install @heyputer/puter.js
import { puter } from '@heyputer/puter.js';

Or add one script tag to your HTML:

<script src="https://js.puter.com/v2/"></script>

No API keys needed. Start building with Gemma 4 immediately.

Learn more:

Free, Serverless AI and Cloud

Start creating powerful web applications with Puter.js in seconds!

Get Started Now

Read the Docs Try the Playground