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
If you have issues running gpt-oss-*20b in google's colab notebooks, this might be useful to know
❤️ 6
19
#35 opened 12 months ago
by
ahmedsaoudi
Open AI open source models not able to run ...
😔 3
3
#34 opened 12 months ago
by
pskmattegunta
Finetune GPT-OSS models 🔥
🔥 11
4
#33 opened 12 months ago
by
hiyouga
Float16 ?
👍 1
#32 opened 12 months ago
by
horbane
ONNX Format
7
#30 opened 12 months ago
by
Aguazzz
REASONING SETTING GUIDE 📚
😔👍 4
28
#28 opened 12 months ago
by
xbruce22
Is CPU offloading possible?
➕ 3
3
#26 opened 12 months ago
by
SpaghettiM
Reasoning settings in Ollama?
➕ 1
2
#25 opened 12 months ago
by
Lynrayy
Scored 67.86 🔥 on MMLU Pro single shot benchmark
1
#24 opened 12 months ago
by
xbruce22
how to make determinstic output?
4
#23 opened 12 months ago
by
junma
Unusual Training metrics
1
#22 opened 12 months ago
by
shadowlilac
Running on apple silicon giving quantization error
❤️➕ 10
11
#21 opened 12 months ago
by
aditagar
Content Policy Obsessed Model at Expense of Intelligence and Context Following
👍 19
31
#20 opened 12 months ago
by
jalder1989
memory allocation exceeded error
🚀 4
3
#19 opened 12 months ago
by
aditya-shinde
EXO support.
#18 opened 12 months ago
by
JohnP1
Gran trabajo. Los amo.
#17 opened 12 months ago
by
Chipiri
Promise kept, excellent work. Thank you
🔥 3
1
#16 opened 12 months ago
by
TestregX
This model is unbelievably ignorant.
➕👍 42
15
#14 opened 12 months ago
by
phil111
so its a bit confusing .. is the model on hugging faces an moe version or a dense version?
6
#13 opened 12 months ago
by
aatri2021
getting error on vllm
👍 3
12
#12 opened 12 months ago
by
maroahma
Reasoning setting examples
➕ 6
1
#10 opened 12 months ago
by
ndurkee
Android?
2
#9 opened 12 months ago
by
TRXJ
It is super great compared to other open source models
🚀 2
1
#8 opened 12 months ago
by
Pamudu
Works Pretty good!
2
#7 opened 12 months ago
by
davvveee
Latest vLLM docker image doesn't yet support gpt-oss
🔥 1
4
#6 opened 12 months ago
by
ht7770
Model size 12B
6
#5 opened 12 months ago
by
amine-khelif
OpenAI is finally open.
🤗👍 12
1
#3 opened 12 months ago
by
anupbhat
Congrats on the full release!
❤️🚀 11
#1 opened 12 months ago
by
johnpaulbin