Text Generation
Transformers
Safetensors
deepseek_v3
conversational
custom_code
text-generation-inference
fp8
Instructions to use microsoft/MAI-DS-R1-FP8 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use microsoft/MAI-DS-R1-FP8 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="microsoft/MAI-DS-R1-FP8", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("microsoft/MAI-DS-R1-FP8", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("microsoft/MAI-DS-R1-FP8", trust_remote_code=True) 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 microsoft/MAI-DS-R1-FP8 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "microsoft/MAI-DS-R1-FP8" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "microsoft/MAI-DS-R1-FP8", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/microsoft/MAI-DS-R1-FP8
- SGLang
How to use microsoft/MAI-DS-R1-FP8 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 "microsoft/MAI-DS-R1-FP8" \ --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": "microsoft/MAI-DS-R1-FP8", "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 "microsoft/MAI-DS-R1-FP8" \ --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": "microsoft/MAI-DS-R1-FP8", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use microsoft/MAI-DS-R1-FP8 with Docker Model Runner:
docker model run hf.co/microsoft/MAI-DS-R1-FP8
Add files using upload-large-folder tool
Browse files- model-00146-of-000163.safetensors +3 -0
- model-00147-of-000163.safetensors +3 -0
- model-00148-of-000163.safetensors +3 -0
- model-00149-of-000163.safetensors +3 -0
- model-00150-of-000163.safetensors +3 -0
- model-00151-of-000163.safetensors +3 -0
- model-00152-of-000163.safetensors +3 -0
- model-00153-of-000163.safetensors +3 -0
- model-00154-of-000163.safetensors +3 -0
- model-00155-of-000163.safetensors +3 -0
- model-00156-of-000163.safetensors +3 -0
- model-00157-of-000163.safetensors +3 -0
- model-00158-of-000163.safetensors +3 -0
model-00146-of-000163.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6ebe5cee7366d1dcc44cda0085455c90b98bcc396df312dbf89169376b9c964e
|
| 3 |
+
size 4302382720
|
model-00147-of-000163.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1e1b139e1c52ef7a058acc8997964a1ac12e8c4d1ea1685560ed9bfb5bedf1e7
|
| 3 |
+
size 4302348376
|
model-00148-of-000163.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:410902df8016a47a973698ea95a8290b3412f1d1ff93cc97a7673c33129ae9b5
|
| 3 |
+
size 4302382464
|
model-00149-of-000163.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ea4e1b72edc602ef939d5eac30678ea690eb347d4d69dcbecce0bc649483f714
|
| 3 |
+
size 4302382720
|
model-00150-of-000163.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:27415c8e213c48c1049c1d5a39bdebf970fa2169032a0cba84fca74b933c95ad
|
| 3 |
+
size 4302348184
|
model-00151-of-000163.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:703db2fc0aabac9f469ae343762897c0027d9f38988bd5a5dbbf0ed7b9f6f770
|
| 3 |
+
size 4302382664
|
model-00152-of-000163.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8ecb7778929b2555efc95925b39b511d257aef1bf4a1ac438052a77697e5acf3
|
| 3 |
+
size 4302348576
|
model-00153-of-000163.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d556c7401a7a414d539e3c6964d5c158a770e2f18b4f80d5f892d8348a8062b5
|
| 3 |
+
size 4302382264
|
model-00154-of-000163.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8a2bcc8a7ccd5eb5e6198f3a4d0a10eef94f1c23447676383949fb85e5d51ff3
|
| 3 |
+
size 4302382720
|
model-00155-of-000163.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:cbe27a723728eb218dd8628ab2ce45d82e7132172931124e1c96b644332ffac2
|
| 3 |
+
size 4302348392
|
model-00156-of-000163.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ac78863011ddef37103711f9d032526c6621a0b42527c622d3dce9f834f736fa
|
| 3 |
+
size 4302382448
|
model-00157-of-000163.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d53958742a23f35aa01276734ac3aa4b3a95310cd473d62d06380b2c1acb2c4b
|
| 3 |
+
size 4302382720
|
model-00158-of-000163.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8e53eb3ee07065be7d22e75090b8d2c549612cbb93a8f672211d5ce6e2832353
|
| 3 |
+
size 4302348200
|