Running DeepSeek-R1 and Qwen2.5 Locally with Ollama
Introduction
With the increasing popularity of open-source AI models, running powerful LLMs like DeepSeek-R1 and Qwen2.5 locally has become more accessible than ever. These models offer cutting-edge capabilities for natural language processing (DeepSeek-R1) and multimodal AI (, allowing users to leverage them for diverse applications like chatbots, summarization, code generation, and image-based reasoning.
To read more about DeepSeek, check out my other article on it — here
Ollama is a lightweight and easy-to-use tool designed to run LLMs on local machines efficiently. It simplifies downloading, managing, and running models without the need for complex dependencies or cloud-based APIs.
What is Ollama?
Ollama is an open-source framework that enables users to run LLMs locally with minimal setup. It provides a seamless interface to download and execute various models, making it an excellent choice for developers, researchers, and AI enthusiasts who want to experiment with AI capabilities offline. Key features include:
- Simple installation and model management
- Support for a variety of open-source models
- Local execution with optimized performance
- Interactive chat and inference capabilities
Uses of Ollama
Ollama enables a variety of AI-powered applications, including:
- Local AI Chatbots — Run interactive chat models without needing internet access.
- Text Summarization — Process large text inputs and generate concise summaries.
- Code Generation — Use models like DeepSeek-R1 to generate or complete code.
- Multimodal Processing — Utilize Qwen2.5-VL for image-based reasoning and vision-language tasks.
- AI-Assisted Writing — Enhance content creation with AI-powered assistance.
How to Install Ollama
Installation on macOS/Linux
Open a terminal and run:
curl -fsSL https://ollama.com/install.sh | sh
Installation on Windows
Windows users need WSL 2 (Windows Subsystem for Linux). Once WSL is installed, follow the macOS/Linux installation command in the WSL terminal.
After installation, verify that Ollama is working by running:
ollama --version
How to Run Ollama
Once installed, start the Ollama service by running:
ollama serve
This will allow you to interact with models locally.
How to Pull Any Model
To download and use a model, use the following command:
ollama pull <model-name>
For example, to pull DeepSeek-R1:
ollama pull deepseek-r1
To pull Qwen2.5:
ollama pull qwen2.5
How to Chat with the Models
Once a model is pulled, you can start a chat session:
ollama run deepseek-r1
For a multimodal model like Qwen2.5, you can input both text and images:
ollama run qwen2.5
To exit the chat, use Ctrl+C.
Useful Ollama Commands
Here are some handy commands to interact with Ollama:
- List available models:
ollama list
- Show details of a model:
ollama show deepseek-r1
- Remove a model:
ollama rm deepseek-r1
- Run a model with a custom prompt:
ollama run deepseek-r1 "Summarize this article for me."
References and Citations
- DeepSeek-R1 Paper & GitHub: https://github.com/deepseek-ai
- Qwen2.5 Model: https://huggingface.co/Qwen
- Ollama Documentation: https://ollama.com
By following this guide, you can easily run state-of-the-art AI models locally without requiring cloud-based resources, ensuring efficiency and privacy while exploring AI capabilities.
Stay on the cutting-edge of AI! 🌟 Follow me on Medium, connect on LinkedIn, and explore latest trends in AI technologies and models. Dive into the world of AI with me and discover new horizons! 📚💻