Run DeepHermes 3 on Linux: Step by Step Installation Guide

Run DeepHermes 3 on Linux: Step by Step Installation Guide

DeepHermes-3 is a cutting-edge language model that can be run locally on a Linux system, offering powerful reasoning capabilities directly on your machine. This guide provides a detailed installation process, covering all the necessary steps to get DeepHermes-3 running on your Linux environment.

Prerequisites

Before diving into the installation, ensure your system meets the following prerequisites:

  • A 64-bit (x86_64) compatible computer: This is a standard requirement for most modern Linux distributions.
  • Minimum 2GB RAM (4GB+ recommended): DeepHermes-3 benefits from more RAM, especially when running larger models.
  • Minimum 20GB storage space: Ensure sufficient storage for the operating system, dependencies, and the DeepHermes-3 model itself.
  • Internet connection: An active internet connection is needed to download the necessary packages and dependencies.
  • Basic knowledge of Linux commands: Familiarity with the command line interface is essential for navigating the installation process.

Step by Step Installation Guide

Step 1: Installing Arch Linux (if necessary)

If you do not have Arch Linux already, follow these steps.

  1. Back Up Your Data: Before proceeding, back up ALL data from the target installation drive, as the installation process will erase existing data.
  2. Create Installation Media:Using Rufus (Windows):
    1. Download Rufus from https://rufus.ie.
    2. Insert your USB drive.
    3. Select the Arch Linux ISO.
    4. Choose these specific settings:
      • Partition scheme: GPT
      • Target system: UEFI
      • File system: FAT32
    5. Click Start and wait for completion.
  3. Boot Preparation:
    1. Disable Secure Boot in BIOS/UEFI settings.
    2. Set boot priority to USB.
    3. Save changes and restart.
    4. When the Arch boot menu appears, select "Arch Linux install medium".
    5. EFI System Partition (ESP):
      • Size: 550MB
      • Type code: ef00
      • Command sequence: n, 1, default, +550M, ef00
    6. Root partition:
      • Size: Remaining space
      • Type code: 8300
      • Command sequence: n, 2, default, default, 8300
  4. Exit and Reboot:Exit the chroot environment:
exit

Unmount all partitions:

umount -R /mnt

Reboot:

reboot
  1. Enable Essential Services:
systemctl enable NetworkManager
systemctl enable fstrim.timer
  1. Configure Boot Loader:Install GRUB:
grub-install --target=x86_64-efi --efi-directory=/boot/efi \
--bootloader-id=GRUB
grub-mkconfig -o /boot/grub/grub.cfg
  1. User Configuration:Set root password:
passwd
  1. Create user account:
useradd -m -G wheel,audio,video,optical,storage username
passwd username
  1. Configure sudo:
EDITOR=vim visudo
# Uncomment %wheel ALL=(ALL:ALL) ALL
  1. Configure Base System:Change root into the new system:
arch-chroot /mnt
  1. Set timezone:
ln -sf /usr/share/zoneinfo/Region/City /etc/localtime
hwclock --systohc
  1. Configure locale:
vim /etc/locale.gen
# Uncomment en_US.UTF-8 UTF-8
locale-gen
echo "LANG=en_US.UTF-8" > /etc/locale.conf
  1. Set hostname:
echo "myhostname" > /etc/hostname
  1. Configure hosts file:
vim /etc/hosts

Add:

127.0.0.1 localhost
::1 localhost
127.0.1.1 myhostname.localdomain myhostname
  1. Generate fstab:
genfstab -U /mnt >> /mnt/etc/fstab
  1. Install Essential Packages:Install base system:
pacstrap /mnt base base-devel linux linux-firmware intel-ucode \
vim networkmanager grub efibootmgr

Note: Use amd-ucode instead of intel-ucode for AMD processors[2].

  1. Mount Partitions:Mount root first:
mount /dev/nvme0n1p2 /mnt

Create and mount EFI directory:

mkdir -p /mnt/boot/efi
mount /dev/nvme0n1p1 /mnt/boot/efi
  1. Format Partitions:Format the EFI partition:
mkfs.fat -F 32 /dev/nvme0n1p1

Format the root partition:

