Gemma 4 31B
Gemma 4 31B is an open-source model served by Sarvam in beta, and is not tuned for Indian languages. Beta access is granted per API key — contact us to request whitelisting. For Indian language workloads use Sarvam-105B; for document and image understanding in Indian languages, use Sarvam Vision.
A 31B-parameter instruction-tuned model. Its distinguishing feature on Sarvam is image input — it is the only chat model here that accepts images alongside text in the chat completions format.
At a Glance
Why you might use it
Accepts images inline as base64 data URIs in the standard image_url content part, so
you can caption, classify, or answer questions about images.
Not a reasoning model — it replies without a chain-of-thought pass, so the whole token budget goes to the answer.
Model Specifications
- Model ID:
gemma4 - Context window: 131,072 tokens (128K)
- Image input: supported — base64 data URIs only
- Tool calling: supported
- Reasoning: none — answers directly, never returns
reasoning_content, andreasoning_efforthas no effect - Maximum request size: 10 MB (inclusive of encoded images)
- Temperature range: 0 to 2 (unset uses the model’s own default)
- Top-p range: greater than 0, up to 1
- Supports streaming and non-streaming responses
- OpenAI-compatible chat completions format
Each image is estimated at roughly 1,024 tokens when Sarvam checks your request against the context window. Budget for this when sending several images with a long prompt.
Gemma 4 31B vs other options
For document understanding — scanned forms, invoices, PDFs, especially in Indian
languages — use Sarvam Vision,
which is purpose-built for OCR and structured extraction. Use gemma4 for general images
where you want a conversational answer rather than structured document output.
Key Capabilities
Basic Chat Completion
Image Input
Streaming
A text-only single-turn request. Only the model field differs from a Sarvam chat completion call.
Parameters
Gemma 4 31B accepts the standard OpenAI-compatible parameter set — temperature, top_p,
max_tokens, stream, stop, n, seed, frequency_penalty, presence_penalty,
response_format (Structured Outputs), tools, and tool_choice. See the
full parameter table for
types, defaults, and ranges.
Model-specific notes:
- Images must be base64 data URIs — remote
http(s)URLs are rejected. - No reasoning — the model answers directly, never returns
reasoning_content, andreasoning_effortis accepted but has no effect. seedis reproducible — identical seed and parameters return identical output in current serving.- Don’t ask for JSON in the prompt when
response_formatis set — an instruction like “Return JSON” alongside a JSON response format makes the model emit whitespace until it exhaustsmax_tokens, billing the full budget for no usable output. Letresponse_formathandle the shape.
Limits and errors
Common errors for every model on /v2/chat/completions are documented on the
Open-Source Models overview. Gemma-4-specific cases:
Support
Sarvam supports the serving layer — auth, billing, rate limits, availability. Sarvam does not tune or evaluate this model, so its output quality, reasoning, and language coverage are properties of the model itself. See Open-Source Models for the full support boundary, and Talk to us for serving issues.