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
- 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: upload all xclbins
Browse files- .gitattributes +4 -0
- attn.xclbin +3 -0
- dequant_mxfp4.xclbin +3 -0
- expert.xclbin +3 -0
- layer.xclbin +2 -2
- mm.xclbin +3 -0
.gitattributes
CHANGED
|
@@ -37,3 +37,7 @@ dequant_q4_1.xclbin filter=lfs diff=lfs merge=lfs -text
|
|
| 37 |
layer.xclbin filter=lfs diff=lfs merge=lfs -text
|
| 38 |
lm_head.xclbin filter=lfs diff=lfs merge=lfs -text
|
| 39 |
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
layer.xclbin filter=lfs diff=lfs merge=lfs -text
|
| 38 |
lm_head.xclbin filter=lfs diff=lfs merge=lfs -text
|
| 39 |
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
| 40 |
+
attn.xclbin filter=lfs diff=lfs merge=lfs -text
|
| 41 |
+
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
|
attn.xclbin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c06af042aa2d48b87d218f3d8b07e4e817c35bca81e0e711d711ae358eeb6ac8
|
| 3 |
+
size 592363
|
dequant_mxfp4.xclbin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b52787eaf72fa34f5d540ee40c706ccc9a6c3f43a47190dea66cd5beadb84d8c
|
| 3 |
+
size 280555
|
expert.xclbin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:34fd55521f428495a3acce97d91645ee8cc8996a9a7b980d68f1b655c4e88f14
|
| 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:cd52664d619634bca944c6c254816229e404505920e6d9b65322fb5e39aac7ad
|
| 3 |
+
size 445323
|
mm.xclbin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4d001fcc3e8b5aa553f740abedc859ded13173747c6eeb670763959322c8a936
|
| 3 |
+
size 451611
|