Instructions to use FastFlowLM/GPT-OSS-20B-NPU2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use FastFlowLM/GPT-OSS-20B-NPU2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="FastFlowLM/GPT-OSS-20B-NPU2") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("FastFlowLM/GPT-OSS-20B-NPU2") model = AutoModelForCausalLM.from_pretrained("FastFlowLM/GPT-OSS-20B-NPU2") 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use FastFlowLM/GPT-OSS-20B-NPU2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "FastFlowLM/GPT-OSS-20B-NPU2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "FastFlowLM/GPT-OSS-20B-NPU2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/FastFlowLM/GPT-OSS-20B-NPU2
- SGLang
How to use FastFlowLM/GPT-OSS-20B-NPU2 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 "FastFlowLM/GPT-OSS-20B-NPU2" \ --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": "FastFlowLM/GPT-OSS-20B-NPU2", "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 "FastFlowLM/GPT-OSS-20B-NPU2" \ --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": "FastFlowLM/GPT-OSS-20B-NPU2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use FastFlowLM/GPT-OSS-20B-NPU2 with Docker Model Runner:
docker model run hf.co/FastFlowLM/GPT-OSS-20B-NPU2
feat: new xclbins
#4
by FastFlowLM - opened
- .gitattributes +1 -0
- dequant_mxfp4.xclbin +2 -2
- dequant_q4_1.xclbin +2 -2
- expert.xclbin +1 -1
- layer.xclbin +2 -2
- mm.xclbin +2 -2
- short_seq_mm.xclbin +3 -0
.gitattributes
CHANGED
|
@@ -42,3 +42,4 @@ dequant_mxfp4.xclbin filter=lfs diff=lfs merge=lfs -text
|
|
| 42 |
expert.xclbin filter=lfs diff=lfs merge=lfs -text
|
| 43 |
mm.xclbin filter=lfs diff=lfs merge=lfs -text
|
| 44 |
*.q4nx filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 42 |
expert.xclbin filter=lfs diff=lfs merge=lfs -text
|
| 43 |
mm.xclbin filter=lfs diff=lfs merge=lfs -text
|
| 44 |
*.q4nx filter=lfs diff=lfs merge=lfs -text
|
| 45 |
+
short_seq_mm.xclbin filter=lfs diff=lfs merge=lfs -text
|
dequant_mxfp4.xclbin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:40827449a1dd065e4dba631418c5d5079cc3924e48c4e80506805a2784ebc54a
|
| 3 |
+
size 281067
|
dequant_q4_1.xclbin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c99d7302970f8f290ca097c66c7fa32ca3fad8e875c397b2bd553cb6b1c6c6bb
|
| 3 |
+
size 116043
|
expert.xclbin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 146027
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9de9637f74587b9a444d1562a2650fee3466f4f10164c1d4a0281534f0842378
|
| 3 |
size 146027
|
layer.xclbin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6365710b6d8402111a1e84411de80d8246594ffd367ce6458902c6fe02fb7e19
|
| 3 |
+
size 454763
|
mm.xclbin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7dd60d1f1405f05fc46d1c0cf1ce31e4f8390abe902851ae018842807c60102a
|
| 3 |
+
size 526875
|
short_seq_mm.xclbin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2e777da1ccdf76f6a439f5934559a3bc7b145ae09bce8d272b1812d04b4cac80
|
| 3 |
+
size 494107
|