This guide will walk you through the process of setting up and running the Safe Deepseek environment. Follow these steps in order to ensure proper configuration.
You'll need either Docker or Podman installed on your system:
Docker Setup
Podman Setup
Important: Safe Deepseek requires NVIDIA GPU support. Follow these steps carefully:
-
Install NVIDIA GPU Driver
- Install using your distribution's package manager (recommended)
- Or download from NVIDIA Official Drivers
- Verify driver installation:
This should display your GPU information
nvidia-smi
-
Install NVIDIA Container Toolkit
Choose your package manager:
For Ubuntu/Debian (apt):
# Setup the repository and GPG key curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \ && curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | \ sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \ sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list # Update package listing sudo apt-get update # Install the toolkit sudo apt-get install -y nvidia-container-toolkit
For RHEL/CentOS/Rocky (yum/dnf):
# Setup the repository curl -s -L https://nvidia.github.io/libnvidia-container/stable/rpm/nvidia-container-toolkit.repo | \ sudo tee /etc/yum.repos.d/nvidia-container-toolkit.repo # Install the toolkit sudo yum install -y nvidia-container-toolkit
-
Configure Container Runtime
For Docker:
# Configure the runtime sudo nvidia-ctk runtime configure --runtime=docker # Restart Docker daemon sudo systemctl restart docker
For Podman:
- Podman uses CDI (Container Device Interface) for NVIDIA GPU access
- No additional configuration required
Without proper NVIDIA GPU setup, the container will not function correctly and will fallback to CPU-only mode. For troubleshooting and advanced configurations, refer to the official documentation.
Before you begin, please read our Contributing Guidelines if you plan to modify the code or contribute to the project.
First, you'll need to download the required models using our downloader tool. For detailed instructions, see our Model Download Guide.
Quick steps:
- Navigate to the
downloaderdirectory - Choose the appropriate executable for your system:
- Linux:
ollama-dl-linux-amd64 - macOS Intel:
ollama-dl-darwin-amd64 - macOS M1/M2:
ollama-dl-darwin-arm64 - Windows:
ollama-dl-windows-amd64.exe
- Linux:
- Make it executable (Linux/macOS):
chmod +x ollama-dl-* - Run the downloader:
./ollama-dl-* pull deepseek-r1 ./volume/models
Run the setup script to configure proper permissions for the model volume:
./setupThis script ensures that the container has appropriate read-only access to the models stored in the volume directory.
Note: Ensure you have completed the NVIDIA GPU setup before proceeding. The container requires GPU access to function properly.
Choose your preferred container runtime (Docker or Podman) and follow these steps:
-
Navigate to the corresponding configuration directory:
- For Docker:
config/docker/ - For Podman:
config/podman/
- For Docker:
-
Copy the runtime script to your project root:
# For Docker cp config/docker/docker-runtime ./ # OR for Podman cp config/podman/podman-runtime ./
-
Make the script executable:
chmod +x *-runtime
For detailed configuration options, see our Configuration Guide.
Start the container using your chosen runtime script:
# For Docker
./docker-runtime
# OR for Podman
./podman-runtimeFor detailed setup instructions:
- Docker: See our Docker Setup Guide
- Podman: See our Podman Setup Guide
Verify the setup by running a test prompt:
# For Podman
podman exec -it <container-name> ollama run modelname "Your test prompt"
# For Docker
docker exec -it <container-name> ollama run modelname "Your test prompt"The service is accessible via HTTP at:
http://localhost:11434/api/tags
You can integrate this endpoint with:
- IDE extensions
- Applications
- OpenWebUI
- Other compatible tools
For NVIDIA GPU support, install the NVIDIA Container Toolkit: