Views
No views yet
vllm serve xdavxd/gemma-4-E2B-it-heretic-NVFP4A16 \
--max-model-len 32768 \
--gpu-memory-utilization 0.50vllm serve xdavxd/gemma-4-E2B-it-heretic-NVFP4A16 \
--max-model-len 32768 \
--gpu-memory-utilization 0.50 \
--enable-auto-tool-choice \
--reasoning-parser gemma4 \
--tool-call-parser gemma4 \
--chat-template examples/tool_chat_template_gemma4.jinja \
--limit-mm-per-prompt '{"image": 4, "audio": 1}' \
--async-schedulingTip: For text-only workloads, pass--limit-mm-per-prompt '{"image": 0, "audio": 0}'to skip vision encoder memory allocation and free up GPU memory for a longer context window.
1from openai import OpenAI
2
3openai_api_key = "EMPTY"
4openai_api_base = "http://<your-server-host>:8001/v1"
5
6client = OpenAI(
7 api_key=openai_api_key,
8 base_url=openai_api_base,
9)
10
11model = "xdavxd/gemma-4-E2B-it-heretic-NVFP4A16"
12
13messages = [
14 {"role": "user", "content": "Explain quantum mechanics clearly and concisely."},
15]
16
17outputs = client.chat.completions.create(
18 model=model,
19 messages=messages,
20)
21
22generated_text = outputs.choices[0].message.content
23print(generated_text)1from transformers import AutoModelForCausalLM, AutoTokenizer
2from llmcompressor import oneshot
3from llmcompressor.modifiers.quantization import QuantizationModifier
4
5MODEL_ID = "./gemma-4-E2B-it-heretic"
6SAVE_DIR = "gemma-4-E2B-it-heretic-NVFP4A16"
7
8model = AutoModelForCausalLM.from_pretrained(MODEL_ID, dtype="auto")
9tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)
10
11recipe = QuantizationModifier(
12 targets="Linear",
13 scheme="NVFP4A16",
14 ignore=["lm_head", "re:.*embed.*", "re:.*vision_tower.*", "re:.*audio_tower.*", "re:.*per_layer.*"],
15)
16
17oneshot(
18 model=model,
19 tokenizer=tokenizer,
20 recipe=recipe,
21)
22
23model.save_pretrained(SAVE_DIR, save_compressed=True)
24tokenizer.save_pretrained(SAVE_DIR)| Metric | This model | Original model (google/gemma-4-E2B-it) |
|---|---|---|
| KL divergence | 0.1651 | 0 (by definition) |
| Refusals | 5/100 | 98/100 |
| Category | Benchmark | google/gemma-4-E2B-it | xdavxd/gemma-4-E2B-it-heretic-NVFP4A16 | Recovery |
|---|---|---|---|---|
| Instruction Following | IFEval (0-shot, prompt-level strict) | - | - | - |
| IFEval (0-shot, inst-level strict) | - | - | - | |
| Reasoning | GSM8K Platinum (flexible-extract) | - | - | - |
| GSM8K Platinum (strict-match) | - | - | - | |
| MATH-500 (0-shot, pass@1) | - | - | - |
sudo docker run --rm -it \
--gpus all \
--ipc=host \
--network host \
-v ~/quant-workspace/gemma-4-E2B-it-heretic-NVFP4A16:/models/heretic:ro \
-v ~/.cache/huggingface:/root/.cache/huggingface \
-e VLLM_USE_V2_MODEL_RUNNER=1 \
ghcr.io/timothystewart6/vllm-gb10:latest \
vllm serve /models/heretic \
--host 0.0.0.0 --port 8001 \
--served-model-name heretic \
--max-model-len 69632 \
--gpu-memory-utilization 0.50 \
--enable-auto-tool-choice \
--reasoning-parser gemma4 \
--tool-call-parser gemma4 \
--limit-mm-per-prompt '{"image":0,"audio":0}' \
--kv-cache-dtype fp8 \
--max-num-seqs 32 \
--async-schedulingfor SEED in 1234 2345 3456; do
lm_eval --model local-chat-completions \
--tasks gsm8k_platinum_cot_llama \
--model_args "model=heretic,max_length=36096,base_url=http://0.0.0.0:8001/v1/chat/completions,num_concurrent=32,max_retries=3,tokenized_requests=False,tokenizer_backend=None,timeout=2400" \
--num_fewshot 0 \
--apply_chat_template \
--output_path "results_gsm8k_seed${SEED}.json" \
--seed $SEED \
--gen_kwargs "do_sample=True,temperature=1.0,top_p=0.95,top_k=64,max_gen_toks=32000,seed=${SEED}"
echo "Seed $SEED complete"
donefor SEED in 1234 2345 3456; do
lm_eval --model local-chat-completions \
--tasks ifeval \
--model_args "model=heretic,max_length=36096,base_url=http://0.0.0.0:8001/v1/chat/completions,num_concurrent=32,max_retries=3,tokenized_requests=False,tokenizer_backend=None,timeout=2400" \
--num_fewshot 0 \
--apply_chat_template \
--output_path "results_ifeval_seed${SEED}.json" \
--seed $SEED \
--gen_kwargs "do_sample=True,temperature=1.0,top_p=0.95,top_k=64,max_gen_toks=32000,seed=${SEED}"
echo "IFEval seed $SEED complete"
done1model_parameters:
2 provider: hosted_vllm
3 model_name: hosted_vllm/heretic
4 base_url: http://0.0.0.0:8001/v1
5 api_key: ''
6 timeout: 3600
7 concurrent_requests: 32
8 generation_parameters:
9 temperature: 1.0
10 max_new_tokens: 65536
11 top_p: 0.95
12 top_k: 64
13 seed: 1234# MATH-500 (3 seeds)
for SEED in 1234 2345 3456; do
sed -i "s/seed: .*/seed: $SEED/" litellm_config.yaml
lighteval endpoint litellm litellm_config.yaml 'math_500|0' \
--output-dir "results_math500_seed${SEED}/" --save-details
echo "MATH-500 seed $SEED complete"
done