Grant Internet Access to DeepSeek-R1: A step-by-step guide.
In this guide, I’ll walk you through the process of granting internet access to DeepSeek-R1 and enhancing your language model’s capabilities using Khoj, an open-source software solution. I’ll be demonstrating the installation process using Docker on an M4 Mac Mini Pro with 24GB RAM, though these instructions can be adapted for other systems.
Video Overview
As ever, this post started out life as a video. You can watch as I get this setup on my Mac:
Pre-Requisites
Before we begin, you’ll need:
- DeepSeek and Ollama installed – here’s my guide
- Docker installed (default settings are fine)
- Homebrew (recommended)
- A basic understanding of terminal commands
Setting Up Homebrew
If you haven’t already installed Homebrew (especially useful for AI/ML work), you can do so by:
- Copy the installation code from the Homebrew website
- Paste it into your terminal
- Enter your password when prompted
- Run the additional commands provided to add Homebrew to your path
Installation Process
1. Initial Setup
First, navigate to your home directory and create a new directory for Khoj:
cd ~
mkdir .khoj
cd .khoj
2. Installing Required Tools
You’ll need wget, which can be installed via Homebrew:
brew install wget
3. Configure Docker Container
- Download the Docker compose file from the Khoj website
- Edit the docker-compose.yml file to set:
- Admin username
- Admin password
- Admin email
- Uncomment the openai_base_url
4. Building the Container
Run the following command:
docker-compose up
Note: This process typically takes 10-15 minutes depending on your internet speed.
5. Accessing Khoj
Once installation is complete:
- Open your browser and navigate to localhost:42110
- Wait for the Khoj object to be ready for use
- You should see the Khoj interface, though it won’t be connected to Deep Seek yet
Connecting to and Giving Internet Access to DeepSeek-R1
1. Accessing Admin Panel
- Navigate to the Khoj admin panel
- Log in using the credentials you set in the docker-compose.yml file
2. Setting Up the AI Model
- Go to AI Models section
- Add a new AI model:
- Name it “ollama”
- Add any placeholder text for the API key
- Use the correct API base URL :
http://host.docker.internal:11434/v1
- Save the configuration
3. Important Notes
- After setting up the AI model, restart the Khoj container
- Reload your browser
- The chat models should now appear, including DeepSeek-R1
Creating a Research Agent
To maximize the utility of your setup:
- Navigate to the Agents section
- Create a new agent with research characteristics
- Select Deep Seek-R1 (I’d suggest using 7 billion parameters on a 24GB Mac as it’s a good balance of capable and speed) as your model
- Configure input tools and output modes as needed
Testing the Setup
To verify everything is working:
- Start a chat with your research agent
- Ask a simple factual question
- Observe how the system uses both online resources and the language model to generate responses
- Monitor GPU usage through Activity Monitor to see the system in action
Future Possibilities
This setup opens up numerous possibilities for:
- Integration with knowledge bases
- Custom file integration
- Image generation capabilities
- Automation features
Remember that Khoj is open-source and continuously evolving, so new features and capabilities may become available over time.
By following these steps, you’ll have successfully set up DeepSeek-R1 with internet access, significantly expanding its capabilities and potential applications.
No Responses