Deploying Ollama DeepSeek and RAGFlow locally allows you to run powerful natural language processing (NLP) models in your own environment, enabling more efficient data processing and knowledge retrieval. Let’s get started.
1. Environment Preparation
First, ensure your local machine meets the following requirements:
- Operating System: Linux or macOS (Windows is also supported via WSL)
- Python Version: 3.8 or higher
- GPU Support (optional): CUDA and cuDNN (for accelerating deep learning models)
2. Install Ollama DeepSeek
Ollama is a lightweight, fast, and efficient platform for running LLMs locally.
Go to Ollama website and download the latest version.
Find the deepseek version you want to install, e.g. deepseek-r1
.
ollama run deepseek-r1:7b
When downloading is complete, you can already start chatting with the local model.
3. Install RAGFlow
RAGFlow is a framework for knowledge retrieval and question-answering.
# Clone the RAGFlow repository
git clone https://github.com/ragflow/ragflow.git
cd ragflow
# Install dependencies
pip install -r requirements.txt
# Download the pre-trained model
python download_model.py
4. Configuration and Running
Configure Ollama DeepSeek
Since we installed Ollama from the website and downloaded deepseek model, Ollama is already running as a service. You can interact with it via its API. By default, Ollama runs on http://localhost:11434
.
To test if Ollama is working, you can use the following command:
curl http://localhost:11434/api/generate -d '{
"model": "deepseek-r1:7b",
"prompt": "Hello, world!"
}'
If you see the response, it means Ollama is working.
Configure RAGFlow
RAGFlow, which is installed from Git, needs to be configured to interact with Ollama. Edit the config.yaml file in the RAGFlow directory to include the Ollama API endpoint:
# config.yaml
ollama:
api_url: "http://localhost:11434"
model: "deepseek-r1:7b"
ragflow:
model_path: "./ragflow/models"
port: 5001
Start RAGFlow
Navigate to the RAGFlow directory and start the RAGFlow service:
cd ragflow
python serve.py
This will start RAGFlow on the port specified in the config.yaml file (default is 5001
).
5. Test the Deployment
Once both Ollama and RAGFlow are running, you can test their integration. Use the following command to send a query to RAGFlow, which will internally call Ollama for text generation:
curl -X POST http://localhost:5001/query -d '{
"question": "What is RAGFlow?"
}'
RAGFlow will process the query, retrieve relevant knowledge, and use Ollama’s deepseek-r1:7b model to generate a response.
6. Integration and Application
Now that both Ollama DeepSeek and RAGFlow are running and configured to work together, you can integrate them into your applications. For example:
- Use RAGFlow as a knowledge retrieval system that leverages Ollama DeepSeek for text generation.
- Build a custom API layer on top of RAGFlow to handle specific use cases.