Hermes Agent on Raspberry Pi Zero 2 W: Portable AI via USB Gadget Mode | IT HomeLab

Want a truly portable AI agent you can carry in your pocket? In this guide I’ll show you how to install Hermes Agent on a Raspberry Pi Zero 2 W running in USB gadget mode โ€” turning it into a self-contained AI assistant that powers and connects directly from your phone or iPad via a single USB-C cable.


๐ŸŽฅ Watch the Video Tutorial


๐Ÿ’ก Why Hermes on a Pi Zero 2 W in Gadget Mode?

The Raspberry Pi Zero 2 W is tiny (about the size of a credit card), costs ~$15, and draws minimal power. Running Hermes Agent on it is interesting enough, but putting it in USB gadget mode makes it genuinely portable.

Gadget mode means the Pi doesn’t need Wi-Fi or networking at all. You plug it directly into your phone or iPad via USB-C, and it creates a virtual Ethernet connection. Your phone sees it as a network adapter. Hermes runs on the Pi, you access it through the USB connection, and you’ve got a pocket-sized AI assistant that works anywhere โ€” no Wi-Fi, no hotspot dependency, no latency issues.

This is the setup from my earlier Raspberry Pi USB Gadget Mode guide, but specifically optimized for running Hermes on constrained hardware.

โ„น๏ธ Note: This builds on the USB gadget mode setup. If you haven’t already set that up on a Pi Zero 2 W, see the gadget mode guide first, then come back here to add Hermes Agent on top.

๐Ÿ›  What You’ll Need

  • A Raspberry Pi Zero 2 W (4-core ARM, 512MB RAM)
  • MicroSD card โ€” 32GB minimum, 64GB recommended
  • Raspberry Pi Imager โ€” to flash the OS
  • A phone or iPad with USB-C (tested on iPhone 16 and iPad Pro 2018)
  • USB-C cable to connect Pi to your device
  • A Nous account (free tier, for Hermes Agent)
  • Basic familiarity with SSH and terminal commands
๐Ÿ’ก Tip: The Pi Zero 2 W has only 512MB of RAM. This guide uses a trick (custom temp directory) to make Hermes installation manageable. It’s slower than on larger Pi models, but totally usable once running.

๐Ÿ“‹ Step-by-Step Setup

1. Flash Raspberry Pi OS Lite with Raspberry Pi Imager

Open Raspberry Pi Imager and select:

  • Device: Raspberry Pi Zero 2 W
  • OS: Raspberry Pi OS (other) โ†’ Raspberry Pi OS Lite
  • Storage: Your microSD card

Before writing, click the gear icon to pre-configure:

  • Hostname: Something like hermes-pi-zero
  • Username: Default pi or your own (more secure)
  • Password: A strong one you’ll remember
  • Wireless LAN: Your Wi-Fi SSID and password (temporary, for installation)
  • Locale: Your timezone and keyboard layout
  • SSH: Enable with password authentication

Write the image and eject the card when done.

2. Boot the Pi and Find Its IP Address

Insert the microSD card into the Pi Zero 2 W and power it on. Wait 1-2 minutes for it to boot and expand the filesystem.

Find the Pi’s IP address by:

  • Checking your router’s DHCP leases for a device named with your hostname
  • Using an advanced IP scanner app on your computer
  • SSHing to hermes-pi-zero.local if your network supports mDNS

3. SSH In and Download the USB Gadget Setup Script

Connect via SSH:

ssh pi@10.0.3.x

Download the USB gadget setup script from my GitHub repository:

wget https://github.com/ithomelabonline/resources/blob/main/scripts/raspi/pi0-2w-eth-gadget.sh
chmod +x pi0-2w-eth-gadget.sh
sudo ./pi0-2w-eth-gadget.sh

This script:

  • Installs required packages (libcomposite, python3-configshell-fb)
  • Modifies kernel config to enable USB gadget mode
  • Creates the virtual Ethernet gadget on boot
  • Reboots to activate the gadget

