Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
46 changes: 46 additions & 0 deletions doc/RunGPTOSSWebGPU.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Run GPT OSS 20B with Web GPU (preview)

These instructions allow you to experiment with GPT OSS 20B on any GPU.
Comment thread
natke marked this conversation as resolved.

Note: once the model is officially supported by Foundry Local that will be the easiest way to run it.

## Model

Download the model

```bash
https://huggingface.co/onnx-community/gpt-oss-20b-ONNX
```

Copy the files in the onnx folder into the parent folder

Change the name of model_q4f16.onnx into model.onnx (as referenced in genai_config.json)

## Runtime

```bash
pip install onnxruntime-webgpu
pip install onnxruntime-genai --no-deps
```

## Example script

```bash
curl -O https://raw.githubusercontent.com/microsoft/onnxruntime-genai/refs/heads/main/examples/python/model-qa.py
```

## Run the model

```bash
python model-qa.py -m gpt-oss-20b-ONNX
```

Note that the reasoning tokens are not processed by this script and appear in the output.

```bash
Prompt (Use quit() to exit): Hello

Output: <|channel|>analysis<|message|>We need to respond to "Hello". Simple greeting. Probably a short hello back and ask how can help.<|end|><|start|>assistant<|channel|>final<|message|>Hello! 👋 How can I help you today?

Prompt (Use quit() to exit):
```
File renamed without changes.
Loading