How to use from
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 "divelab/OPDLM-MATH-4B" \
    --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": "divelab/OPDLM-MATH-4B",
		"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 "divelab/OPDLM-MATH-4B" \
        --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": "divelab/OPDLM-MATH-4B",
		"messages": [
			{
				"role": "user",
				"content": "What is the capital of France?"
			}
		]
	}'
Quick Links

OPDLM-MATH-4B

OPDLM-MATH-4B is an On-Policy Distillation Language Model (OPDLM) — a block-diffusion language model (block size 4, 4 denoising steps per block) post-trained for mathematical reasoning. It is built on a block-diffusion adaptation of Qwen/Qwen3-4B (architecture a2d-qwen3).

This is the base (non-thinking) variant: short-context (2k) math post-training, no explicit chain-of-thought thinking block. ArXiv report: arxiv.org/abs/2606.06712

arXiv report: arxiv.org/abs/2606.06712

Usage

This model uses custom modeling code; load with trust_remote_code=True. Generation is block-diffusion (non–left-to-right), so use the project's inference utilities (block_size=4, denoising_steps_per_block=4) rather than vanilla model.generate.

from transformers import AutoModel, AutoTokenizer
tok = AutoTokenizer.from_pretrained("divelab/OPDLM-MATH-4B", trust_remote_code=True)
model = AutoModel.from_pretrained("divelab/OPDLM-MATH-4B", trust_remote_code=True)
Downloads last month
44
Safetensors
Model size
4B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for divelab/OPDLM-MATH-4B

Finetuned
Qwen/Qwen3-4B
Finetuned
(1033)
this model

Collection including divelab/OPDLM-MATH-4B

Paper for divelab/OPDLM-MATH-4B