Instructions to use NexaAI/DeepSeek-R1-Distill-Qwen-1.5B-NexaQuant with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use NexaAI/DeepSeek-R1-Distill-Qwen-1.5B-NexaQuant with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("NexaAI/DeepSeek-R1-Distill-Qwen-1.5B-NexaQuant", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use NexaAI/DeepSeek-R1-Distill-Qwen-1.5B-NexaQuant with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf NexaAI/DeepSeek-R1-Distill-Qwen-1.5B-NexaQuant # Run inference directly in the terminal: llama cli -hf NexaAI/DeepSeek-R1-Distill-Qwen-1.5B-NexaQuant
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf NexaAI/DeepSeek-R1-Distill-Qwen-1.5B-NexaQuant # Run inference directly in the terminal: llama cli -hf NexaAI/DeepSeek-R1-Distill-Qwen-1.5B-NexaQuant
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf NexaAI/DeepSeek-R1-Distill-Qwen-1.5B-NexaQuant # Run inference directly in the terminal: ./build/bin/llama cli -hf NexaAI/DeepSeek-R1-Distill-Qwen-1.5B-NexaQuant
Use Docker
docker model run hf.co/NexaAI/DeepSeek-R1-Distill-Qwen-1.5B-NexaQuant
- Llama new
- LM Studio
- Jan
- Ollama
How to use NexaAI/DeepSeek-R1-Distill-Qwen-1.5B-NexaQuant with Ollama:
ollama run hf.co/NexaAI/DeepSeek-R1-Distill-Qwen-1.5B-NexaQuant
- Unsloth Desktop
- Docker Model Runner
How to use NexaAI/DeepSeek-R1-Distill-Qwen-1.5B-NexaQuant with Docker Model Runner:
docker model run hf.co/NexaAI/DeepSeek-R1-Distill-Qwen-1.5B-NexaQuant
- Lemonade
How to use NexaAI/DeepSeek-R1-Distill-Qwen-1.5B-NexaQuant with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull NexaAI/DeepSeek-R1-Distill-Qwen-1.5B-NexaQuant
Run and chat with the model
lemonade run user.DeepSeek-R1-Distill-Qwen-1.5B-NexaQuant-{{QUANT_TAG}}List all available models
lemonade list
- Atomic Chat
Update README.md
#1
by yli-nexa4ai - opened
64 unmodified lines6566676864 unmodified lines1. In LM Studio's top panel, search for and select `NexaAIDev/DeepSeek-R1-Distill-Qwen-1.5B-NexaQuant`.2. Click `Download` (if not already downloaded) and wait for the model to load.3. Once loaded, go to the chat window and start a conversation.---64 unmodified lines656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714864 unmodified lines1. In LM Studio's top panel, search for and select `NexaAIDev/DeepSeek-R1-Distill-Qwen-1.5B-NexaQuant`.2. Click `Download` (if not already downloaded) and wait for the model to load.3. Once loaded, go to the chat window and start a conversation.---## ExampleOn the left, we have an example of what LMStudio Q4_K_M responded. On the right is our NexaQuant version.Prompt: A Common Investment Banking BrainTeaser QuestionThere is a 6x8 rectangular chocolate bar made up of small 1x1 bits. We want to break it into the 48 bits. We can break one piece of chocolate horizontally or vertically, but cannot break two pieces together! What is the minimum number of breaks required?Right Answer: 47<div align="center"><img src="https://cdn-uploads.huggingface.co/production/uploads/66abfd6f65beb23afa427d8a/ZS9e66t7OhBIno4eQ3OaX.png" width="80%" alt="Example" /></div>## BenchmarksNexaQuant on Reasoning Benchmarks Compared to BF16 and LMStudio's Q4_K_M**1.5B:**<div align="center"><img src="https://cdn-uploads.huggingface.co/production/uploads/66abfd6f65beb23afa427d8a/Cyh1zVvDHNBT598IkLHkd.png" width="80%" alt="Example" /></div>**8B:**<div align="center"><img src="https://cdn-uploads.huggingface.co/production/uploads/66abfd6f65beb23afa427d8a/4SSDIqxikgaDbx8V-Q6bf.png" width="80%" alt="Example" /></div>Their general capacity is also greatly improved:**1.5B:**| Benchmark | Full 16-bit | llama.cpp (4-bit) | NexaQuant (4-bit)||----------------------------|------------|-------------------|-------------------|| **HellaSwag** | 35.81 | 34.31 | 34.60 || **MMLU** | 37.31 | 35.49 | 37.41 || **Humanities** | 31.86 | 34.87 | 30.97 || **Social Sciences** | 41.50 | 38.17 | 42.09 || **STEM** | 38.60 | 35.74 | 39.26 || **ARC Easy** | 67.55 | 54.20 | 65.53 || **MathQA** | 41.04 | 28.51 | 39.87 || **PIQA** | 65.56 | 61.70 | 65.07 || **IFEval - Inst - Loose** | 25.06 | 24.77 | 28.54 || **IFEval - Inst - Strict** | 23.62 | 22.94 | 27.94 || **IFEval - Prom - Loose** | 13.86 | 10.29 | 15.71 || **IFEval - Prom - Strict** | 12.57 | 8.09 | 15.16 |**8B:**| Benchmark | Full 16-bit | llama.cpp (4-bit) | NexaQuant (4-bit)||----------------------------|------------|-------------------|-------------------|| **HellaSwag** | 57.07 | 52.12 | 54.56 || **MMLU** | 55.59 | 52.82 | 54.94 || **Humanities** | 50.48 | 44.74 | 50.24 || **Social Sciences** | 65.32 | 65.62 | 64.74 || **STEM** | 47.73 | 52.50 | 46.75 || **ARC Easy** | 74.49 | 69.32 | 71.72 || **MathQA** | 35.34 | 30.00 | 32.46 || **PIQA** | 78.56 | 76.09 | 77.68 || **IFEval - Inst - Loose** | 44.24 | 44.95 | 42.45 || **IFEval - Inst - Strict** | 42.57 | 44.95 | 40.05 || **IFEval - Prom - Loose** | 30.31 | 25.74 | 28.47 || **IFEval - Prom - Strict** | 27.91 | 25.74 | 25.51 |## What's next1. Inference Nexa Quantized Deepseek-R1 distilled model on NPU.2. This model is designed for complex problem-solving, which is why it has a longer thinking process. We understand this can be an issue in some cases, and we're actively working on improvements.### Follow usIf you liked our work, feel free to ⭐Star [Nexa's GitHub Repo](https://github.com/NexaAI/nexa-sdk).Interested in running DeepSeek R1 on your own devices with optimized CPU, GPU, and NPU acceleration or compressing your finetuned DeepSeek-Distill-R1? [Let’s chat!](https://nexa.ai/book-a-call)[Blogs](https://nexa.ai/blogs/quantized-deepseek-r1-on-device) | [Discord](https://discord.gg/nexa-ai) | [X(Twitter)](https://x.com/nexa_ai)
README.md+81-1