NVFP4 quantized version of
Jiunsong/supergemma4-26b-abliterated-multimodal — an aggressively abliterated, low-refusal multimodal Gemma 4 model with stronger coding, logic, and tool-use capabilities.
1vllm serve Lna-Lab/SuperGemma4-26B-Abliterated-Multimodal-NVFP4 \
2 --max-model-len 8192
1docker run --gpus '"device=0"' -p 8016:8016 \
2 -v /path/to/model:/models/current:ro \
3 --shm-size 16gb \
4 vllm/vllm-openai:cu130-nightly \
5 vllm serve /models/current --port 8016 --max-model-len 8192
1from vllm import LLM, SamplingParams
2
3llm = LLM(
4 model="Lna-Lab/SuperGemma4-26B-Abliterated-Multimodal-NVFP4",
5 max_model_len=8192,
6 gpu_memory_utilization=0.85,
7)
8
9output = llm.generate(
10 ["Explain quantum entanglement in simple terms."],
11 SamplingParams(max_tokens=256, temperature=0.7),
12)
13print(output[0].outputs[0].text)
1default_stage:
2 default_modifiers:
3 QuantizationModifier:
4 targets: [Linear]
5 ignore: [lm_head, 're:.*embed.*', 're:.*router', 're:.*vision_tower.*']
6 scheme: NVFP4
1from datasets import load_dataset
2from transformers import AutoProcessor, Gemma4ForConditionalGeneration
3from llmcompressor import oneshot
4from llmcompressor.modifiers.quantization import QuantizationModifier
5
6model = Gemma4ForConditionalGeneration.from_pretrained(
7 "Jiunsong/supergemma4-26b-abliterated-multimodal", dtype="auto"
8)
9processor = AutoProcessor.from_pretrained(
10 "Jiunsong/supergemma4-26b-abliterated-multimodal"
11)
12
13recipe = QuantizationModifier(
14 targets="Linear",
15 scheme="NVFP4",
16 ignore=["lm_head", "re:.*embed.*", "re:.*router", "re:.*vision_tower.*"],
17)
18
19ds = load_dataset("neuralmagic/calibration", name="LLM", split="train[:20]")
20
21def preprocess_function(example):
22 messages = [
23 {"role": m["role"], "content": [{"type": "text", "text": m["content"]}]}
24 for m in example["messages"]
25 ]
26 return processor.apply_chat_template(
27 messages, return_tensors="pt", padding=False, truncation=True,
28 max_length=8192, tokenize=True, add_special_tokens=False,
29 return_dict=True, add_generation_prompt=False,
30 )
31
32ds = ds.map(preprocess_function, batched=False, remove_columns=ds.column_names)
33
34import torch
35def data_collator(batch):
36 assert len(batch) == 1
37 return {
38 key: (torch.tensor(value) if key != "pixel_values"
39 else torch.tensor(value, dtype=torch.bfloat16).squeeze(0))
40 for key, value in batch[0].items()
41 }
42
43oneshot(
44 model=model, recipe=recipe, dataset=ds,
45 max_seq_length=8192, num_calibration_samples=20,
46 data_collator=data_collator,
47)
48
49model.save_pretrained("output-NVFP4", save_compressed=True)
50processor.save_pretrained("output-NVFP4")
If you find this model useful, please consider supporting
Jiunsong — the creator of SuperGemma4: