Instructions to use AxionML/Laguna-S-2.1-NVFP4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AxionML/Laguna-S-2.1-NVFP4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="AxionML/Laguna-S-2.1-NVFP4", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("AxionML/Laguna-S-2.1-NVFP4", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("AxionML/Laguna-S-2.1-NVFP4", trust_remote_code=True, device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.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(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use AxionML/Laguna-S-2.1-NVFP4 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "AxionML/Laguna-S-2.1-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": "AxionML/Laguna-S-2.1-NVFP4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/AxionML/Laguna-S-2.1-NVFP4
- SGLang
How to use AxionML/Laguna-S-2.1-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 "AxionML/Laguna-S-2.1-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": "AxionML/Laguna-S-2.1-NVFP4", "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 "AxionML/Laguna-S-2.1-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": "AxionML/Laguna-S-2.1-NVFP4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use AxionML/Laguna-S-2.1-NVFP4 with Docker Model Runner:
docker model run hf.co/AxionML/Laguna-S-2.1-NVFP4
AxionML Laguna-S-2.1-NVFP4
Mirrored by AxionML for open-source serving and deployment use cases. Part of AxionML's effort to provide ready-to-serve quantized models for the community.
Quantized by Poolside. The weights in this repository are an unmodified copy of poolside/Laguna-S-2.1-NVFP4 (revision
826aacdf6d8b2699d4e367def6f17c83b06044c2). All credit for the quantization belongs to Poolside.
This is an NVFP4-quantized version of poolside/Laguna-S-2.1 (117.6B total parameters, 8.5B activated), quantized with NVIDIA Model Optimizer.
About NVFP4 quantization: NVFP4 on Blackwell couples a compact E2M1 FP4 codebook with blockwise FP8 (E4M3) scaling over 16-element micro-blocks, so that 4-bit stored values remain numerically useful for neural-network computation. The E2M1 codebook provides a small, nonuniform set of representable magnitudes up to ±6 and relies on saturating behavior rather than IEEE NaN/Inf encodings to maximize usable range per bit. Using an FP8 block scale (rather than power-of-two-only E8M0) enables fractional scales and error-minimizing scale selection. On Blackwell Tensor Cores, native FP4 multipliers exploit E2M1 simplicity while higher-precision FP32 accumulation protects dot-product accuracy.
Ready for commercial and non-commercial use under OpenMDW-1.1 (included as
LICENSE.md), consistent with Poolside's Acceptable Use Policy.
Model Summary
| Architecture | MoE; 48 layers (12 global attention + 36 sliding-window, window 512), softplus-gated attention |
| Total Parameters | 117.6B |
| Activated Parameters | 8.5B |
| Experts | 256 + 1 shared |
| Context Length | 1,048,576 tokens |
| Checkpoint Size | ~100 GB |
Evaluation Results
| Benchmark | Laguna S 2.1 |
|---|---|
| Terminal-Bench 2.1 | 70.2 |
| SWE-bench Multilingual | 78.5 |
| SWE-Bench Pro (Public) | 59.4 |
| DeepSWE | 40.4 |
| SWE Atlas (Codebase QnA) | 46.2 |
| Toolathlon Verified | 49.7 |
Scores are from the Laguna S 2.1 model card.
Quantization Details
- Quantization format: NVFP4 (compressed-tensors
nvfp4-pack-quantized, group size 16) on routed-expertgate_proj/up_proj/down_proj; Poolside's official NVFP4 release, calibrated at the 1M-context configuration - KV cache: FP8
Usage
Deploy with SGLang
# Poolside notes NVFP4 does not currently run correctly on SGLang; use vLLM below.
Deploy with vLLM
vllm serve AxionML/Laguna-S-2.1-NVFP4 \
--enable-auto-tool-choice \
--tool-call-parser poolside_v1 \
--reasoning-parser poolside_v1 \
--max-model-len 262144
Requires vLLM ≥ 0.25.0; quantization is detected automatically. Optional DFlash speculative decoding: add --speculative-config '{"model":"poolside/Laguna-S-2.1-DFlash-NVFP4","num_speculative_tokens":7,"method":"dflash"}' --max-num-seqs 32. Serve with the sampling defaults in generation_config.json.
Limitations
The base model was trained on data that may contain toxic language and societal biases. The quantized model inherits these limitations. It may generate inaccurate, biased, or offensive content. Please refer to the original model card and the upstream quantized model card for full details.
Credits
- Base model: poolside/Laguna-S-2.1
- Quantization: poolside/Laguna-S-2.1-NVFP4 by Poolside
- Mirror: AxionML
- Downloads last month
- 588
Model tree for AxionML/Laguna-S-2.1-NVFP4
Base model
poolside/Laguna-S-2.1