Text Generation
Transformers
Safetensors
gpt_oss
vllm
conversational
Eval Results
8-bit precision
mxfp4
Instructions to use openai/gpt-oss-20b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use openai/gpt-oss-20b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="openai/gpt-oss-20b") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("openai/gpt-oss-20b") model = AutoModelForCausalLM.from_pretrained("openai/gpt-oss-20b") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.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(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- HuggingChat
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use openai/gpt-oss-20b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "openai/gpt-oss-20b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "openai/gpt-oss-20b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/openai/gpt-oss-20b
- SGLang
How to use openai/gpt-oss-20b 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 "openai/gpt-oss-20b" \ --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": "openai/gpt-oss-20b", "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 "openai/gpt-oss-20b" \ --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": "openai/gpt-oss-20b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use openai/gpt-oss-20b with Docker Model Runner:
docker model run hf.co/openai/gpt-oss-20b
Delete original/model.safetensors
#254 opened 11 days ago
by
abdullahsaad5555
our ideas
1
#253 opened 22 days ago
by
Mig465
my ideas
😔 1
#252 opened 22 days ago
by
Mig465
Chat template drops intermediate thinking tokens
#251 opened about 2 months ago
by
jiosephlee
Install & run openai/gpt-oss-20b easily using llmpm
#250 opened 2 months ago
by
sarthak-saxena
Hello World
🧠 1
#249 opened 2 months ago
by
aliahmaddev
Update special_tokens_map.json
#248 opened 2 months ago
by
HyzeAI
Add evaluation results from GPT-OSS paper
#247 opened 2 months ago
by
SaylorTwift
Add evaluation results from GPT-OSS paper
#246 opened 2 months ago
by
SaylorTwift
Add evaluation results from GPT-OSS paper
#245 opened 2 months ago
by
SaylorTwift
Add evaluation results from GPT-OSS paper
#244 opened 2 months ago
by
SaylorTwift
Add evaluation results from GPT-OSS paper
#243 opened 2 months ago
by
SaylorTwift
Add evaluation results from GPT-OSS paper
#242 opened 2 months ago
by
SaylorTwift
Add evaluation results from GPT-OSS paper
#241 opened 2 months ago
by
SaylorTwift
Add evaluation results from GPT-OSS paper
#240 opened 2 months ago
by
SaylorTwift
Add evaluation results from GPT-OSS paper
#239 opened 2 months ago
by
SaylorTwift
Add evaluation results from GPT-OSS paper
#238 opened 2 months ago
by
SaylorTwift
Add evaluation results from GPT-OSS paper
#237 opened 2 months ago
by
SaylorTwift
Add evaluation results from GPT-OSS paper
#236 opened 2 months ago
by
SaylorTwift
Add evaluation results from GPT-OSS paper
#235 opened 2 months ago
by
SaylorTwift
Add evaluation results from GPT-OSS paper
#234 opened 2 months ago
by
SaylorTwift
Add evaluation results from GPT-OSS paper
#233 opened 2 months ago
by
SaylorTwift
My_gpt
😔 1
#232 opened 3 months ago
by
Bikram73
GPT-OSS-20B out-of-memory on g4dn.12xlarge (4x16GB VRAM)
#231 opened 3 months ago
by
Filipblahof
gpt-oss-120b reasoning token count
1
#230 opened 3 months ago
by
mfranzoni
Update chat_template.jinja
3
#229 opened 3 months ago
by
mohsin17444
If I modify the chat_template.jinja, can the model know the current time?
#228 opened 3 months ago
by
architectyou
Upload main.py
#227 opened 3 months ago
by
Ananthusajeev190
Upload brain.cpython-312.pyc
#226 opened 4 months ago
by
Ananthusajeev190
Guidance Needed: GPT-OSS 20B Fine-Tuning with Unsloth → GGUF → Ollama → Triton (vLLM / TensorRT-LLM)
3
#225 opened 4 months ago
by
GauravEA
vvv
😔 1
#224 opened 4 months ago
by
nevzathipertek
Upload Saii.py
#223 opened 4 months ago
by
Ananthusajeev190
Upload Sai.py
#222 opened 4 months ago
by
Ananthusajeev190
Upload Saversai.ai.py
#221 opened 4 months ago
by
Ananthusajeev190
Upload Saversai.py
😔 1
#220 opened 4 months ago
by
Ananthusajeev190
Upload model.safetensors
#219 opened 4 months ago
by
Ananthusajeev190
Function call token ordering mismatch with Harmony format and chat template
4
#218 opened 4 months ago
by
bharathi1604
[Adding reasoning level in the prompt]
#217 opened 4 months ago
by
luoqinpei
Upload Ai_talk_internal_monologue .txt
#216 opened 4 months ago
by
Ananthusajeev190
[Bug/Discrepancy] Chat template in `tokenizer_config.json` is missing `<|constrain|>` tokens
#215 opened 4 months ago
by
lingjie23
Upload 3 files
😔 1
#214 opened 4 months ago
by
Ananthusajeev190
Upload dual_ai_code.safetensors
#213 opened 4 months ago
by
Ananthusajeev190
Upload 2 files
#212 opened 4 months ago
by
Ananthusajeev190
Upload Adpt_files1.1.1.py
#210 opened 4 months ago
by
Ananthusajeev190
Upload Adpt_files.py
#209 opened 4 months ago
by
Ananthusajeev190
Upload Bridge.py
#208 opened 4 months ago
by
Ananthusajeev190
Upload Only_adapt.py
#207 opened 4 months ago
by
Ananthusajeev190
Upload Only_adapt.txt
#206 opened 4 months ago
by
Ananthusajeev190
Upload Read.me
1
#205 opened 4 months ago
by
Ananthusajeev190
Upload Network_ied.py
#204 opened 4 months ago
by
Ananthusajeev190