Skip to main content

How to Run DeepSeek-R1 on Hyperstack

Beta Notice

Hyperstack's AI images are currently in Beta, and you may experience bugs or performance issues as we continue to refine them.

In this article

How to Deploy DeepSeek-R1 on Hyperstack

Follow the step-by-step process below to deploy DeepSeek-R1 on Hyperstack.

flavor compatibility

The DeepSeek-R1 image has been tested and confirmed to work on the 8xH100 PCIe, 8xH100 NVLink, and 8xH100 SXM5 GPU flavors. It is recommended to select one of these flavors during VM deployment, as using any other flavor may result in deployment failure.

Step 1: Deploying a Virtual Machine with DeepSeek-R1

  1. Start VM Deployment: Navigate to the "Virtual Machines" section in Hyperstack, and click "Deploy New Virtual Machine".

    Deploy VM 1

  2. Choose Hardware Configuration: Select the 8xH100 PCIe, 8xH100 NVLink, or 8xH100 SXM flavor.

    flavor compatibility

    Selecting other flavors may lead to deployment failure.

  3. Choose Environment: Select an environment where your virtual machine will be deployed. If this is your first time deploying a VM, see our Getting Started tutorial for creating one.

  4. Select Image: Choose the "DeepSeek R1" operating system image.

  5. Choose SSH Keypair: Choose an SSH key pair for secure access to the VM. If you don’t have one, see our Getting Started tutorial to create one.

  6. Assign Public IP Address: Click the "Public IP Address" toggle to assign a public IP to your virtual machine, enabling internet access for remote management and API access.

  7. SSH Configuration: Click the "SSH Access" toggle to enable SSH, allowing you to securely connect to and manage your VM.

  8. Enable OpenWebUI Access: To access the OpenWebUI interface for interacting with DeepSeek-R1, follow these steps to allow incoming traffic on port 3000:

    i. At the bottom of the VM deployment page click "Configure Additional Settings** and scroll down to "Firewall Rules"

    ii. Click "Add Inbound Rule" and configure as follows:

    • a. Ether type: Select either IPv4 or IPv6.
    • b. Internet protocol: Choose TCP.
    • c. Port range: Set to port 3000 which hosts the OpenWebUI.
    • d. Remote IP prefix: Enter the IP address of the machine that will be used to access the OpenWebUI, replacing the default 0.0.0.0/0 which permirts traffic from any IP.
    • e. Click Add.

    Port 3000 ingress

  9. Finalize Deployment: Double-check all your settings and click the "Deploy" button to launch your virtual machine.

Image Setup Time

Image setup typically takes about 10 minutes, during which OpenWebUI is installed, and the DeepSeek-R1 model is downloaded and loaded. Once complete, your VM will be accessible as outlined in the next step.

Step 2: Accessing Your VM via SSH and OpenWebUI

Access via SSH

Once initialization is complete, you can access your VM by executing the following SSH command in a terminal:

ssh -i [path_to_ssh_key] ubuntu@[vm_ip_address] 
  • Replace '[path_to_ssh_key]' with the path to the SSH key you selected during VM deployment.

  • Replace '[vm_ip_address]' with your virtual machine's IP address, which can be found on the My Virtual Machines page under the PUBLIC IP column.

e.g. ssh -i /users/username/downloads/keypair_hyperstack [email protected]

If you're unable to connect via SSH, see our SSH connection guide here.

Access via OpenWebUI

To access the DeepSeek-R1 model running on your VM via OpenWebUI, follow these steps:

  1. Visit http://[public-ip]:3000 in your browser, replacing [public-ip] with the public IP address of the VM.
    e.g. http://198.145.126.7:3000

  2. Set up an admin account for OpenWebUI and save your username and password for future logins.

    OpenWebUI 1

    You can now start talking to your self-hosted DeepSeek R1.

    OpenWebUI 2

note

For longer conversations, Ollama may encounter errors. To resolve this, follow the instructions below to increase the context size. For more details on the issue, see here.

Optional - Increasing Context Size for DeepSeek-R1

The DeepSeek-R1 image has a default context size of 12,888 tokens. To adjust it, follow the steps below:

  1. Click on your username at the bottom left and then on 'Admin Panel'.

    Context Size 1

  2. Click on the "Settings" tab at the top.

    Context Size 2

  3. Click on 'Models' in the left sidebar. This will take you to an overview of all the models available on your machine.

  4. Click on the Pencil icon to the right of 'DeepSeek-r1-671B'.

    Context Size 3

  5. Click on 'Advanced params' to find the context length.

    Context Size 4

  6. You can customize the Context Length by entering a value that meets your requirements.

Step 3: Hibernating Your VM

When finished done with your workload, you can hibernate your VM to avoid unnecessary costs. Learn more about hibernation and pricing here.

For step-by-step instructions on hibernating your VM, click here.