Text Generation
Transformers
Safetensors
qwen3
feature-extraction
dflash
speculative-decoding
diffusion
efficiency
flash-decoding
diffusion-language-model
gpt-oss
custom_code
text-generation-inference
Run this model with HF Jobs
Run z-lab/gpt-oss-120b-DFlash on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/z-lab/gpt-oss-120b-DFlash. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/z-lab/gpt-oss-120b-DFlash on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/z-lab/gpt-oss-120b-DFlash. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/z-lab/gpt-oss-120b-DFlash. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use z-lab/gpt-oss-120b-DFlash with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use z-lab/gpt-oss-120b-DFlash with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="z-lab/gpt-oss-120b-DFlash", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("z-lab/gpt-oss-120b-DFlash", trust_remote_code=True) model = AutoModel.from_pretrained("z-lab/gpt-oss-120b-DFlash", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use z-lab/gpt-oss-120b-DFlash with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "z-lab/gpt-oss-120b-DFlash" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "z-lab/gpt-oss-120b-DFlash", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/z-lab/gpt-oss-120b-DFlash
- SGLang
How to use z-lab/gpt-oss-120b-DFlash 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 "z-lab/gpt-oss-120b-DFlash" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "z-lab/gpt-oss-120b-DFlash", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "z-lab/gpt-oss-120b-DFlash" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "z-lab/gpt-oss-120b-DFlash", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use z-lab/gpt-oss-120b-DFlash with Docker Model Runner:
docker model run hf.co/z-lab/gpt-oss-120b-DFlash
Update README.md
Browse files33 unmodified lines3435363738394041424344454647484950512 unmodified lines545556575859606162636433 unmodified lines## 🚀 Quick Start### SGLangDFlash is now supported on SGLang. And vLLM integration is currently in progress.#### Installation```bashuv pip install "git+https://github.com/sgl-project/sglang.git@refs/pull/20547/head#subdirectory=python"```#### Inference```bashexport SGLANG_ENABLE_SPEC_V2=1export SGLANG_ENABLE_DFLASH_SPEC_V2=1export SGLANG_ENABLE_OVERLAP_PLAN_STREAM=1python -m sglang.launch_server \--model-path openai/gpt-oss-120b \2 unmodified lines--tp-size 1 \--dtype bfloat16 \--attention-backend fa3 \--mem-fraction-static 0.8 \--speculative-num-draft-tokens 10 \--trust-remote-code```## EvaluationThe draft model is trained with a block size of 10. During evaluation, we use three settings:33 unmodified lines3435363738394041424344454647484950512 unmodified lines5455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211333 unmodified lines## 🚀 Quick Start### SGLang#### Installation```bashuv pip install "git+https://github.com/sgl-project/sglang.git@refs/pull/20547/head#subdirectory=python"```#### Launch Server```bash# Optional: enable schedule overlapping (experimental, may not be stable)# export SGLANG_ENABLE_SPEC_V2=1# export SGLANG_ENABLE_DFLASH_SPEC_V2=1# export SGLANG_ENABLE_OVERLAP_PLAN_STREAM=1python -m sglang.launch_server \--model-path openai/gpt-oss-120b \2 unmodified lines--tp-size 1 \--dtype bfloat16 \--attention-backend fa3 \--mem-fraction-static 0.75 \--trust-remote-code```#### Usage```pythonfrom openai import OpenAIclient = OpenAI(base_url="http://localhost:30000/v1", api_key="EMPTY")response = client.chat.completions.create(model="openai/gpt-oss-120b",messages=[{"role": "user", "content": "Write a quicksort in Python."}],max_tokens=2048,temperature=0.0,)print(response.choices[0].message.content)```### vLLM#### Installation```bashuv pip install vllmuv pip install -U vllm --torch-backend=auto --extra-index-url https://wheels.vllm.ai/nightly```#### Launch Server```bashvllm serve openai/gpt-oss-120b \--speculative-config '{"method": "dflash", "model": "z-lab/gpt-oss-120b-DFlash", "num_speculative_tokens": 9}' \--attention-backend flash_attn \--max-num-batched-tokens 32768```#### Usage```pythonfrom openai import OpenAIclient = OpenAI(base_url="http://localhost:8000/v1", api_key="EMPTY")response = client.chat.completions.create(model="openai/gpt-oss-120b",messages=[{"role": "user", "content": "Write a quicksort in Python."}],max_tokens=2048,temperature=0.0,)print(response.choices[0].message.content)```## EvaluationThe draft model is trained with a block size of 10. During evaluation, we use three settings:
README.md+56-7