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-8B-Thinking" \
    --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-8B-Thinking",
		"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-8B-Thinking" \
        --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-8B-Thinking",
		"messages": [
			{
				"role": "user",
				"content": "What is the capital of France?"
			}
		]
	}'
Quick Links

OPDLM-MATH-8B-Thinking

OPDLM-MATH-8B-Thinking 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-8B (architecture a2d-qwen3).

This is the thinking variant: long-context (8k) math post-training with an explicit chain-of-thought thinking block enabled at inference.

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-8B-Thinking", trust_remote_code=True)
model = AutoModel.from_pretrained("divelab/OPDLM-MATH-8B-Thinking", trust_remote_code=True)
Downloads last month
26
Safetensors
Model size
8B 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-8B-Thinking

Finetuned
Qwen/Qwen3-8B
Finetuned
(2,322)
this model

Collection including divelab/OPDLM-MATH-8B-Thinking

Paper for divelab/OPDLM-MATH-8B-Thinking