shimmyshimmer commited on
Commit
e752337
·
verified ·
1 Parent(s): e8f461d

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +153 -153
README.md CHANGED
@@ -1,199 +1,199 @@
1
  ---
 
 
 
 
2
  library_name: transformers
3
- tags: []
 
 
4
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
 
6
- # Model Card for Model ID
7
-
8
- <!-- Provide a quick summary of what the model is/does. -->
9
-
10
-
11
-
12
- ## Model Details
13
-
14
- ### Model Description
15
-
16
- <!-- Provide a longer summary of what this model is. -->
17
-
18
- This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
19
-
20
- - **Developed by:** [More Information Needed]
21
- - **Funded by [optional]:** [More Information Needed]
22
- - **Shared by [optional]:** [More Information Needed]
23
- - **Model type:** [More Information Needed]
24
- - **Language(s) (NLP):** [More Information Needed]
25
- - **License:** [More Information Needed]
26
- - **Finetuned from model [optional]:** [More Information Needed]
27
-
28
- ### Model Sources [optional]
29
-
30
- <!-- Provide the basic links for the model. -->
31
-
32
- - **Repository:** [More Information Needed]
33
- - **Paper [optional]:** [More Information Needed]
34
- - **Demo [optional]:** [More Information Needed]
35
-
36
- ## Uses
37
-
38
- <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
39
-
40
- ### Direct Use
41
-
42
- <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
43
-
44
- [More Information Needed]
45
-
46
- ### Downstream Use [optional]
47
-
48
- <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
49
-
50
- [More Information Needed]
51
-
52
- ### Out-of-Scope Use
53
-
54
- <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
55
-
56
- [More Information Needed]
57
-
58
- ## Bias, Risks, and Limitations
59
-
60
- <!-- This section is meant to convey both technical and sociotechnical limitations. -->
61
-
62
- [More Information Needed]
63
-
64
- ### Recommendations
65
-
66
- <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
67
-
68
- Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
69
-
70
- ## How to Get Started with the Model
71
-
72
- Use the code below to get started with the model.
73
-
74
- [More Information Needed]
75
-
76
- ## Training Details
77
-
78
- ### Training Data
79
-
80
- <!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
81
-
82
- [More Information Needed]
83
-
84
- ### Training Procedure
85
-
86
- <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
87
-
88
- #### Preprocessing [optional]
89
-
90
- [More Information Needed]
91
-
92
-
93
- #### Training Hyperparameters
94
-
95
- - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
96
-
97
- #### Speeds, Sizes, Times [optional]
98
-
99
- <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
100
-
101
- [More Information Needed]
102
-
103
- ## Evaluation
104
-
105
- <!-- This section describes the evaluation protocols and provides the results. -->
106
-
107
- ### Testing Data, Factors & Metrics
108
-
109
- #### Testing Data
110
-
111
- <!-- This should link to a Dataset Card if possible. -->
112
-
113
- [More Information Needed]
114
 
115
- #### Factors
116
 
117
- <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
118
 
119
- [More Information Needed]
120
 
121
- #### Metrics
122
 
123
- <!-- These are the evaluation metrics being used, ideally with a description of why. -->
 
 
124
 
125
- [More Information Needed]
126
 
127
- ### Results
 
 
128
 
129
- [More Information Needed]
130
 
131
- #### Summary
 
 
 
 
 
132
 
 
 
 
133
 
 
 
 
 
 
 
134
 
135
- ## Model Examination [optional]
136
 
137
- <!-- Relevant interpretability work for the model goes here -->
 
 
 
138
 
139
- [More Information Needed]
140
 
141
- ## Environmental Impact
142
 
143
- <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
144
 
145
- Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
 
 
 
 
146
 
147
- - **Hardware Type:** [More Information Needed]
148
- - **Hours used:** [More Information Needed]
149
- - **Cloud Provider:** [More Information Needed]
150
- - **Compute Region:** [More Information Needed]
151
- - **Carbon Emitted:** [More Information Needed]
152
 
153
- ## Technical Specifications [optional]
154
 
155
- ### Model Architecture and Objective
156
 
157
- [More Information Needed]
158
 
159
- ### Compute Infrastructure
160
 
161
- [More Information Needed]
162
 
163
- #### Hardware
 
 
 
 
164
 
165
- [More Information Needed]
166
 
167
- #### Software
168
 
169
- [More Information Needed]
170
 
171
- ## Citation [optional]
 
 
 
172
 
173
- <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
174
 
175
- **BibTeX:**
176
 
177
- [More Information Needed]
178
 
179
- **APA:**
180
 
181
- [More Information Needed]
 
 
 
 
 
182
 
183
- ## Glossary [optional]
184
 
185
- <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
186
 
187
- [More Information Needed]
 
 
188
 
189
- ## More Information [optional]
190
 
191
- [More Information Needed]
192
 
193
- ## Model Card Authors [optional]
 
 
 
194
 
195
- [More Information Needed]
196
 
197
- ## Model Card Contact
198
 
199
- [More Information Needed]
 
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.