Open-source inference server and production cluster for all the models your agent needs.
Python bgecolbertdata-pipelinedeep-learningembeddingsinferenceinference-serverinformation-retrievalllmmlmlopsnatural-language-processingnlppythonrerankingretrievalretrieval-augmented-generationsemantic-searchspladevector-search
sie_id: google/gemma-4-31B-it
hf_id: google/gemma-4-31B-it
hf_revision: 842da3794eaa0b77d5f08bae87a17459d91ff475
# Gemma 4 dense 31B is served by the shared ``sglang-cu130`` bundle
# (SGLang 0.5.13 / transformers 5.8 / CUDA 13). The BF16 checkpoint is
# 58.25 GiB, so the requested single-H100-80GB shape uses SGLang online FP8
# weight quantization while retaining the checkpoint's bfloat16 compute dtype.
# This leaves activation/KV headroom without introducing a one-model bundle.
inputs:
text: true
image: true
audio: false
video: false
tasks:
generate:
# Native context is 262,144 tokens. Keep the bare served contract at 8K
# and expose the native-window candidates through explicit profiles below.
context_length: 8192
max_output_tokens: 4096
# Frozen-KV MTP is not used for constrained decoding. Route grammar
# requests to the matching non-speculative H100 sibling below.
grammar_profile: no-spec
capabilities:
grammar: ["json_schema", "regex"]
streaming: true
tools: true
chat_template_kwargs:
enable_thinking: false
max_sequence_length: 8192
profiles:
# Bare-id serving defaults to the measured H100-80GB FP8 + paired-MTP shape.
# Three verification steps and four draft tokens preserve the assistant's
# near-perfect acceptance while avoiding the prompt-sensitive tail measured
# with the deeper 5/6 and 8/9 settings.
default:
max_batch_tokens: 16384
compute_precision: bfloat16
adapter_path: sie_server.adapters.sglang.gemma:SGLangGemmaAdapter
kv_budget_tokens: 8192
adapter_options:
loadtime:
mem_fraction_static: 0.80
served_model_name: google/gemma-4-31B-it
attention_backend: triton
grammar_backend: xgrammar
reasoning_parser: gemma4
tool_call_parser: gemma4
speculative_needs_extra_buffer: false
speculative:
enabled: true
algorithm: nextn
num_steps: 3
eagle_topk: 1
num_draft_tokens: 4
draft_model: google/gemma-4-31B-it-assistant
draft_model_revision: 627c5ec1458b9086b841a91e0512fd31fd2fbbf1
extra_launch_args:
- "--quantization"
- "fp8"
runtime:
first_chunk_timeout_s: 90
inter_chunk_timeout_s: 15
overall_timeout_s: 600
# Official Gemma 4 non-thinking sampling recipe.
default_sampling:
temperature: 1.0
top_p: 0.95
top_k: 64
min_new_tokens: 1
stop_tokens:
- "<end_of_turn>"
# Grammar-safe sibling of the bare H100 profile. Keep the complete load-time
# block because extending profiles replace, rather than merge, that block.
no-spec:
extends: default
adapter_options:
loadtime:
mem_fraction_static: 0.80
served_model_name: google/gemma-4-31B-it
attention_backend: triton
grammar_backend: xgrammar
reasoning_parser: gemma4
tool_call_parser: gemma4
speculative_needs_extra_buffer: false
speculative:
enabled: false
extra_launch_args:
- "--quantization"
- "fp8"
# Caller-visible FP8 alias; select the H100-80GB machine profile separately.
h100-fp8:
extends: default
# Gemma 4 supports an explicit tokenizer thinking switch. Use the measured
# H100 96K shape so the generic reasoning alias has the same decode budget as
# its hardware-explicit twin; the bare route remains answer-only.
thinking:
extends: h100-96k-thinking
grammar_profile: h100-96k-thinking-no-spec
# Explicit native-window shape for one H200 admission. Keep the profile
# standalone so the thinking and hardware-explicit aliases can inherit the
# exact CUDA 13 launch shape without profile chaining. Online FP8 limits
# weight memory, and FP8 E4M3 limits KV memory; the release gate separately
# validates near-boundary decode and quality instead of weakening the
# conservative bare-model contract.
long-context:
max_batch_tokens: 262144
compute_precision: bfloat16
adapter_path: sie_server.adapters.sglang.gemma:SGLangGemmaAdapter
grammar_profile: long-context-no-spec
kv_budget_tokens: 262144
adapter_options:
loadtime:
max_seq_length: 262144
# Leave transient FP8 GEMM workspace outside SGLang's static pool.
mem_fraction_static: 0.90
served_model_name: google/gemma-4-31B-it
attention_backend: triton
grammar_backend: xgrammar
reasoning_parser: gemma4
tool_call_parser: gemma4
speculative_needs_extra_buffer: false
speculative:
enabled: true
algorithm: nextn
num_steps: 3
eagle_topk: 1
num_draft_tokens: 4
draft_model: google/gemma-4-31B-it-assistant
draft_model_revision: 627c5ec1458b9086b841a91e0512fd31fd2fbbf1
extra_launch_args:
- "--quantization"
- "fp8"
- "--kv-cache-dtype"
- "fp8_e4m3"
runtime:
first_chunk_timeout_s: 900
inter_chunk_timeout_s: 30
overall_timeout_s: 1800
default_sampling:
temperature: 1.0
top_p: 0.95
top_k: 64
min_new_tokens: 1
stop_tokens:
- "<end_of_turn>"
# Grammar-safe twin of the measured H200 256K launch. Frozen-KV MTP is the
# only load-time difference because constrained decode must use the grammar
# FSM on every emitted token.
long-context-no-spec:
extends: long-context
adapter_options:
loadtime:
max_seq_length: 262144
mem_fraction_static: 0.90
served_model_name: google/gemma-4-31B-it
attention_backend: triton
grammar_backend: xgrammar
reasoning_parser: gemma4
tool_call_parser: gemma4
speculative_needs_extra_buffer: false
speculative:
enabled: false
extra_launch_args:
- "--quantization"
- "fp8"
- "--kv-cache-dtype"
- "fp8_e4m3"
# Keep the thinking route standalone so it can retain its larger output cap
# while using the same measured paired-MTP launch as the non-thinking route.
long-context-thinking:
grammar_profile: long-context-thinking-no-spec
# The 4K control truncated otherwise-correct reasoning on 2/10 MMLU-Pro
# rows. A 32K cap leaves ample room for the final answer without changing
# the profile's sampling defaults or forcing callers to request it.
max_output_tokens: 32768
max_batch_tokens: 262144
compute_precision: bfloat16
adapter_path: sie_server.adapters.sglang.gemma:SGLangGemmaAdapter
kv_budget_tokens: 262144
chat_template_kwargs:
enable_thinking: true
adapter_options:
loadtime:
max_seq_length: 262144
mem_fraction_static: 0.90
served_model_name: google/gemma-4-31B-it
attention_backend: triton
grammar_backend: xgrammar
reasoning_parser: gemma4
tool_call_parser: gemma4
speculative_needs_extra_buffer: false
speculative:
enabled: true
algorithm: nextn
num_steps: 3
eagle_topk: 1
num_draft_tokens: 4
draft_model: google/gemma-4-31B-it-assistant
draft_model_revision: 627c5ec1458b9086b841a91e0512fd31fd2fbbf1
extra_launch_args:
- "--quantization"
- "fp8"
- "--kv-cache-dtype"
- "fp8_e4m3"
runtime:
first_chunk_timeout_s: 900
inter_chunk_timeout_s: 30
overall_timeout_s: 1800
default_sampling:
temperature: 1.0
top_p: 0.95
top_k: 64
min_new_tokens: 1
stop_tokens:
- "<end_of_turn>"
long-context-thinking-no-spec:
max_output_tokens: 32768
max_batch_tokens: 262144
compute_precision: bfloat16
adapter_path: sie_server.adapters.sglang.gemma:SGLangGemmaAdapter
kv_budget_tokens: 262144
chat_template_kwargs:
enable_thinking: true
adapter_options:
loadtime:
max_seq_length: 262144
mem_fraction_static: 0.90
served_model_name: google/gemma-4-31B-it
attention_backend: triton
grammar_backend: xgrammar
reasoning_parser: gemma4
tool_call_parser: gemma4
speculative_needs_extra_buffer: false
speculative:
enabled: false
extra_launch_args:
- "--quantization"
- "fp8"
- "--kv-cache-dtype"
- "fp8_e4m3"
runtime:
first_chunk_timeout_s: 900
inter_chunk_timeout_s: 30
overall_timeout_s: 1800
default_sampling:
temperature: 1.0
top_p: 0.95
top_k: 64
min_new_tokens: 1
stop_tokens:
- "<end_of_turn>"
# H200 has enough memory for the native window. These aliases expose the
# tested hardware/context pairing while machine placement remains separate.
h200-256k:
extends: long-context
grammar_profile: long-context-no-spec
h200-256k-thinking:
extends: long-context-thinking
grammar_profile: long-context-thinking-no-spec
# On H100-80GB this MTP launch shape measured a 108,896-token KV capacity.
# Cap the public profile at 96K to leave room for the chat template and
# decode; never use SGLang auto-truncation to simulate a larger accepted
# context.
h100-96k:
max_batch_tokens: 98304
compute_precision: bfloat16
adapter_path: sie_server.adapters.sglang.gemma:SGLangGemmaAdapter
grammar_profile: h100-96k-no-spec
kv_budget_tokens: 98304
adapter_options:
loadtime:
max_seq_length: 98304
mem_fraction_static: 0.90
served_model_name: google/gemma-4-31B-it
attention_backend: triton
grammar_backend: xgrammar
reasoning_parser: gemma4
tool_call_parser: gemma4
speculative_needs_extra_buffer: false
speculative:
enabled: true
algorithm: nextn
num_steps: 3
eagle_topk: 1
num_draft_tokens: 4
draft_model: google/gemma-4-31B-it-assistant
draft_model_revision: 627c5ec1458b9086b841a91e0512fd31fd2fbbf1
extra_launch_args:
- "--quantization"
- "fp8"
- "--kv-cache-dtype"
- "fp8_e4m3"
runtime:
first_chunk_timeout_s: 900
inter_chunk_timeout_s: 30
overall_timeout_s: 1800
default_sampling:
temperature: 1.0
top_p: 0.95
top_k: 64
min_new_tokens: 1
stop_tokens:
- "<end_of_turn>"
h100-96k-no-spec:
extends: h100-96k
adapter_options:
loadtime:
max_seq_length: 98304
mem_fraction_static: 0.90
served_model_name: google/gemma-4-31B-it
attention_backend: triton
grammar_backend: xgrammar
reasoning_parser: gemma4
tool_call_parser: gemma4
speculative_needs_extra_buffer: false
speculative:
enabled: false
extra_launch_args:
- "--quantization"
- "fp8"
- "--kv-cache-dtype"
- "fp8_e4m3"
h100-96k-thinking:
grammar_profile: h100-96k-thinking-no-spec
max_output_tokens: 32768
max_batch_tokens: 98304
compute_precision: bfloat16
adapter_path: sie_server.adapters.sglang.gemma:SGLangGemmaAdapter
kv_budget_tokens: 98304
chat_template_kwargs:
enable_thinking: true
adapter_options:
loadtime:
max_seq_length: 98304
mem_fraction_static: 0.90
served_model_name: google/gemma-4-31B-it
attention_backend: triton
grammar_backend: xgrammar
reasoning_parser: gemma4
tool_call_parser: gemma4
speculative_needs_extra_buffer: false
speculative:
enabled: true
algorithm: nextn
num_steps: 3
eagle_topk: 1
num_draft_tokens: 4
draft_model: google/gemma-4-31B-it-assistant
draft_model_revision: 627c5ec1458b9086b841a91e0512fd31fd2fbbf1
extra_launch_args:
- "--quantization"
- "fp8"
- "--kv-cache-dtype"
- "fp8_e4m3"
runtime:
first_chunk_timeout_s: 900
inter_chunk_timeout_s: 30
overall_timeout_s: 1800
default_sampling:
temperature: 1.0
top_p: 0.95
top_k: 64
min_new_tokens: 1
stop_tokens:
- "<end_of_turn>"
h100-96k-thinking-no-spec:
max_output_tokens: 32768
max_batch_tokens: 98304
compute_precision: bfloat16
adapter_path: sie_server.adapters.sglang.gemma:SGLangGemmaAdapter
kv_budget_tokens: 98304
chat_template_kwargs:
enable_thinking: true
adapter_options:
loadtime:
max_seq_length: 98304
mem_fraction_static: 0.90
served_model_name: google/gemma-4-31B-it
attention_backend: triton
grammar_backend: xgrammar
reasoning_parser: gemma4
tool_call_parser: gemma4
speculative_needs_extra_buffer: false
speculative:
enabled: false
extra_launch_args:
- "--quantization"
- "fp8"
- "--kv-cache-dtype"
- "fp8_e4m3"
runtime:
first_chunk_timeout_s: 900
inter_chunk_timeout_s: 30
overall_timeout_s: 1800
default_sampling:
temperature: 1.0
top_p: 0.95
top_k: 64
min_new_tokens: 1
stop_tokens:
- "<end_of_turn>"
# Document-reading variant of ``h100-96k``: the same H100 launch with a
# larger per-image vision budget. SGLang passes ``--mm-process-config``
# ``image`` entries to the Hugging Face processor as ``images_kwargs``, and
# the Gemma 4 image processor accepts ``max_soft_tokens`` in
# {70, 140, 280, 560, 1120}. The checkpoint default of 280 encodes a dense
# full-page scan in about 260 visual tokens; 1120, the largest supported
# budget, reads it at roughly twice the linear resolution. 1120 stays below
# the worker's 1,280-token per-image reservation, so admission is unchanged.
# Answer-only (``enable_thinking: false``) with the bare 4,096-token output
# cap, like ``h100-96k``.
# The hi-res family also compiles JSON-schema grammars without free
# whitespace (``--constrained-json-disable-any-whitespace``) and bounds each
# JSON number to 19 integer and 19 fractional digits
# (``json_number_max_digits``), as the Qwen3.8 and Qwen3.6-35B profiles do.
# With free whitespace a third of greedy page extractions carried newlines or
# stray spaces, and a speculative decode filled one reply's 8,192-token cap
# with whitespace. Compact replies stay valid under the same schema; on 222
# page extractions the score was unchanged within run-to-run noise while
# output tokens fell 9% and GPU-seconds per request up to 11%.
# ``mem_fraction_static`` is 0.85 on the answer-only hi-res launches. SGLang's
# fast image processor resizes each page on the serving GPU from the
# tokenizer process, outside the static pool. With 32 to 64 full-page
# documents in flight on an 80 GB H100, those resizes hit CUDA OOM and failed
# requests at 0.90, and still in a 32-page burst at 0.88; at 0.85 the same
# bursts completed without errors. The H100 KV pool shrinks from about
# 107.9K to 96.5K tokens.
h100-96k-hires:
max_batch_tokens: 98304
compute_precision: bfloat16
adapter_path: sie_server.adapters.sglang.gemma:SGLangGemmaAdapter
grammar_profile: h100-96k-hires-no-spec
kv_budget_tokens: 98304
adapter_options:
loadtime:
max_seq_length: 98304
mem_fraction_static: 0.85
served_model_name: google/gemma-4-31B-it
attention_backend: triton
grammar_backend: xgrammar
json_number_max_digits: 19
reasoning_parser: gemma4
tool_call_parser: gemma4
speculative_needs_extra_buffer: false
speculative:
enabled: true
algorithm: nextn
num_steps: 3
eagle_topk: 1
num_draft_tokens: 4
draft_model: google/gemma-4-31B-it-assistant
draft_model_revision: 627c5ec1458b9086b841a91e0512fd31fd2fbbf1
extra_launch_args:
- "--quantization"
- "fp8"
- "--kv-cache-dtype"
- "fp8_e4m3"
- "--mm-process-config"
- '{"image":{"max_soft_tokens":1120}}'
- "--constrained-json-disable-any-whitespace"
runtime:
first_chunk_timeout_s: 900
inter_chunk_timeout_s: 30
overall_timeout_s: 1800
default_sampling:
temperature: 1.0
top_p: 0.95
top_k: 64
min_new_tokens: 1
stop_tokens:
- "<end_of_turn>"
h100-96k-hires-no-spec:
extends: h100-96k-hires
adapter_options:
loadtime:
max_seq_length: 98304
mem_fraction_static: 0.85
served_model_name: google/gemma-4-31B-it
attention_backend: triton
grammar_backend: xgrammar
json_number_max_digits: 19
reasoning_parser: gemma4
tool_call_parser: gemma4
speculative_needs_extra_buffer: false
speculative:
enabled: false
extra_launch_args:
- "--quantization"
- "fp8"
- "--kv-cache-dtype"
- "fp8_e4m3"
- "--mm-process-config"
- '{"image":{"max_soft_tokens":1120}}'
- "--constrained-json-disable-any-whitespace"
# ``h100-96k-hires`` with a longer answer budget. The profile-level
# ``max_output_tokens`` raises the bare 4,096-token cap to 8,192, because
# extracting every row of a dense multi-column page can need more than 4,096
# answer tokens. The launch, image budget and answer-only mode are unchanged.
# Like ``h100-96k-no-spec``, the grammar sibling extends the speculative
# profile and restates the full load-time block (profile chaining is not
# allowed).
h100-96k-hires-out8k:
extends: h100-96k-hires
grammar_profile: h100-96k-hires-out8k-no-spec
max_output_tokens: 8192
h100-96k-hires-out8k-no-spec:
extends: h100-96k-hires
max_output_tokens: 8192
adapter_options:
loadtime:
max_seq_length: 98304
mem_fraction_static: 0.85
served_model_name: google/gemma-4-31B-it
attention_backend: triton
grammar_backend: xgrammar
json_number_max_digits: 19
reasoning_parser: gemma4
tool_call_parser: gemma4
speculative_needs_extra_buffer: false
speculative:
enabled: false
extra_launch_args:
- "--quantization"
- "fp8"
- "--kv-cache-dtype"
- "fp8_e4m3"
- "--mm-process-config"
- '{"image":{"max_soft_tokens":1120}}'
- "--constrained-json-disable-any-whitespace"
# Repeat the full non-speculative launch because load-time overrides
# replace the parent's block rather than merging it.
# ``mem_fraction_static`` is 0.88 here, not the answer-only 0.85. Thinking
# requests are long, so a lane runs many at once, and a burst of screenshot
# prefills needs more activation memory than 0.90 leaves on an 80 GB H100.
# With 32 image requests in flight at 0.90, SGLang hit CUDA OOM in the vision
# path and failed requests; at 0.88 the same burst completed cleanly. The KV
# pool shrinks from about 107.9K to 103.4K tokens.
# ``schema_in_prompt: false`` keeps a ``json_schema`` response format out of
# the prompt on the two screenshot profiles. The grammar still constrains the
# answer, and a request that sends ``schema_in_prompt: true`` gets the
# section back. On the 25 fixed public-app screenshot fixtures, whose prompts
# do not contain their schema, both profiles scored 23/25 screens fully right
# with the section: FF12 ``transaction_type`` came back as the form's helper
# sentence and FF15 ``attachments`` as null. With this switch, on the same
# code and GPU, the 512-token profile scored 25/25. The Screenshot DEV24
# prompts contain their schema, so the section is never added there.
# Evidence: Hugging Face dataset ``superlinked/sie-task-evidence``, under
# ``evaluations/2026-10-11/screenshot-dev24-gemma4-serving-v1/results/``,
# ``amendment-5-fixtures25`` and ``amendment-6-fixtures25-noschema``.
# The runtime block restates ``h100-96k-hires`` in full because, like the
# load-time block, a profile's runtime block replaces its parent's.
h100-96k-hires-thinking-no-spec:
extends: h100-96k-hires
max_output_tokens: 32768
chat_template_kwargs:
enable_thinking: true
adapter_options:
loadtime:
max_seq_length: 98304
mem_fraction_static: 0.88
served_model_name: google/gemma-4-31B-it
attention_backend: triton
grammar_backend: xgrammar
json_number_max_digits: 19
reasoning_parser: gemma4
tool_call_parser: gemma4
speculative_needs_extra_buffer: false
speculative:
enabled: false
extra_launch_args:
- "--quantization"
- "fp8"
- "--kv-cache-dtype"
- "fp8_e4m3"
- "--mm-process-config"
- '{"image":{"max_soft_tokens":1120}}'
- "--constrained-json-disable-any-whitespace"
runtime:
first_chunk_timeout_s: 900
inter_chunk_timeout_s: 30
overall_timeout_s: 1800
default_sampling:
temperature: 1.0
top_p: 0.95
top_k: 64
min_new_tokens: 1
stop_tokens:
- "<end_of_turn>"
schema_in_prompt: false
# ``h100-96k-hires-thinking-no-spec`` with private reasoning capped at 512
# tokens: the adapter closes the thought channel there and the json_schema
# grammar then constrains the answer. The launch is otherwise identical, so
# grammar requests keep this profile. On the 24 Screenshot DEV24 screens
# (two passes per run, default sampling) two 512-token runs scored 32/48
# complete records at 96.9% of fields and 30/48 at 96.1%, against 32/48 at
# 96.9% uncapped, with about 45% fewer output tokens per screen.
# It keeps the schema out of the prompt for the reason given on that profile.
h100-96k-hires-thinking-budget512-no-spec:
extends: h100-96k-hires
max_output_tokens: 32768
chat_template_kwargs:
enable_thinking: true
adapter_options:
loadtime:
max_seq_length: 98304
mem_fraction_static: 0.88
thinking_budget: 512
served_model_name: google/gemma-4-31B-it
attention_backend: triton
grammar_backend: xgrammar
json_number_max_digits: 19
reasoning_parser: gemma4
tool_call_parser: gemma4
speculative_needs_extra_buffer: false
speculative:
enabled: false
extra_launch_args:
- "--quantization"
- "fp8"
- "--kv-cache-dtype"
- "fp8_e4m3"
- "--mm-process-config"
- '{"image":{"max_soft_tokens":1120}}'
- "--constrained-json-disable-any-whitespace"
runtime:
first_chunk_timeout_s: 900
inter_chunk_timeout_s: 30
overall_timeout_s: 1800
default_sampling:
temperature: 1.0
top_p: 0.95
top_k: 64
min_new_tokens: 1
stop_tokens:
- "<end_of_turn>"
schema_in_prompt: false