How to use from the
Use from the
Transformers library
# Use a pipeline as a high-level helper
from transformers import pipeline

pipe = pipeline("text-generation", model="LLMWildling/gemma-4-opencoder-40b-a8b-nvfp4-v2")
messages = [
    {
        "role": "user",
        "content": [
            {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"},
            {"type": "text", "text": "What animal is on the candy?"}
        ]
    },
]
pipe(text=messages)
# Load model directly
from transformers import AutoProcessor, AutoModelForMultimodalLM

processor = AutoProcessor.from_pretrained("LLMWildling/gemma-4-opencoder-40b-a8b-nvfp4-v2")
model = AutoModelForMultimodalLM.from_pretrained("LLMWildling/gemma-4-opencoder-40b-a8b-nvfp4-v2", device_map="auto")
messages = [
    {
        "role": "user",
        "content": [
            {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"},
            {"type": "text", "text": "What animal is on the candy?"}
        ]
    },
]
inputs = processor.apply_chat_template(
	messages,
	add_generation_prompt=True,
	tokenize=True,
	return_dict=True,
	return_tensors="pt",
).to(model.device)

outputs = model.generate(**inputs, max_new_tokens=40)
print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:]))
Quick Links

Gemma 4 OpenCoder 40B-A8B NVFP4 v2

Gemma 4 OpenCoder 40B-A8B v2 is a continued post-trained Gemma 4 coding model focused on agentic software engineering, long-context reasoning, and reliable tool use. It is designed for OpenCode workflows including repository navigation, implementation, editing, debugging, review, and sustained multi-file work.

The checkpoint contains approximately 42.4B text parameters and activates approximately 8.1B text parameters per token. It retains Gemma 4's native 262,144-token context window.

This release is a self-contained NVFP4 / compressed-tensors checkpoint using the standard Gemma 4 architecture. It does not require an adapter or auxiliary model.

Intended use

  • Agentic software engineering
  • OpenCode coding workflows
  • Long-context codebase navigation
  • Reasoning-enabled tool use
  • Multi-file implementation and editing
  • Debugging and code review

Run with reasoning and automatic tool calling enabled, and preserve the checkpoint's included chat template.

Model format

  • Weight format: NVFP4 / compressed-tensors
  • Architecture: Gemma 4 Mixture-of-Experts
  • Total text parameters: approximately 42.4B
  • Active text parameters: approximately 8.1B per token
  • Maximum context: 262,144 tokens

vLLM

Use a recent vLLM release with Gemma 4, compressed-tensors NVFP4, reasoning, and tool-parser support.

vllm serve LLMWildling/gemma-4-opencoder-40b-a8b-nvfp4-v2 \
  --reasoning-parser gemma4 \
  --tool-call-parser gemma4 \
  --enable-auto-tool-choice \
  --max-model-len 262144

For OpenCode, select the served model and keep reasoning and tool calling enabled.

Downloads last month
153
Safetensors
Model size
23B params
Tensor type
BF16
·
U8
·
F8_E4M3
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for LLMWildling/gemma-4-opencoder-40b-a8b-nvfp4-v2

Quantized
(347)
this model