Instructions to use FastFlowLM/Deepseek-R1-Distill-Llama-8B-NPU2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use FastFlowLM/Deepseek-R1-Distill-Llama-8B-NPU2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="FastFlowLM/Deepseek-R1-Distill-Llama-8B-NPU2") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("FastFlowLM/Deepseek-R1-Distill-Llama-8B-NPU2") model = AutoModelForCausalLM.from_pretrained("FastFlowLM/Deepseek-R1-Distill-Llama-8B-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/Deepseek-R1-Distill-Llama-8B-NPU2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "FastFlowLM/Deepseek-R1-Distill-Llama-8B-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/Deepseek-R1-Distill-Llama-8B-NPU2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/FastFlowLM/Deepseek-R1-Distill-Llama-8B-NPU2
- SGLang
How to use FastFlowLM/Deepseek-R1-Distill-Llama-8B-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/Deepseek-R1-Distill-Llama-8B-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/Deepseek-R1-Distill-Llama-8B-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/Deepseek-R1-Distill-Llama-8B-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/Deepseek-R1-Distill-Llama-8B-NPU2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use FastFlowLM/Deepseek-R1-Distill-Llama-8B-NPU2 with Docker Model Runner:
docker model run hf.co/FastFlowLM/Deepseek-R1-Distill-Llama-8B-NPU2
Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
library_name: transformers
|
| 6 |
+
tags:
|
| 7 |
+
- deepseek
|
| 8 |
+
- distillation
|
| 9 |
+
- llama
|
| 10 |
+
- llama-compatible
|
| 11 |
+
- deepseek-r1
|
| 12 |
+
- text-generation
|
| 13 |
+
- AMD
|
| 14 |
+
- Ryzen
|
| 15 |
+
- NPU
|
| 16 |
+
pipeline_tag: text-generation
|
| 17 |
+
base_model:
|
| 18 |
+
- deepseek-ai/Deepseek-R1-Distill-Llama-8B
|
| 19 |
+
---
|
| 20 |
+
|
| 21 |
+
# 🔬 Deepseek R1 Distill LLaMA 8B – Optimized for FastFlowLM on AMD Ryzen™ AI NPU (XDNA2 Only)
|
| 22 |
+
|
| 23 |
+
## Model Summary
|
| 24 |
+
This model is based on **Deepseek R1 Distill LLaMA 8B**, a distilled version of a LLaMA-compatible architecture trained by Deepseek AI. It is designed for high-speed inference with low power consumption using the FastFlowLM runtime on Ryzen™ AI NPUs.
|
| 25 |
+
|
| 26 |
+
> ✅ **Released under the MIT License**
|
| 27 |
+
|
| 28 |
+
## 📝 License & Usage Terms
|
| 29 |
+
|
| 30 |
+
### Base Model License
|
| 31 |
+
- Released by Deepseek AI under the MIT License:
|
| 32 |
+
👉 https://huggingface.co/deepseek-ai/Deepseek-R1-Distill-Llama-8B
|
| 33 |
+
|
| 34 |
+
- License permits:
|
| 35 |
+
- Commercial and non-commercial use
|
| 36 |
+
- Redistribution and modification
|
| 37 |
+
- No attribution requirement (though encouraged)
|
| 38 |
+
|
| 39 |
+
### Redistribution Notice
|
| 40 |
+
- This repository does **not** include original or modified Deepseek model weights.
|
| 41 |
+
- You must download the base weights from Hugging Face directly:
|
| 42 |
+
👉 https://huggingface.co/deepseek-ai/Deepseek-R1-Distill-Llama-8B
|
| 43 |
+
|
| 44 |
+
### If Fine-tuned
|
| 45 |
+
If the model has been quantized or further fine-tuned:
|
| 46 |
+
|
| 47 |
+
- **Base Model License**: MIT
|
| 48 |
+
- **Derivative Weights License**: [e.g., MIT, CC-BY-NC-4.0, custom]
|
| 49 |
+
- **Training Dataset License(s)**:
|
| 50 |
+
- [Dataset A] – [license]
|
| 51 |
+
- [Dataset B] – [license]
|
| 52 |
+
|
| 53 |
+
Ensure compliance with the licenses of any datasets used in training.
|
| 54 |
+
|
| 55 |
+
## Intended Use
|
| 56 |
+
- **Best Suited For**: Local LLM inference, chat assistants, coding helpers, research
|
| 57 |
+
- **Not Suited For**: Sensitive or safety-critical use cases without additional testing
|
| 58 |
+
|
| 59 |
+
## Limitations & Risks
|
| 60 |
+
- May exhibit factual inaccuracies or biases
|
| 61 |
+
- Distillation may reduce generalization on edge cases
|
| 62 |
+
- Performance depends on quantization strategy and runtime settings
|
| 63 |
+
|
| 64 |
+
## Citation
|
| 65 |
+
```bibtex
|
| 66 |
+
@misc{deepseek2024r1,
|
| 67 |
+
title={DeepSeek R1: Distilled LLaMA-based Model},
|
| 68 |
+
author={Deepseek AI},
|
| 69 |
+
year={2024},
|
| 70 |
+
url={https://huggingface.co/deepseek-ai/Deepseek-R1-Distill-Llama-8B}
|
| 71 |
+
```
|