Image-Text-to-Text
Transformers
Safetensors
qwen3_5
clef
nvfp4
compressed-tensors
llmcompressor
quantized
conversational
8-bit precision
Instructions to use Code4me2/clef-flash-NVFP4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Code4me2/clef-flash-NVFP4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Code4me2/clef-flash-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("Code4me2/clef-flash-NVFP4") model = AutoModelForMultimodalLM.from_pretrained("Code4me2/clef-flash-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 Code4me2/clef-flash-NVFP4 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Code4me2/clef-flash-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": "Code4me2/clef-flash-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/Code4me2/clef-flash-NVFP4
- SGLang
How to use Code4me2/clef-flash-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 "Code4me2/clef-flash-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": "Code4me2/clef-flash-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 "Code4me2/clef-flash-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": "Code4me2/clef-flash-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 Code4me2/clef-flash-NVFP4 with Docker Model Runner:
docker model run hf.co/Code4me2/clef-flash-NVFP4
Card: gate history and decimal sizes
Browse files
README.md
CHANGED
|
@@ -19,7 +19,7 @@ at revision `17f0b0ad`.
|
|
| 19 |
- **Quantized:** the 96 text MLP projections (`gate/up/down_proj`).
|
| 20 |
- **Kept in BF16:** the gated-deltanet and full-attention layers, `lm_head` (the joint head
|
| 21 |
reads its rows), the vision tower and the joint head.
|
| 22 |
-
- **Size:** 12 GB, versus 19 GB for BF16.
|
| 23 |
|
| 24 |
## Method
|
| 25 |
|
|
@@ -45,7 +45,7 @@ banking77 (64, 77 options) and LEDGAR (64, 100 options). Inputs run from 1.7K to
|
|
| 45 |
| Top-1 agreement with BF16 | | 0.926 [0.887, 0.952] | 0.883 [0.838, 0.917] |
|
| 46 |
| Agreement where BF16 margin ≥ 0.5 (n=156) | | **1.000** | 0.994 |
|
| 47 |
| Mean KL(BF16 ‖ quant) | | 0.020 | 0.048 |
|
| 48 |
-
| Size | 19
|
| 49 |
|
| 50 |
Release gates: the accuracy delta's 95% lower bound must be ≥ −2 pt, and agreement on
|
| 51 |
confident decisions must be ≥ 0.98. This model passes both. The variant that also
|
|
@@ -54,6 +54,11 @@ tokens (−6.1 pt).
|
|
| 54 |
|
| 55 |
Every disagreement with BF16 is on a question where BF16's own margin is below 0.5.
|
| 56 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
Per-band, per-cohort and per-margin breakdowns are in [`metrics/`](metrics/).
|
| 58 |
|
| 59 |
## Usage
|
|
|
|
| 19 |
- **Quantized:** the 96 text MLP projections (`gate/up/down_proj`).
|
| 20 |
- **Kept in BF16:** the gated-deltanet and full-attention layers, `lm_head` (the joint head
|
| 21 |
reads its rows), the vision tower and the joint head.
|
| 22 |
+
- **Size:** 12.1 GB, versus 19.1 GB for BF16 (decimal GB).
|
| 23 |
|
| 24 |
## Method
|
| 25 |
|
|
|
|
| 45 |
| Top-1 agreement with BF16 | | 0.926 [0.887, 0.952] | 0.883 [0.838, 0.917] |
|
| 46 |
| Agreement where BF16 margin ≥ 0.5 (n=156) | | **1.000** | 0.994 |
|
| 47 |
| Mean KL(BF16 ‖ quant) | | 0.020 | 0.048 |
|
| 48 |
+
| Size (GB) | 19.1 | 12.1 | 9.1 |
|
| 49 |
|
| 50 |
Release gates: the accuracy delta's 95% lower bound must be ≥ −2 pt, and agreement on
|
| 51 |
confident decisions must be ≥ 0.98. This model passes both. The variant that also
|
|
|
|
| 54 |
|
| 55 |
Every disagreement with BF16 is on a question where BF16's own margin is below 0.5.
|
| 56 |
|
| 57 |
+
These gates were set after the first full report. Under the originally proposed gates
|
| 58 |
+
(overall agreement ≥ 0.95, every length band ≥ 0.90) this model fails at 0.926 overall
|
| 59 |
+
and 0.878 on the 8K–32K band. Those gates were dropped because band slices of n=26–53
|
| 60 |
+
are too small to gate on.
|
| 61 |
+
|
| 62 |
Per-band, per-cohort and per-margin breakdowns are in [`metrics/`](metrics/).
|
| 63 |
|
| 64 |
## Usage
|