Planned Diffusion
Paper • 2510.18087 • Published • 8
How to use dmisrael/planned-diffusion-dream7b-sft-16ep with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="dmisrael/planned-diffusion-dream7b-sft-16ep", trust_remote_code=True)
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("dmisrael/planned-diffusion-dream7b-sft-16ep", trust_remote_code=True, dtype="auto")How to use dmisrael/planned-diffusion-dream7b-sft-16ep with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "dmisrael/planned-diffusion-dream7b-sft-16ep"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "dmisrael/planned-diffusion-dream7b-sft-16ep",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/dmisrael/planned-diffusion-dream7b-sft-16ep
How to use dmisrael/planned-diffusion-dream7b-sft-16ep with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "dmisrael/planned-diffusion-dream7b-sft-16ep" \
--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": "dmisrael/planned-diffusion-dream7b-sft-16ep",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'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 "dmisrael/planned-diffusion-dream7b-sft-16ep" \
--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": "dmisrael/planned-diffusion-dream7b-sft-16ep",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use dmisrael/planned-diffusion-dream7b-sft-16ep with Docker Model Runner:
docker model run hf.co/dmisrael/planned-diffusion-dream7b-sft-16ep
Dream 7B planned diffusion model trained for 16 epochs.
from transformers import AutoTokenizer, AutoModel
from dream.modeling_dream import DreamModel
# Load tokenizer and model
tokenizer = AutoTokenizer.from_pretrained("{model_name}", trust_remote_code=True)
model = DreamModel.from_pretrained("{model_name}", trust_remote_code=True)
# Use for diffusion generation
inputs = tokenizer("Your prompt here", return_tensors="pt")
output = model.planned_diffusion_generate(inputs, max_length=512)
generated_text = tokenizer.decode(output.sequences[0], skip_special_tokens=True)
print(generated_text)
If you use this model, please cite the Planned Diffusion paper:
@misc{israel2025planneddiffusion,
title={Planned Diffusion},
author={Daniel Israel and Tian Jin and Ellie Cheng and Guy Van den Broeck and Aditya Grover and Suvinay Subramanian and Michael Carbin},
year={2025},
eprint={2510.18087},
archivePrefix={arXiv},
primaryClass={cs.AI},
url={https://arxiv.org/abs/2510.18087},
}