shimmyshimmer commited on
Commit
4f6391c
·
verified ·
1 Parent(s): 55b57ea

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +199 -3
README.md CHANGED
@@ -1,3 +1,199 @@
1
- ---
2
- license: apache-2.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model:
3
+ - openai/gpt-oss-120b
4
+ license: apache-2.0
5
+ pipeline_tag: text-generation
6
+ library_name: transformers
7
+ tags:
8
+ - openai
9
+ - unsloth
10
+ ---
11
+ <div>
12
+ <p style="margin-bottom: 0; margin-top: 0;">
13
+ <strong>See <a href="https://huggingface.co/collections/unsloth/gpt-oss-6892433695ce0dee42f31681">our collection</a> for all versions of gpt-oss including GGUF, 4-bit & 16-bit formats.</strong>
14
+ </p>
15
+ <p style="margin-bottom: 0;">
16
+ <em>Learn to run gpt-oss correctly - <a href="https://docs.unsloth.ai/basics/gpt-oss">Read our Guide</a>.</em>
17
+ </p>
18
+ <p style="margin-top: 0;margin-bottom: 0;">
19
+ <em>See <a href="https://docs.unsloth.ai/basics/unsloth-dynamic-v2.0-gguf">Unsloth Dynamic 2.0 GGUFs</a> for our quantization benchmarks.</em>
20
+ </p>
21
+ <div style="display: flex; gap: 5px; align-items: center; ">
22
+ <a href="https://github.com/unslothai/unsloth/">
23
+ <img src="https://github.com/unslothai/unsloth/raw/main/images/unsloth%20new%20logo.png" width="133">
24
+ </a>
25
+ <a href="https://discord.gg/unsloth">
26
+ <img src="https://github.com/unslothai/unsloth/raw/main/images/Discord%20button.png" width="173">
27
+ </a>
28
+ <a href="https://docs.unsloth.ai/basics/gpt-oss">
29
+ <img src="https://raw.githubusercontent.com/unslothai/unsloth/refs/heads/main/images/documentation%20green%20button.png" width="143">
30
+ </a>
31
+ </div>
32
+ <h1 style="margin-top: 0rem;">✨ Read our gpt-oss Guide <a href="https://docs.unsloth.ai/basics/gpt-oss">here</a>!</h1>
33
+ </div>
34
+
35
+ - Read our Blog about gpt-oss support: [unsloth.ai/blog/gpt-oss](https://unsloth.ai/blog/gpt-oss)
36
+ - View the rest of our notebooks in our [docs here](https://docs.unsloth.ai/get-started/unsloth-notebooks).
37
+ - Thank you to the [llama.cpp](https://github.com/ggml-org/llama.cpp) team for their work on supporting this model. We wouldn't be able to release quants without them!
38
+
39
+ # gpt-oss-120b Details
40
+ <p align="center">
41
+ <img alt="gpt-oss-120b" src="https://raw.githubusercontent.com/openai/gpt-oss/main/docs/gpt-oss-120b.svg">
42
+ </p>
43
+
44
+ <p align="center">
45
+ <a href="https://gpt-oss.com"><strong>Try gpt-oss</strong></a> ·
46
+ <a href="https://cookbook.openai.com/topic/gpt-oss"><strong>Guides</strong></a> ·
47
+ <a href="https://openai.com/index/gpt-oss-model-card"><strong>System card</strong></a> ·
48
+ <a href="https://openai.com/index/introducing-gpt-oss/"><strong>OpenAI blog</strong></a>
49
+ </p>
50
+
51
+ <br>
52
+
53
+ 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.
54
+
55
+ We’re releasing two flavors of the open models:
56
+ - `gpt-oss-120b` — for production, general purpose, high reasoning use cases that fits into a single H100 GPU (117B parameters with 5.1B active parameters)
57
+ - `gpt-oss-20b` — for lower latency, and local or specialized use cases (21B parameters with 3.6B active parameters)
58
+
59
+ 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.
60
+
61
+
62
+ > [!NOTE]
63
+ > This model card is dedicated to the larger `gpt-oss-120b` model. Check out [`gpt-oss-20b`](https://huggingface.co/openai/gpt-oss-20b) for the smaller model.
64
+
65
+ # Highlights
66
+
67
+ * **Permissive Apache 2.0 license:** Build freely without copyleft restrictions or patent risk—ideal for experimentation, customization, and commercial deployment.
68
+ * **Configurable reasoning effort:** Easily adjust the reasoning effort (low, medium, high) based on your specific use case and latency needs.
69
+ * **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.
70
+ * **Fine-tunable:** Fully customize models to your specific use case through parameter fine-tuning.
71
+ * **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.
72
+ * **Native MXFP4 quantization:** The models are trained with native MXFP4 precision for the MoE layer, making `gpt-oss-120b` run on a single H100 GPU and the `gpt-oss-20b` model run within 16GB of memory.
73
+
74
+ ---
75
+
76
+ # Inference examples
77
+
78
+ ## Transformers
79
+
80
+ 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.
81
+
82
+ To get started, install the necessary dependencies to setup your environment:
83
+
84
+ ```
85
+ pip install -U transformers kernels torch
86
+ ```
87
+
88
+ Once, setup you can proceed to run the model by running the snippet below:
89
+
90
+ ```py
91
+ from transformers import pipeline
92
+ import torch
93
+
94
+ model_id = "openai/gpt-oss-120b"
95
+
96
+ pipe = pipeline(
97
+ "text-generation",
98
+ model=model_id,
99
+ torch_dtype="auto",
100
+ device_map="auto",
101
+ )
102
+
103
+ messages = [
104
+ {"role": "user", "content": "Explain quantum mechanics clearly and concisely."},
105
+ ]
106
+
107
+ outputs = pipe(
108
+ messages,
109
+ max_new_tokens=256,
110
+ )
111
+ print(outputs[0]["generated_text"][-1])
112
+ ```
113
+
114
+ Alternatively, you can run the model via [`Transformers Serve`](https://huggingface.co/docs/transformers/main/serving) to spin up a OpenAI-compatible webserver:
115
+
116
+ ```
117
+ transformers serve
118
+ transformers chat localhost:8000 --model-name-or-path openai/gpt-oss-120b
119
+ ```
120
+
121
+ [Learn more about how to use gpt-oss with Transformers.](https://cookbook.openai.com/articles/gpt-oss/run-transformers)
122
+
123
+ ## vLLM
124
+
125
+ 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.
126
+
127
+ ```bash
128
+ uv pip install --pre vllm==0.10.1+gptoss \
129
+ --extra-index-url https://wheels.vllm.ai/gpt-oss/ \
130
+ --extra-index-url https://download.pytorch.org/whl/nightly/cu128 \
131
+ --index-strategy unsafe-best-match
132
+
133
+ vllm serve openai/gpt-oss-120b
134
+ ```
135
+
136
+ [Learn more about how to use gpt-oss with vLLM.](https://cookbook.openai.com/articles/gpt-oss/run-vllm)
137
+
138
+ ## PyTorch / Triton
139
+
140
+ 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).
141
+
142
+ ## Ollama
143
+
144
+ 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).
145
+
146
+ ```bash
147
+ # gpt-oss-120b
148
+ ollama pull gpt-oss:120b
149
+ ollama run gpt-oss:120b
150
+ ```
151
+
152
+ [Learn more about how to use gpt-oss with Ollama.](https://cookbook.openai.com/articles/gpt-oss/run-locally-ollama)
153
+
154
+ #### LM Studio
155
+
156
+ If you are using [LM Studio](https://lmstudio.ai/) you can use the following commands to download.
157
+
158
+ ```bash
159
+ # gpt-oss-120b
160
+ lms get openai/gpt-oss-120b
161
+ ```
162
+
163
+ 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.
164
+
165
+ ---
166
+
167
+ # Download the model
168
+
169
+ You can download the model weights from the [Hugging Face Hub](https://huggingface.co/collections/openai/gpt-oss-68911959590a1634ba11c7a4) directly from Hugging Face CLI:
170
+
171
+ ```shell
172
+ # gpt-oss-120b
173
+ huggingface-cli download openai/gpt-oss-120b --include "original/*" --local-dir gpt-oss-120b/
174
+ pip install gpt-oss
175
+ python -m gpt_oss.chat model/
176
+ ```
177
+
178
+ # Reasoning levels
179
+
180
+ You can adjust the reasoning level that suits your task across three levels:
181
+
182
+ * **Low:** Fast responses for general dialogue.
183
+ * **Medium:** Balanced speed and detail.
184
+ * **High:** Deep and detailed analysis.
185
+
186
+ The reasoning level can be set in the system prompts, e.g., "Reasoning: high".
187
+
188
+ # Tool use
189
+
190
+ The gpt-oss models are excellent for:
191
+ * Web browsing (using built-in browsing tools)
192
+ * Function calling with defined schemas
193
+ * Agentic operations like browser tasks
194
+
195
+ # Fine-tuning
196
+
197
+ Both gpt-oss models can be fine-tuned for a variety of specialized use cases.
198
+
199
+ This larger model `gpt-oss-120b` can be fine-tuned on a single H100 node, whereas the smaller [`gpt-oss-20b`](https://huggingface.co/openai/gpt-oss-20b) can even be fine-tuned on consumer hardware.