Introduction
The AI revolution is no longer confined to high-end servers or cloud platforms. With models like DeepSeek R1—a state-of-the-art reasoning model that rivals top-tier commercial offerings—you can now harness advanced AI capabilities directly on your Android device. In this guide, I’ll show you how to deploy DeepSeek R1 locally for privacy, customization, and offline use.
Why Run DeepSeek R1 on Android?
- Privacy: Process sensitive data locally without cloud dependencies.
- Cost Efficiency: Avoid API fees (DeepSeek’s API costs ~5% of OpenAI’s).
- Offline Access: Use AI even without an internet connection.
- Customization: Fine-tune models for niche applications (coding, creative writing, etc.).
Prerequisites
-
Hardware:
- Android device with ≥8GB RAM (for 8B/14B models).
- Snapdragon 8 Gen 2/3 or equivalent processor.
- ≥12GB storage space.
-
Software:
- Termux (Linux terminal emulator).
- Basic command-line familiarity.
Step 1: Install Termux and Dependencies
- Download Termux: Grab the latest APK from Termux’s GitHub.
- Set Up Termux:
termux-setup-storage # Grant storage permissions
pkg update && pkg upgrade # Update packages
pkg install git cmake golang libjpeg-turbo # Install dependencies
Step 2: Build Ollama from Source
Ollama is a lightweight tool to manage AI models.
- Clone the Repository:
git clone --depth 1 https://github.com/ollama/ollama.git
cd ollama
- Compile Ollama:
go generate ./...
go build . # Build the Ollama binary
Step 3: Download DeepSeek R1 Models
For Android, use distilled or quantized models:
-
Recommended:
deepseek-r1:1.5b
(5.7GB) ordeepseek-r1:8b-q4
(quantized).
Pull the Model:
./ollama run deepseek-r1:8b # Download the 8B model
Step 4: Run DeepSeek R1
- Start the Ollama Server:
./ollama serve & # Run in the background
- Interact with the Model:
./ollama run deepseek-r1:8b
>>> "Write Python code to calculate a Fibonacci sequence"
Optimizing Performance
-
Use Quantized Models: Reduce RAM usage by 30% with
deepseek-r1:8b-q4
. - Prevent Sleep: Keep Termux active with:
pkg install termux-services
sv-enable termux-wake-lock
- Free Up RAM: Close background apps before running models.
Troubleshooting
- Port Conflicts:
./ollama serve --port 8080 & # Use a different port
-
Out of Memory: Monitor RAM with
top
and switch to smaller models. -
Model Not Found: Ensure downloads complete with
ollama pull deepseek-r1:8b
.
Conclusion
Running DeepSeek R1 on Android unlocks private, offline AI for coding, research, and creative projects. With this guide, you’re ready to experiment with cutting-edge models without relying on the cloud. Share your results, tweak the setup, and push the boundaries of mobile AI!
Further Reading:
Top comments (15)
Hey when I tried this command :
go generate ./...
I get this error:
make: *** No targets specified and no makefile found. Stop.
llama/llama.go:3: running "make": exit status 2
Please help.
read development.md inside the folder ollama
u probably need to run
make -j 5
It got stuck here 🥲
i also stuck here
Hey 😊
Can you try
go generate ./..
(just 3 dots after the /)
I guess I made a typo 😅
Hey 😊
Can you try
go generate ./..
(just 3 dots after the /)
I guess I made a typo 😅
Hey I found a solution to install ollama easily in termux.
I found it on reddit. Here is the link :-
reddit.com/r/LocalLLaMA/s/itc8nSYDEj
Glad to hear that. Thanks for sharing the link.
I want to tinker a little bit. I want the model to save context and memory about me in every season in a json and use that as input in every chat to customize the responses! How can I do that!
Can you give an idea?? 💡
So now it's just saying permission denied, is everyone who didn't manage to install on time fucked? I don't get it
How fast is deepseek-r1-1.5b running for you on pixel phones? it's super slow for me...
Which model of pixel do you own? I'm also thinking of running it on my Redmagic 8s pro Snapdragon 888 gen 2 with 16gb ram can boost the ram to 26gb if needed.
I'm trying it on Pixel 9 Pro
if you can pick up a Redmagic 8s pro even 9 pros they cost less than half of top-end phones like S24 Ultra iPhone etc they are way more powerful. Also, your pixel Google tensor isn't that Samsung Exynos CPU just renamed to Google Tensor as they are good CPUs they are more optimised for real-world use i.e longer better battery life but when it comes to raw power speed they don't really excel. Your other option is to root your Pixel then you will have full system access it could run faster in theory!
Snapdragon 888 Tab S8 Ultra 256GB 12GB RAM Will this be okay to run deepseek with Termux ??