When it asks about configuring for hotspot, answer no (we’ll rely on the USB Ethernet gadget instead).

4. Connect via USB Gadget Mode

After reboot, SSH back in using the gadget IP address:

ssh pi@10.55.0.1

Verify the gadget is active with:

ip a

You should see the usb0 interface with IP 10.55.0.44 assigned to the Pi, and your computer should have gotten 10.55.0.10.

โš ๏ธ Important: Once gadget mode is active, your Pi no longer needs Wi-Fi for connectivity. You will still need WiFi or hotspot for hermes to connect to the LLMs.

5. Create a Temp Directory for Hermes Installation

The Pi Zero 2 W only has 512MB of RAM. Some Hermes dependencies are memory-hungry during installation. Create a custom temp directory to give the installer more breathing room:

mkdir -p ~/hermes-tmp
export TMPDIR=~/hermes-tmp

The installation will be slower than on larger hardware, but this prevents out-of-memory errors.

6. Install Hermes Agent

Download and run the Hermes Agent installer from the Hermes Agent website:

curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash

(Copy the exact installer command from the Hermes website.)

The installer will walk you through a setup wizard. For a Pi Zero 2 W, keep things simple:

  • Model: Use the default (Step 1 / Claude 3.5 Sonnet via Nous)
  • Storage: Keep local
  • Messaging: Skip for now (optional, but we won’t set it up here)

The installation takes a few minutes. Be patient โ€” this is constrained hardware.

7. Test Hermes Chat

Once installation completes, test Hermes with:

hermes chat

Type a question to Hermes. It should respond (a bit slower than on larger hardware, but usable). Try asking:

"What hardware am I running on?"

Hermes should detect that it’s on a Pi Zero 2 W and report the exact specs.

8. Plug Into Your Phone and Access Remotely

Now for the magic: disconnect the Pi Zero 2 W from your computer, connect it to your phone or iPad via USB-C cable.

On your iOS device, go to Settings โ†’ Wi-Fi and you should see the Pi listed as a connected USB Ethernet adapter. Your phone automatically gets an IP on the 10.55.0.x network.

SSH back in:

ssh pi@10.55.0.1

From there, you can run hermes chat and interact with your portable AI agent, powered entirely by the phone, with zero Wi-Fi dependency.


๐Ÿš€ What’s Next?

Now you’ve got a pocket-sized Hermes Agent. Some ideas:

  • Use it on road trips โ€” Hermes works wherever you have internet (it connects through Nous Portal)
  • Set up Telegram or Discord integration โ€” Control Hermes from messaging apps instead of SSH
  • Add a power bank โ€” Run it completely untethered for hours
  • Customize skills โ€” Teach Hermes to do specific tasks (web research, automation, etc.)
  • Deploy to iPad โ€” Use the same setup on an iPad Pro with USB-C

โœ… Conclusion

A Raspberry Pi Zero 2 W running Hermes Agent in USB gadget mode is genuinely portable compute. Plug it into your phone, and you’ve got an AI assistant in your pocket that requires no Wi-Fi, no hotspot, no networking at all.

The setup is straightforward: flash the OS, enable USB gadget mode with a script, install Hermes, and plug it in. The Pi Zero 2 W is constrained hardware, so Hermes runs a bit slower than on larger boards, but it’s completely usable and the experience is genuinely novel.

This is the kind of thing that sounds gimmicky until you actually have it working, and then you realize you’ve built something genuinely useful and cool.

๐Ÿ“บ Watch the full video guide: https://youtu.be/_9c1EMMKLNU

If you found this helpful, like and subscribe to IT HomeLab Online on YouTube for more tutorials.

โ˜•๏ธ Support the channel: Patreon ยท Buy Me a Coffee

Enjoyed this guide?

Subscribe to the channel for more homelab builds, Raspberry Pi projects, and AI automation tutorials.

▶ Watch on YouTube