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 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
i want a new model
#266 opened 1 day ago
by
inikishev
Still the undisputed best model for 16gb consumer cards, when can we expect a refresh / new model?
#265 opened 5 days ago
by
szilard995
Listed on OpenModelMap
#264 opened 11 days ago
by
duola15
Add IFStruct v1.0 evaluation result
#263 opened 12 days ago
by
SaylorTwift
Update README.md
#262 opened 12 days ago
by
Pq234
Update README.md
#261 opened 16 days ago
by
Mati222222222
Interesting work — mobile AI perspective
#260 opened 17 days ago
by
3morixd
GPT-OSS 20B — can it run on phones? We tested.
#259 opened 17 days ago
by
3morixd
Listed on OpenModelMap
#258 opened 24 days ago
by
duola15
TemporalMesh Transformer: 29.4 PPL at 48% compute — beats Mamba, new open-source architecture
#257 opened about 1 month ago
by
vigneshwar234
Add EvalEval community eval results
#256 opened about 1 month ago
by
EvalEvalBot
Add LEXam evaluation results
#255 opened about 1 month ago
by
joelniklaus
Delete original/model.safetensors
#254 opened 2 months ago
by
abdullahsaad5555
our ideas
1
#253 opened 3 months ago
by
Mig465
my ideas
😔 1
#252 opened 3 months ago
by
Mig465
Chat template drops intermediate thinking tokens
#251 opened 4 months ago
by
jiosephlee
Hello World
🧠 1
#249 opened 4 months ago
by
aliahmaddev
Update special_tokens_map.json
#248 opened 4 months ago
by
HyzeAI
Add evaluation results from GPT-OSS paper
#247 opened 4 months ago
by
SaylorTwift
Add evaluation results from GPT-OSS paper
#246 opened 4 months ago
by
SaylorTwift
Add evaluation results from GPT-OSS paper
#245 opened 4 months ago
by
SaylorTwift
Add evaluation results from GPT-OSS paper
#244 opened 4 months ago
by
SaylorTwift
Add evaluation results from GPT-OSS paper
#243 opened 4 months ago
by
SaylorTwift
Add evaluation results from GPT-OSS paper
#242 opened 4 months ago
by
SaylorTwift
Add evaluation results from GPT-OSS paper
#241 opened 4 months ago
by
SaylorTwift
Add evaluation results from GPT-OSS paper
#240 opened 4 months ago
by
SaylorTwift
Add evaluation results from GPT-OSS paper
#239 opened 4 months ago
by
SaylorTwift
Add evaluation results from GPT-OSS paper
#238 opened 4 months ago
by
SaylorTwift
Add evaluation results from GPT-OSS paper
#237 opened 4 months ago
by
SaylorTwift
Add evaluation results from GPT-OSS paper
#236 opened 4 months ago
by
SaylorTwift
Add evaluation results from GPT-OSS paper
#235 opened 4 months ago
by
SaylorTwift
Add evaluation results from GPT-OSS paper
#234 opened 4 months ago
by
SaylorTwift
Add evaluation results from GPT-OSS paper
#233 opened 4 months ago
by
SaylorTwift
My_gpt
😔 1
#232 opened 5 months ago
by
Bikram73
GPT-OSS-20B out-of-memory on g4dn.12xlarge (4x16GB VRAM)
#231 opened 5 months ago
by
Filipblahof
gpt-oss-120b reasoning token count
1
#230 opened 5 months ago
by
mfranzoni
Update chat_template.jinja
3
#229 opened 5 months ago
by
mohsin17444
If I modify the chat_template.jinja, can the model know the current time?
#228 opened 5 months ago
by
architectyou
Upload main.py
#227 opened 5 months ago
by
Ananthusajeev190
Upload brain.cpython-312.pyc
#226 opened 5 months ago
by
Ananthusajeev190
Guidance Needed: GPT-OSS 20B Fine-Tuning with Unsloth → GGUF → Ollama → Triton (vLLM / TensorRT-LLM)
3
#225 opened 6 months ago
by
GauravEA
vvv
😔 1
#224 opened 6 months ago
by
nevzathipertek
Upload Saii.py
#223 opened 6 months ago
by
Ananthusajeev190
Upload Sai.py
#222 opened 6 months ago
by
Ananthusajeev190
Upload Saversai.ai.py
#221 opened 6 months ago
by
Ananthusajeev190
Upload Saversai.py
😔 1
#220 opened 6 months ago
by
Ananthusajeev190
Upload model.safetensors
#219 opened 6 months ago
by
Ananthusajeev190
Function call token ordering mismatch with Harmony format and chat template
🔥 1
5
#218 opened 6 months ago
by
bharathi1604
[Adding reasoning level in the prompt]
#217 opened 6 months ago
by
luoqinpei
Upload Ai_talk_internal_monologue .txt
#216 opened 6 months ago
by
Ananthusajeev190