mkfs.ext4 /dev/nvme0n1p2
  1. Partition the Disk:First, identify your target disk:
lsblk

For a modern UEFI system with a single disk, create these partitions using gdisk:

gdisk /dev/nvme0n1 # or /dev/sda for SATA drives

Create the following partition layout:Write changes: w

  1. Update System Clock:
timedatectl set-ntp true
timedatectl status
  1. Connect to the Internet:For wired connections:
ip link
dhcpcd

For wireless:

iwctl
device list
station wlan0 scan
station wlan0 get-networks
station wlan0 connect SSID
# Enter password when prompted
exit

Verify connection:

ping -c 3 archlinux.org
  1. Verify Boot Mode:
ls /sys/firmware/efi/efivars

If this directory exists, you're in UEFI mode (correct). If not, you need to boot in UEFI mode.

  1. Download and Verify the ISO:
sha256sum path/to/archlinux.iso

Step 2: Install Ollama

Ollama is a tool that simplifies the process of running language models like DeepSeek-R1. It handles the complexities of model management, making it easy to download, run, and manage different models.

To install Ollama, follow these steps:

  1. Download and install Ollama: Follow the instructions on the official Ollama website to download and install the appropriate package for your Linux distribution.
  2. Verify the installation: Open a new terminal and run the command ollama --version. If Ollama is installed correctly, it will display the version number.

Step 3: Download and Run DeepHermes-3

With Ollama installed, downloading and running DeepHermes-3 is straightforward.

  1. Run DeepHermes-3: Once the download is complete, Ollama will automatically run DeepHermes-3, and you can start interacting with the model by entering prompts in the terminal.
  2. Download DeepHermes-3: Use the following command to download the DeepHermes-3 model:
ollama run deepseek-r1:70b

Note: Replace 70b with the appropriate model size, such as 7b or 8b, depending on your system's capabilities and desired performance.

Step 4: Interacting with DeepHermes-3

Once DeepHermes-3 is running, you can start experimenting with its capabilities by providing prompts and observing the model's responses.

  1. Enter your first prompt: Type your prompt in the terminal and press Enter. DeepHermes-3 will process your input and generate a response.
  2. Experiment with different prompts: Try different types of prompts to explore the model's versatility and reasoning capabilities.

Step 5: Managing DeepHermes-3 Models

Ollama provides commands for listing and removing models, allowing you to manage your disk space and switch between different models as needed.

Removing installed models: To remove an installed model and free up disk space, use the following command:

ollama rm deepseek-r1:70b

Replace 70b with the appropriate model size you wish to remove.

Listing installed models: To view all models downloaded, run the following command:

ollama list

This command will display a list of all the models currently installed on your system, along with their sizes and other relevant information.

Step 6: Post-Installation Tasks

After rebooting and logging in:

Install basic desktop environment (optional):

sudo pacman -S xorg-server xorg-xinit
# Then install your preferred desktop environment

Update system:

sudo pacman -Syu

Connect to network:

nmtui

Troubleshooting

  • No bootloader entry:
    • Verify EFI partition is mounted correctly
    • Ensure GRUB installation path is correct
    • Check if Secure Boot is disabled
  • No network after reboot:
    • Start NetworkManager: sudo systemctl start NetworkManager
    • Connect using: nmtui
  • Black screen after install:
    • Boot with kernel parameter: nomodeset
    • Install appropriate graphics drivers after booting

Maintaining Your Installation

Check system logs for issues:

journalctl -p 3 -xb

Clean package cache periodically:

sudo pacman -Sc

Regular system updates:

sudo pacman -Syu

Conclusion

By following this guide, you should now have DeepHermes-3 successfully installed and running on your Linux system. You can now explore its capabilities and integrate it into your projects.

References

  1. Run DeepSeek Janus-Pro 7B on Mac: A Comprehensive Guide Using ComfyUI
  2. Run DeepSeek Janus-Pro 7B on Mac: Step-by-Step Guide
  3. Run DeepSeek Janus-Pro 7B on Windows: A Complete Installation Guide
  4. Run DeepHermes 3 on Windows: Step by Step Installation Guide
  5. Run DeepHermes 3 on macOS: Step by Step Installation Guide