Modade6787 commited on
Commit
620ae7c
·
verified ·
1 Parent(s): 52cc256

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +169 -1
README.md CHANGED
@@ -1 +1,169 @@
1
- my model
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ pipeline_tag: text-generation
4
+ library_name: transformers
5
+ tags:
6
+ - vllm
7
+ ---
8
+
9
+ Welcome to the gpt-oss series, [OpenAI’s open-weight models](https://openai.com/open-models) designed for powerful reasoning, agentic tasks, and versatile developer use cases.
10
+
11
+ We’re releasing two flavors of these open models:
12
+ - `gpt-oss-120b` — for production, general purpose, high reasoning use cases that fit into a single 80GB GPU (like NVIDIA H100 or AMD MI300X) (117B parameters with 5.1B active parameters)
13
+ - `gpt-oss-20b` — for lower latency, and local or specialized use cases (21B parameters with 3.6B active parameters)
14
+
15
+ Both models were trained on our [harmony response format](https://github.com/openai/harmony) and should only be used with the harmony format as it will not work correctly otherwise.
16
+
17
+
18
+ > [!NOTE]
19
+ > This model card is dedicated to the smaller `gpt-oss-20b` model. Check out [`gpt-oss-120b`](https://huggingface.co/openai/gpt-oss-120b) for the larger model.
20
+
21
+ # Highlights
22
+
23
+ * **Permissive Apache 2.0 license:** Build freely without copyleft restrictions or patent risk—ideal for experimentation, customization, and commercial deployment.
24
+ * **Configurable reasoning effort:** Easily adjust the reasoning effort (low, medium, high) based on your specific use case and latency needs.
25
+ * **Full chain-of-thought:** Gain complete access to the model’s reasoning process, facilitating easier debugging and increased trust in outputs. It’s not intended to be shown to end users.
26
+ * **Fine-tunable:** Fully customize models to your specific use case through parameter fine-tuning.
27
+ * **Agentic capabilities:** Use the models’ native capabilities for function calling, [web browsing](https://github.com/openai/gpt-oss/tree/main?tab=readme-ov-file#browser), [Python code execution](https://github.com/openai/gpt-oss/tree/main?tab=readme-ov-file#python), and Structured Outputs.
28
+ * **MXFP4 quantization:** The models were post-trained with MXFP4 quantization of the MoE weights, making `gpt-oss-120b` run on a single 80GB GPU (like NVIDIA H100 or AMD MI300X) and the `gpt-oss-20b` model run within 16GB of memory. All evals were performed with the same MXFP4 quantization.
29
+
30
+ ---
31
+
32
+ # Inference examples
33
+
34
+ ## Transformers
35
+
36
+ You can use `gpt-oss-120b` and `gpt-oss-20b` with Transformers. If you use the Transformers chat template, it will automatically apply the [harmony response format](https://github.com/openai/harmony). If you use `model.generate` directly, you need to apply the harmony format manually using the chat template or use our [openai-harmony](https://github.com/openai/harmony) package.
37
+
38
+ To get started, install the necessary dependencies to setup your environment:
39
+
40
+ ```
41
+ pip install -U transformers kernels torch
42
+ ```
43
+
44
+ Once, setup you can proceed to run the model by running the snippet below:
45
+
46
+ ```py
47
+ from transformers import pipeline
48
+ import torch
49
+
50
+ model_id = "openai/gpt-oss-20b"
51
+
52
+ pipe = pipeline(
53
+ "text-generation",
54
+ model=model_id,
55
+ torch_dtype="auto",
56
+ device_map="auto",
57
+ )
58
+
59
+ messages = [
60
+ {"role": "user", "content": "Explain quantum mechanics clearly and concisely."},
61
+ ]
62
+
63
+ outputs = pipe(
64
+ messages,
65
+ max_new_tokens=256,
66
+ )
67
+ print(outputs[0]["generated_text"][-1])
68
+ ```
69
+
70
+ Alternatively, you can run the model via [`Transformers Serve`](https://huggingface.co/docs/transformers/main/serving) to spin up a OpenAI-compatible webserver:
71
+
72
+ ```
73
+ transformers serve
74
+ transformers chat localhost:8000 --model-name-or-path openai/gpt-oss-20b
75
+ ```
76
+
77
+ [Learn more about how to use gpt-oss with Transformers.](https://cookbook.openai.com/articles/gpt-oss/run-transformers)
78
+
79
+ ## vLLM
80
+
81
+ vLLM recommends using [uv](https://docs.astral.sh/uv/) for Python dependency management. You can use vLLM to spin up an OpenAI-compatible webserver. The following command will automatically download the model and start the server.
82
+
83
+ ```bash
84
+ uv pip install --pre vllm==0.10.1+gptoss \
85
+ --extra-index-url https://wheels.vllm.ai/gpt-oss/ \
86
+ --extra-index-url https://download.pytorch.org/whl/nightly/cu128 \
87
+ --index-strategy unsafe-best-match
88
+
89
+ vllm serve openai/gpt-oss-20b
90
+ ```
91
+
92
+ [Learn more about how to use gpt-oss with vLLM.](https://cookbook.openai.com/articles/gpt-oss/run-vllm)
93
+
94
+ ## PyTorch / Triton
95
+
96
+ To learn about how to use this model with PyTorch and Triton, check out our [reference implementations in the gpt-oss repository](https://github.com/openai/gpt-oss?tab=readme-ov-file#reference-pytorch-implementation).
97
+
98
+ ## Ollama
99
+
100
+ If you are trying to run gpt-oss on consumer hardware, you can use Ollama by running the following commands after [installing Ollama](https://ollama.com/download).
101
+
102
+ ```bash
103
+ # gpt-oss-20b
104
+ ollama pull gpt-oss:20b
105
+ ollama run gpt-oss:20b
106
+ ```
107
+
108
+ [Learn more about how to use gpt-oss with Ollama.](https://cookbook.openai.com/articles/gpt-oss/run-locally-ollama)
109
+
110
+ #### LM Studio
111
+
112
+ If you are using [LM Studio](https://lmstudio.ai/) you can use the following commands to download.
113
+
114
+ ```bash
115
+ # gpt-oss-20b
116
+ lms get openai/gpt-oss-20b
117
+ ```
118
+
119
+ Check out our [awesome list](https://github.com/openai/gpt-oss/blob/main/awesome-gpt-oss.md) for a broader collection of gpt-oss resources and inference partners.
120
+
121
+ ---
122
+
123
+ # Download the model
124
+
125
+ You can download the model weights from the [Hugging Face Hub](https://huggingface.co/collections/openai/gpt-oss-68911959590a1634ba11c7a4) directly from Hugging Face CLI:
126
+
127
+ ```shell
128
+ # gpt-oss-20b
129
+ huggingface-cli download openai/gpt-oss-20b --include "original/*" --local-dir gpt-oss-20b/
130
+ pip install gpt-oss
131
+ python -m gpt_oss.chat model/
132
+ ```
133
+
134
+ # Reasoning levels
135
+
136
+ You can adjust the reasoning level that suits your task across three levels:
137
+
138
+ * **Low:** Fast responses for general dialogue.
139
+ * **Medium:** Balanced speed and detail.
140
+ * **High:** Deep and detailed analysis.
141
+
142
+ The reasoning level can be set in the system prompts, e.g., "Reasoning: high".
143
+
144
+ # Tool use
145
+
146
+ The gpt-oss models are excellent for:
147
+ * Web browsing (using built-in browsing tools)
148
+ * Function calling with defined schemas
149
+ * Agentic operations like browser tasks
150
+
151
+ # Fine-tuning
152
+
153
+ Both gpt-oss models can be fine-tuned for a variety of specialized use cases.
154
+
155
+ This smaller model `gpt-oss-20b` can be fine-tuned on consumer hardware, whereas the larger [`gpt-oss-120b`](https://huggingface.co/openai/gpt-oss-120b) can be fine-tuned on a single H100 node.
156
+
157
+ # Citation
158
+
159
+ ```bibtex
160
+ @misc{openai2025gptoss120bgptoss20bmodel,
161
+ title={gpt-oss-120b & gpt-oss-20b Model Card},
162
+ author={OpenAI},
163
+ year={2025},
164
+ eprint={2508.10925},
165
+ archivePrefix={arXiv},
166
+ primaryClass={cs.CL},
167
+ url={https://arxiv.org/abs/2508.10925},
168
+ }
169
+ ```