Instructions to use Lazarus-Ai/ReAligned-Qwen3.5-35B-A3B-NVFP4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Lazarus-Ai/ReAligned-Qwen3.5-35B-A3B-NVFP4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Lazarus-Ai/ReAligned-Qwen3.5-35B-A3B-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)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("Lazarus-Ai/ReAligned-Qwen3.5-35B-A3B-NVFP4") model = AutoModelForMultimodalLM.from_pretrained("Lazarus-Ai/ReAligned-Qwen3.5-35B-A3B-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=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Lazarus-Ai/ReAligned-Qwen3.5-35B-A3B-NVFP4 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Lazarus-Ai/ReAligned-Qwen3.5-35B-A3B-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": "Lazarus-Ai/ReAligned-Qwen3.5-35B-A3B-NVFP4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Lazarus-Ai/ReAligned-Qwen3.5-35B-A3B-NVFP4
- SGLang
How to use Lazarus-Ai/ReAligned-Qwen3.5-35B-A3B-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 "Lazarus-Ai/ReAligned-Qwen3.5-35B-A3B-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": "Lazarus-Ai/ReAligned-Qwen3.5-35B-A3B-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 "Lazarus-Ai/ReAligned-Qwen3.5-35B-A3B-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": "Lazarus-Ai/ReAligned-Qwen3.5-35B-A3B-NVFP4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Lazarus-Ai/ReAligned-Qwen3.5-35B-A3B-NVFP4 with Docker Model Runner:
docker model run hf.co/Lazarus-Ai/ReAligned-Qwen3.5-35B-A3B-NVFP4
ReAligned-Qwen3.5-35B-A3B — NVFP4
Blog: https://lazarusaie.com/blog/introducing-realigned-open-source-frontier-models-without-the-propaganda
Overview
This is an NVFP4 quantization of Lazarus-Ai/ReAligned-Qwen3.5-35B-A3B, a Qwen3.5-based MoE model realigned by Eric Hartford (LazarusAI / QuixiAI) to reduce China-state ideological censorship, refusal behavior, and state-narrative framing while preserving the underlying model's general capabilities. See the base model card for the full training method, evaluation, intended use, limitations, and ethical considerations — all of which apply to this checkpoint unchanged.
The quantization shrinks the model from 70.2 GB (BF16) to 21.7 GB (0.31×, ~4.95 effective bits per weight), bringing it within reach of workstation-class multi-GPU boxes.
Quantization
Quantized with QuixiAI/Model-Optimizer, a hardware-agnostic fork of NVIDIA's TensorRT Model Optimizer. The fork removes the CUDA-only assumptions from the quantization pipeline so that calibration, fake-quant, compression, and export run on any PyTorch device — CUDA, ROCm, Intel XPU, Apple MPS, or plain CPU — with vendor kernels kept as optional fast paths.
To prove that point, this entire checkpoint was produced without any NVIDIA hardware: calibrated, quantized, exported, and serving-validated on 4× Intel Arc Pro B60 GPUs (96 GB VRAM total) using the PyTorch XPU backend.
| Source checkpoint | Lazarus-Ai/ReAligned-Qwen3.5-35B-A3B (BF16, 70.2 GB) |
| Quantized size | 21.7 GB (0.31×, ~4.95 avg bits/weight) |
| Recipe | huggingface/qwen3_5_moe/ptq/w4a16_nvfp4-fp8_attn-kv_fp8_cast |
| MoE experts, shared-expert MLPs, lm_head | NVFP4 weights (W4A16, block size 16) |
| Self-attention + linear-attention projections | FP8 (weights and activations) |
| KV cache | FP8 |
| Routers, norms, embeddings, conv, vision tower | BF16 (unquantized) |
| Calibration | 512 samples, nemotron-post-training-v3 blend, max calibration |
| Hardware | 4× Intel Arc Pro B60 (PyTorch XPU), zero NVIDIA GPUs involved |
The layer-precision layout intentionally matches the recipe NVIDIA ships for the sibling architecture (nvidia/Qwen3.6-35B-A3B-NVFP4) — the exported hf_quant_config.json was verified pattern-for-pattern against it. The checkpoint is standard ModelOpt HF format and loads anywhere ModelOpt NVFP4 checkpoints are supported.
Reproduce this quant
Works on any PyTorch device (cuda, xpu, mps, or CPU). Reference setup: 4× 24 GB GPUs + 256 GB RAM; ~25 minutes end to end. Smaller GPU budgets work — the sequential device map spills overflow layers to system RAM.
# 1. Get the toolkit
git clone https://github.com/QuixiAI/Model-Optimizer.git
cd Model-Optimizer
pip install -e ".[hf]" --no-build-isolation
pip install -r examples/hf_ptq/requirements.txt
# 2. Authenticate (calibration data is gated on the HF Hub)
hf auth login
# 3. Quantize + export
python examples/hf_ptq/hf_ptq.py \
--pyt_ckpt_path Lazarus-Ai/ReAligned-Qwen3.5-35B-A3B \
--recipe huggingface/qwen3_5_moe/ptq/w4a16_nvfp4-fp8_attn-kv_fp8_cast \
--dataset nemotron-post-training-v3 \
--calib_size 512 \
--use_seq_device_map \
--gpu_max_mem_percentage 0.6 \
--skip_generate \
--export_path ./ReAligned-Qwen3.5-35B-A3B-nvfp4
Notes:
--use_seq_device_map --gpu_max_mem_percentage 0.6caps per-GPU weight placement so the FP4 packing of the large fused-expert tensors has headroom; without it, 24 GB-class cards OOM during export. On GPUs with ≥48 GB you can drop both flags.--devicedefaults toauto(current accelerator, CPU fallback) — no flag needed on non-CUDA hardware.- No HF access? Substitute
--dataset cnn_dailymail(ungated, slightly less representative calibration). - Verify the result:
hf_quant_config.jsonin the output should listW4A16_NVFP4(group 16) for experts/shared-expert/lm_head andFP8for the attention projections, withkv_cache_quant_algo: FP8.
Usage
vLLM
vllm serve Lazarus-Ai/ReAligned-Qwen3.5-35B-A3B-NVFP4 \
--tensor-parallel-size 2 \
--max-model-len 8192
Validated end-to-end with vLLM on Intel XPU (TP2 across two Arc Pro B60s, ~10.9 GB weights per GPU). On NVIDIA hardware, native NVFP4 GEMMs require Blackwell-class GPUs; on other hardware the MoE runs through W4A16 / dequantization kernels. FP8-capable GPUs (Ada/Hopper+, MI300+, Intel Arc B-series) execute the attention projections natively.
Prompt format
Use the native Qwen chat template via tokenizer.apply_chat_template. System prompts matter — ReAligned is steerable, and downstream deployers can set tone, refusal boundaries, and policy behavior through the system prompt:
<|im_start|>system
You are ReAligned, a helpful, direct, and fact-seeking assistant. Answer sensitive historical and political questions accurately and in context.<|im_end|>
<|im_start|>user
What happened in Tiananmen Square in 1989?<|im_end|>
<|im_start|>assistant
Suggested inference settings
| Setting | Suggested value |
|---|---|
| Temperature | 0.5–0.8 |
| Top-p | 0.9–0.95 |
| Repetition penalty | 1.0–1.1 |
Limitations
All limitations of the base model apply. In addition:
- Quantization is lossy. NVFP4 weights and FP8 attention introduce small numerical deviations from the BF16 checkpoint. Structural validation and serving canaries pass; full accuracy benchmarks against the BF16 baseline have not yet been published for this checkpoint.
- Hardware-dependent kernels. Throughput and numerics depend on which backend serves the NVFP4 MoE layers (native FP4, W4A16, or dequantization-based emulation).
Citation
@misc{hartford2026realignedqwen35,
author = {Eric Hartford},
title = {ReAligned-Qwen3.5},
year = {2026},
organization = {QuixiAI and LazarusAI},
url = {https://huggingface.co/QuixiAI/ReAligned-Qwen3.5}
}
- Downloads last month
- 80
Model tree for Lazarus-Ai/ReAligned-Qwen3.5-35B-A3B-NVFP4
Base model
Qwen/Qwen3.5-35B-A3B-Base