Text Generation
Transformers
GGUF
qwen2
reasoning
chain-of-thought
deepseek
qwen
bnb
4bit
unsloth
chatml
agent
code
thinking
distilled
conversational
Instructions to use 3amthoughts/DeepLink-R1-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use 3amthoughts/DeepLink-R1-GGUF with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="3amthoughts/DeepLink-R1-GGUF") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("3amthoughts/DeepLink-R1-GGUF") model = AutoModelForCausalLM.from_pretrained("3amthoughts/DeepLink-R1-GGUF") - llama-cpp-python
How to use 3amthoughts/DeepLink-R1-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="3amthoughts/DeepLink-R1-GGUF", filename="deepseek-r1-distill-qwen-7b.Q4_K_M.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use 3amthoughts/DeepLink-R1-GGUF with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf 3amthoughts/DeepLink-R1-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf 3amthoughts/DeepLink-R1-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf 3amthoughts/DeepLink-R1-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf 3amthoughts/DeepLink-R1-GGUF:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf 3amthoughts/DeepLink-R1-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf 3amthoughts/DeepLink-R1-GGUF:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf 3amthoughts/DeepLink-R1-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf 3amthoughts/DeepLink-R1-GGUF:Q4_K_M
Use Docker
docker model run hf.co/3amthoughts/DeepLink-R1-GGUF:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use 3amthoughts/DeepLink-R1-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "3amthoughts/DeepLink-R1-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "3amthoughts/DeepLink-R1-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/3amthoughts/DeepLink-R1-GGUF:Q4_K_M
- SGLang
How to use 3amthoughts/DeepLink-R1-GGUF 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 "3amthoughts/DeepLink-R1-GGUF" \ --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": "3amthoughts/DeepLink-R1-GGUF", "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 "3amthoughts/DeepLink-R1-GGUF" \ --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": "3amthoughts/DeepLink-R1-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use 3amthoughts/DeepLink-R1-GGUF with Ollama:
ollama run hf.co/3amthoughts/DeepLink-R1-GGUF:Q4_K_M
- Unsloth Studio new
How to use 3amthoughts/DeepLink-R1-GGUF with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for 3amthoughts/DeepLink-R1-GGUF to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for 3amthoughts/DeepLink-R1-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for 3amthoughts/DeepLink-R1-GGUF to start chatting
- Docker Model Runner
How to use 3amthoughts/DeepLink-R1-GGUF with Docker Model Runner:
docker model run hf.co/3amthoughts/DeepLink-R1-GGUF:Q4_K_M
- Lemonade
How to use 3amthoughts/DeepLink-R1-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull 3amthoughts/DeepLink-R1-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.DeepLink-R1-GGUF-Q4_K_M
List all available models
lemonade list
File size: 4,323 Bytes
ada37ef f8a6b8a ada37ef f8a6b8a ada37ef f8a6b8a ada37ef f8a6b8a ada37ef f8a6b8a ada37ef f8a6b8a ada37ef f8a6b8a ada37ef f8a6b8a | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 | ---
base_model: deepseek-ai/DeepSeek-R1-Distill-Qwen-7B
library_name: transformers
tags:
- reasoning
- chain-of-thought
- deepseek
- qwen
- gguf
- bnb
- 4bit
- unsloth
- chatml
- agent
- code
- thinking
- distilled
license: apache-2.0
---
# 🌌 DeepLink-R1
**DeepLink-R1** is a highly specialized, reasoning-focused large language model designed to act as a **"Logical Architect."** Built on top of the **`deepseek-ai/DeepSeek-R1-Distill-Qwen-7B`** architecture, this model doesn't just provide answers—it constructs transparent, mathematically rigorous blueprints of thought.
It is trained to "think" before it speaks using `<think>` tags, exposing its internal logical deduction process before delivering a final, refined response.
Created by **3amthoughts**.
### ⚡ Model Highlights
* **Architecture:** 7B Parameters (Base: `deepseek-ai/DeepSeek-R1-Distill-Qwen-7B`)
* **Format:** Available in BF16/FP16 (Transformers) and GGUF (Q4_K_M for local execution via llama.cpp/Ollama)
* **Capabilities:** Deep logical reasoning, mathematical rigor, complex problem-solving, and transparent thought generation.
* **Training:** Fine-tuned using QLoRA via Unsloth on a high-fidelity mixture of elite reasoning datasets.
### 🎯 Key Capabilities
* **Transparent Reasoning:** Trained to output its internal thought processes inside `<think>` tags, drastically reducing hallucinations and logical leaps.
* **High-Tier Logic:** Excels at math, coding, and multi-step deduction by breaking down complex problems into manageable architectural blueprints.
* **Lightweight & Fast:** Distilled into a 7B parameter footprint, making elite-level reasoning runnable on consumer hardware (MacBooks, RTX 3090/4090s).
---
### 🛠️ How it Works (Prompting & Output)
To get the model to trigger its reasoning engine, you must use the standard ChatML template and prompt it to think step-by-step.
**System Prompt:**
> "You are a logical architect. Think step-by-step."
**Example Interaction**
**User:**
> "If I have a 5-liter jug and a 3-liter jug, how can I measure exactly 4 liters of water?"
**DeepLink-R1 Output:**
```text
<think>
To measure exactly 4 liters using a 5-liter jug (J5) and a 3-liter jug (J3):
1. Fill J5 to the top (J5 = 5L, J3 = 0L).
2. Pour water from J5 into J3 until J3 is full. This takes 3 liters. (J5 = 2L, J3 = 3L).
3. Empty J3 completely. (J5 = 2L, J3 = 0L).
4. Pour the remaining 2 liters from J5 into J3. (J5 = 0L, J3 = 2L).
5. Fill J5 to the top again. (J5 = 5L, J3 = 2L).
6. Pour water from J5 into J3 until J3 is full. Since J3 already has 2 liters, it only takes 1 liter to fill it. (J5 = 4L, J3 = 3L).
Now, J5 contains exactly 4 liters.
</think>
To measure exactly 4 liters, follow these steps:
1. Fill the 5-liter jug completely.
2. Pour water from the 5-liter jug into the 3-liter jug until it is full, leaving exactly 2 liters in the 5-liter jug.
3. Empty the 3-liter jug.
4. Pour the 2 liters from the 5-liter jug into the empty 3-liter jug.
5. Refill the 5-liter jug completely.
6. Carefully pour water from the 5-liter jug into the 3-liter jug until the 3-liter jug is full. Since it already contains 2 liters, it will only take 1 liter to fill.
You now have exactly 4 liters of water remaining in the 5-liter jug.
```
💻 Prompt Format (ChatML)
DeepLink-R1 strictly uses the ChatML prompt format.
``` code
Text
<|im_start|>system
You are a logical architect. Think step-by-step.<|im_end|>
<|im_start|>user
How many 'r's are in the word strawberry?<|im_end|>
<|im_start|>assistant
<think>
...
</think>
...<|im_end|>
```
🚀 Usage
Using transformers (Python)
```code
Python
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_id = "3amthoughts/DeepLink-R1"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.bfloat16,
device_map="auto",
)
messages = [
{"role": "system", "content": "You are a logical architect. Think step-by-step."},
{"role": "user", "content": "How many 'r's are in the word strawberry?"}
]
inputs = tokenizer.apply_chat_template(messages, return_tensors="pt", add_generation_prompt=True).to("cuda")
outputs = model.generate(inputs, max_new_tokens=1024, temperature=0.6)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
```
|