Instructions to use PureTensorAI/Jais-3-32B-NVFP4A16 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use PureTensorAI/Jais-3-32B-NVFP4A16 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="PureTensorAI/Jais-3-32B-NVFP4A16", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("PureTensorAI/Jais-3-32B-NVFP4A16", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use PureTensorAI/Jais-3-32B-NVFP4A16 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "PureTensorAI/Jais-3-32B-NVFP4A16" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "PureTensorAI/Jais-3-32B-NVFP4A16", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/PureTensorAI/Jais-3-32B-NVFP4A16
- SGLang
How to use PureTensorAI/Jais-3-32B-NVFP4A16 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 "PureTensorAI/Jais-3-32B-NVFP4A16" \ --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": "PureTensorAI/Jais-3-32B-NVFP4A16", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "PureTensorAI/Jais-3-32B-NVFP4A16" \ --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": "PureTensorAI/Jais-3-32B-NVFP4A16", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use PureTensorAI/Jais-3-32B-NVFP4A16 with Docker Model Runner:
docker model run hf.co/PureTensorAI/Jais-3-32B-NVFP4A16
Jais-3-32B NVFP4A16 (GPTQ, weights only, Arabic and English calibration)
NVFP4 quantization of inception42/Jais-3-32B, made by PureTensor from the official BF16 weights. Weights are 4-bit; activations stay 16-bit (W4A16). The weights are 23.25 GB against 69.56 GB for BF16.
This is a test release. It is not affiliated with or endorsed by the model's authors.
Read this first: on GSM8K this checkpoint is statistically indistinguishable from BF16 (92.95 against 93.03). On MMLU and ArabicMMLU it is about half a point lower, a small but statistically significant difference. It is a third of the size, and in our test it served 2.4 to 2.9 times faster than BF16 on vLLM.
What was done
| Source | inception42/Jais-3-32B, BF16 |
| Format | compressed-tensors nvfp4-pack-quantized, scheme NVFP4A16: 4-bit E2M1 values, one FP8 E4M3 scale per group of 16, one FP32 scale per tensor |
| Quantized | the weights of every Linear layer in the 64 transformer blocks |
| Kept in BF16 | token embeddings and output head, all norms, all activations |
| Method | GPTQ (block_size 128, dampening_frac 0.01, actorder static) |
| Calibration | 2,048 chat-formatted samples, up to 2,048 tokens each: 1,024 Arabic instruction and answer pairs (the first rows of arbml/CIDAR) and 1,024 from mlabonne/open-perfectblend |
| Tools | llm-compressor 0.15.0, compressed-tensors 0.20.1, transformers 5.21.0, torch 2.14.1 |
The base model's chat template requires a thinking field on assistant turns. For calibration and evaluation text we passed an empty reasoning_content.
Measured quality
One harness, BF16 as reference. The saved checkpoint reloaded from disk to logits identical to the in-memory quantized model, and the benchmarks below were run on the reloaded file.
| BF16 | This checkpoint | Change | Paired test | |
|---|---|---|---|---|
| ArabicMMLU, accuracy (14,455 questions) | 77.36 | 76.71 | -0.65 | 344 lost, 249 gained, p = 1e-4 |
| GSM8K, exact match (1,319 problems) | 93.03 | 92.95 | -0.08 | 27 lost, 26 gained, p = 1.00 |
| MMLU, accuracy (14,042 questions) | 81.08 | 80.59 | -0.49 | 274 lost, 206 gained, p = 2e-3 |
| WikiText-2 perplexity (131,072 tokens) | 7.63 | 7.78 | +0.15 |
| Text | Tokens | Mean KL divergence | 99th percentile KL | Same top token as BF16 |
|---|---|---|---|---|
| WikiText-2 test (English) | 131,072 | 0.026 | 0.25 | 92.8% |
Chat (HuggingFaceH4/ultrachat_200k, test_sft, 256 conversations, English) |
238,748 | 0.048 | 0.81 | 94.0% |
Arabic (arbml/CIDAR, 256 pairs from row 9,000 on) |
64,040 | 0.037 | 0.55 | 93.4% |
| WikiText-2 test without the start-of-text token | 130,944 | 0.048 | 0.45 | 90.9% |
- Benchmarks: default
arabicmmlu,mmluandgsm8kconfigurations of lm-evaluation-harness 0.4.13, no chat template, GSM8K flexible-extract. The paired test is an exact McNemar test on per-question correctness. - KL divergence: full next-token distribution, teacher-forced, windows of 1,024 tokens. The Arabic and chat sets share a dataset family with the calibration data (different rows), so those two rows are flattering; ArabicMMLU, MMLU and WikiText are unrelated to it.
- The last KL row feeds the same WikiText windows without the start-of-text token. All calibration text began with that token, so this row checks the model outside the regime it was calibrated in.
- A caution from our other experiments: benchmark scores move by a point or two between calibration draws of the same recipe. This is one draw.
Across the family
The same recipe applied to four sizes of Jais-3, each against its own BF16 baseline (change in points):
| Model | MMLU | ArabicMMLU | GSM8K | Published |
|---|---|---|---|---|
| Jais-3-0.9B | -13.4 | -11.0 | -24.6 | no |
| Jais-3-3.7B | -4.0 | +0.3 | -0.2 | yes |
| Jais-3-7B | -0.8 | -0.1 | -1.5 | yes |
| Jais-3-32B | -0.5 | -0.7 | -0.1 | this repository |
The 0.9B row is the same recipe with part of the calibration text given without the start-of-text token; without that change the 0.9B fails completely.
On a real serving engine
Served with vLLM 0.34.0 on one NVIDIA Blackwell workstation GPU (compute capability 12.0), using vLLM's weight-only FP4 kernel (MarlinNvFp4LinearKernel).
| BF16 | This checkpoint | |
|---|---|---|
| GSM8K through the completions API (flexible-extract) | 93.10 | 93.18 |
| Throughput, single stream | 1.00x | 2.85x |
| Throughput, 8 concurrent | 1.00x | 2.70x |
| Throughput, 32 concurrent | 1.00x | 2.40x |
Throughput is fixed 256-token greedy generations and will differ on other hardware.
Usage
vLLM:
vllm serve PureTensorAI/Jais-3-32B-NVFP4A16 --trust-remote-code
Transformers (requires pip install compressed-tensors):
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
repo = "PureTensorAI/Jais-3-32B-NVFP4A16"
tok = AutoTokenizer.from_pretrained(repo, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(repo, trust_remote_code=True, dtype=torch.bfloat16).to("cuda")
msgs = [{"role": "user", "content": "لخّص دورة الماء في جملتين."}]
ids = tok.apply_chat_template(msgs, add_generation_prompt=True, return_tensors="pt", return_dict=True).to("cuda")
out = model.generate(**ids, max_new_tokens=256)
print(tok.decode(out[0, ids["input_ids"].shape[1]:], skip_special_tokens=True))
Limitations
- In Transformers the weights are expanded back to 16-bit at load, so there the saving is disk and download size only, and the model needs as much GPU memory as BF16. The memory and speed gains need an engine with an FP4 weight kernel, such as vLLM.
- One calibration draw, no repeated seeds. No safety, dialect, or long-context evaluation was run on the quantized model.
- Keep the tokenizer's default behaviour, which adds the start-of-text token. Without it, KL divergence from BF16 on WikiText rises from 0.026 to 0.048, which is still small. We report both because a much smaller model of this family (0.9B) failed on prompts without that token until its calibration was changed.
License
Apache-2.0, as the base model. Changes from the base release: the Linear weights are quantized to NVFP4 and stored packed, and config.json gains a quantization_config block.
- Downloads last month
- 41
Model tree for PureTensorAI/Jais-3-32B-NVFP4A16
Base model
inception42/Jais-3-32B