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", device_map="auto") 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
- AMD Developer Cloud
- Local Apps Settings
- 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
off111README.md
#168 opened 8 months ago
by
Off111
Appreciation for GPT-OSS-20B and Inquiry on Future Vision-Language Models
👀 1
#167 opened 9 months ago
by
lesj0610
Small changes in readme for Vllm serve
1
#166 opened 9 months ago
by
Navanit-AI
No matching torch==2.9.0.dev20250804+cu128 wheel for Python 3.12 – cannot install vllm==0.10.1+gptoss with official instructions
4
#165 opened 9 months ago
by
Sneha7
is that your page? its a copy
😔 1
#164 opened 9 months ago
by
kalle07
metal example code doesn't run as written
#163 opened 9 months ago
by
jjones
Update README.md
#162 opened 9 months ago
by
hedi-huggingface
Genuine User Reviews and Questions on Repo openai/gpt-oss-20b
#161 opened 9 months ago
by
DeepNLP
Tool Calling in Chat Template
3
#160 opened 10 months ago
by
aashkaaa
Update README.md
#159 opened 10 months ago
by
sufian7755
Miss
#158 opened 10 months ago
by deleted
deploying finetuned model on triton using vllm backend
1
#157 opened 10 months ago
by
Prabhjot410
Missing torchvision==0.24.0.dev20250804+cu128 required by vllm+gptoss installation
😔➕ 2
1
#155 opened 10 months ago
by
BanderaTar
Request: DOI
#154 opened 10 months ago
by
SuurajK
Reinforcement Learning example
#153 opened 10 months ago
by
danielhanchen
is the model support TGI?
#152 opened 10 months ago
by
AminSharif
Tokenizer vocab size doesn't match model vocab size
👍 1
1
#151 opened 10 months ago
by
frreiss
Request: DOI
#150 opened 11 months ago
by
Moidan4
Cannot retrieve streamed reasoning output from openai/gpt-oss-20b with vLLM and LangChain
2
#149 opened 11 months ago
by
JSchaffauser
Database Intelligent Query System Implemented Using the GPT-OSS-20B Model
#148 opened 11 months ago
by
allengjj
Inference engines that actually use OSS to full extent? (responses, harmony)
#147 opened 11 months ago
by
Howaboua
Create requirements.txt
#146 opened 11 months ago
by
skminhajuddin20
Create app.py
#145 opened 11 months ago
by
skminhajuddin20
Update Readme.md add multilingual language tag
#143 opened 11 months ago
by
TahirC
"Karen from HR has called... she wants her LLM back."
👀 3
#142 opened 11 months ago
by
builderofworlds
Speculative Decoders?
🔥 7
#141 opened 11 months ago
by
Ano-Nimus
Privacy moment.
2
#138 opened 12 months ago
by
Maria99934
test
🤯🤗 5
1
#137 opened 12 months ago
by
vcn44
Unable to load gpt-oss-20b on dual L40 (48GB) GPUs with vLLM
12
#136 opened 12 months ago
by
yjban
int32 overflow detected for operation add in `_keyed_add` kernel under TRITON_DEBUG=1
#135 opened 12 months ago
by
findhao
zzsm
#132 opened 12 months ago
by
lilisa2099
Update README.md
#129 opened 12 months ago
by
cher0511
My friend and I asked the exact same question but why was his approved but mine refused?
🤯👀 3
2
#127 opened 12 months ago
by
Yvaine
Wrap assistant messages inside "{% generation %}" markers in chat_template.jinja
1
#126 opened 12 months ago
by
daohanlu
Upload medical_diagnosis_manual-1.pdf
1
#125 opened 12 months ago
by
Lorriea73
Not able to deploy gpt-oss-20b model in A100s
5
#124 opened 12 months ago
by
saiadityavzure
20B Parameters vs ChatGPT 4
13
#123 opened 12 months ago
by
Maria99934
68.4 on Aider Polyglot with reasoning_effort: high
👍 1
5
#122 opened 12 months ago
by
Fernanda24
MXFP4 utilization over NVFP4
👍 2
2
#121 opened 12 months ago
by
pprovins
gpt-oss-20b Nvdidia A10G error deploy Attention Sinks
👍 2
1
#120 opened 12 months ago
by
Brayanb
The output of `gpt_oss.generate` is meaningless
#119 opened 12 months ago
by
Yi30
running gpt-oss-20B on Intel Arc iGPU
2
#117 opened 12 months ago
by
quyendo00
Update chat_template.jinja to correctly parse types nested in arrays
#116 opened 12 months ago
by
daohanlu
Model removed from openrouter.ai
#115 opened 12 months ago
by
shhhman
Performance gains on low-end hardware
3
#114 opened 12 months ago
by
dsprag
Is it mandatory to install flash-attention for GPT-OSS?
1
#112 opened 12 months ago
by
xiaotianyu2025
Unable to Structured output
9
#111 opened 12 months ago
by
Arnab07