Instructions to use CocaKova/Agnes-3.0-Flash-Preview-NVFP4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use CocaKova/Agnes-3.0-Flash-Preview-NVFP4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="CocaKova/Agnes-3.0-Flash-Preview-NVFP4") 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)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("CocaKova/Agnes-3.0-Flash-Preview-NVFP4") model = AutoModelForMultimodalLM.from_pretrained("CocaKova/Agnes-3.0-Flash-Preview-NVFP4", 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=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use CocaKova/Agnes-3.0-Flash-Preview-NVFP4 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "CocaKova/Agnes-3.0-Flash-Preview-NVFP4" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "CocaKova/Agnes-3.0-Flash-Preview-NVFP4", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/CocaKova/Agnes-3.0-Flash-Preview-NVFP4
- SGLang
How to use CocaKova/Agnes-3.0-Flash-Preview-NVFP4 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "CocaKova/Agnes-3.0-Flash-Preview-NVFP4" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "CocaKova/Agnes-3.0-Flash-Preview-NVFP4", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "CocaKova/Agnes-3.0-Flash-Preview-NVFP4" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "CocaKova/Agnes-3.0-Flash-Preview-NVFP4", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use CocaKova/Agnes-3.0-Flash-Preview-NVFP4 with Docker Model Runner:
docker model run hf.co/CocaKova/Agnes-3.0-Flash-Preview-NVFP4
Agnes-3.0-Flash-Preview-NVFP4
NVFP4 (W4A4, group 16) build of Agnes-AI/Agnes-3.0-Flash (the open-weight Preview checkpoint, released 2026-09-11). Quantized on a single NVIDIA DGX Spark (GB10) with llm-compressor.
61.6 GiB โ 22.0 GiB. Runs on one DGX Spark in stock vLLM with vision and the MTP draft head intact.
What was done
- Folded to a stock Qwen3.5 graph. Agnes-3.0-Flash is Qwen3.5-27B's architecture (gated delta rule 3:1 with gated full attention, mRoPE, same vision tower, one MTP layer) with 72 layers and one addition: a second, narrower SwiGLU per layer (
parallel_ffn, 2048 wide) whose output is added to the main MLP. Adding two SwiGLUs on the same input is one wider SwiGLU, so gate/up were concatenated along the output dim, down along the input dim, andintermediate_sizebecame 17408 + 2048 = 19456. The rename (delta_attnโlinear_attn,global_attnโself_attn) is the same one the model's bundled SGLang patch applies at load time. Result:Qwen3_5ForConditionalGeneration, notrust_remote_code. - Verified the fold against the original modeling code: teacher-forced logits on the same 242 tokens, original checkpoint through its bundled
modeling_agnes.py(transformers 5.12.1) vs the folded checkpoint through stockQwen3_5ForConditionalGeneration(transformers 5.10.1): mean KL 5.0e-3, argmax agreement 99.2%, perplexity 164.3 vs 163.0. Same fold the bundled SGLang patch applies at load time. - Quantized with llm-compressor
NVFP4(weights + activations FP4, per-group-16 FP8 scales), 32 ร 4096-token calibration samples from ultrachat_200k. Kept in BF16:lm_head, the vision tower, the delta-ruleconv1d, and the MTP head (mtp.*, re-attached after quantization and listed inquantization_config.ignore). The MTP layer has no parallel branch in the original, so its SwiGLU was zero-padded from 17408 to 19456 (exact) so vLLM's draft model matches the folded width.
Quality (vLLM, one DGX Spark, same engine for both)
Teacher-forced perplexity. Assistant-token row = the bf16 model's own greedy answers to three prompts (2,001 assistant tokens), scored under each model โ the only positions an SFT model is trained on.
| text | bf16 (folded, vLLM) | NVFP4 (this build) |
|---|---|---|
| assistant tokens (bf16 greedy answers, 2,001 tok) | 1.131 | 1.259 |
| raw prose (facts, 58 tok) | 2.836 | 2.984 |
| Apache license paragraph (87 tok) | 1.099 | 1.149 |
| counting 1..30 (108 tok) | 1.108 | 1.131 |
Greedy answers from the two models diverge early (as 4-bit builds do) but both reach the same conclusions (e.g. ฯ(200) = 46, correct merge function with tests). Tool calling (qwen3_xml parser) and reasoning (<think>) verified end-to-end.
Do not score system/user tokens: SFT never trains on them, both models are near-random there, and the numbers mean nothing (bf16 read 160 ppl on a user prompt, NVFP4 68 โ and neither is "better").
Serving (one DGX Spark, vLLM)
vllm serve CocaKova/Agnes-3.0-Flash-Preview-NVFP4 \
--served-model-name agnes-3.0-flash \
--max-model-len 131072 --kv-cache-dtype bfloat16 \
--speculative-config '{"method":"mtp","num_speculative_tokens":3}' \
--enable-auto-tool-choice --tool-call-parser qwen3_xml --reasoning-parser deepseek_r1
Measured on a DGX Spark (GB10, sm_121a):
| single stream, thinking off | |
|---|---|
| decode, no speculation | 10.6 tok/s (memory-bandwidth floor for ~20 GB of weights) |
| decode, MTP k=3, prose | 15 tok/s (acceptance length โ 3.4) |
| decode, MTP k=3, code | 21 tok/s |
| decode, MTP k=3, highly predictable text | 26 tok/s (acceptance โ 4.0) |
| cold prefill, 31k-token prompt | 1,650 tok/s |
KV cache at --gpu-memory-utilization 0.35 |
206k tokens (bf16 KV) โ the rest of the 128 GB stays free |
vLLM 0.20.2-dev tree built for sm_121a, FlashInferCutlassNvFp4LinearKernel, Triton/FLA GDN kernels, flashinfer attention.
The chat template is Agnes's own: chat_template_kwargs: {"reasoning_effort": "low"|"medium"|"xhigh"} (default xhigh; set it lower for agent work) and enable_thinking: false to disable reasoning.
Notes
- This is the Preview open-weight checkpoint, not the production/API Agnes 3.0 Flash listed on Artificial Analysis.
- Delta-rule projections are quantized (same recipe as NVIDIA's Qwen3.8-27B NVFP4 reference); only the conv1d stays bf16.
- Scripts (fold, quantization, verification): https://github.com/CocaKova/agnes-nvfp4
- Downloads last month
- 45
Model tree for CocaKova/Agnes-3.0-Flash-Preview-NVFP4
Base model
Agnes-AI/Agnes-3.0-Flash