Skip to content

How-ToOS

How to Run a Local LLM on a Raspberry Pi 5 With the AI HAT+ 2

How to run a local LLM on a Raspberry Pi 5 with the AI HAT+ 2 and its 40 TOPS Hailo-10H accelerator and 8GB of on-board RAM: fit the cooler, heatsink and HAT, install the hailo-h10-all drivers and Hailo's Ollama server, pull a model and add Open WebUI in Docker.

By , Systems & Technical Editor

6 min read

How to Run a Local LLM on a Raspberry Pi 5 With the AI HAT+ 2

It's based on Raspberry Pi's official product page and documentation, and Ollama's Linux documentation, all read on 24 November 2026.

A full gaming PC is overkill if all you want is a small, always-on AI assistant for simple jobs like translating short passages or answering quick questions. The Raspberry Pi 5 is a tiny, low-power computer, and Raspberry Pi's AI HAT+ 2 add-on board gives it a dedicated AI chip for running small large language models (LLMs) locally.

This guide covers what you need, how to fit the AI HAT+ 2, and how to install and use the software. It's a project for small models and experiments: if you want to run bigger models, a PC with a graphics card is still the better tool. Our guide to checking whether your PC can run a local LLM is a good place to start for that.

What the AI HAT+ 2 is

According to Raspberry Pi, the AI HAT+ 2:

  • Uses a Hailo-10H AI accelerator, rated at 40 TOPS (INT4)

  • Has 8GB of on-board RAM dedicated to the AI chip, leaving the Raspberry Pi 5 free to handle other tasks

  • Can run LLMs and vision-language models (VLMs) locally, as well as the vision AI models supported by the original AI HAT+

  • Connects to the Raspberry Pi 5 through its PCIe port using a ribbon cable

  • Comes with an optional heatsink, a 16mm GPIO stacking header, spacers and screws, so it can fit on a Raspberry Pi 5 with the Raspberry Pi Active Cooler in place

The original AI HAT+ (with a Hailo-8L or Hailo-8 chip) and the older AI Kit can run vision models such as object detection, but Raspberry Pi's documentation says only the AI HAT+ 2 can run LLMs.

Raspberry Pi describes the Hailo-10H as an NPU (neural processing unit), an AI accelerator chip that handles AI work more efficiently than the Raspberry Pi's own processor. Our explainer on NPU vs GPU for local AI covers the differences between the two.

What you need

  • A Raspberry Pi 5

  • A Raspberry Pi AI HAT+ 2

  • Raspberry Pi OS (64-bit), the Trixie release, which Raspberry Pi's documentation says is required

  • A Raspberry Pi Active Cooler, which Raspberry Pi recommends

  • A power supply, storage for the operating system, and either a keyboard, mouse and screen or remote access

Step 1: Fit the cooler, heatsink and HAT

Raspberry Pi's documentation says to make sure the Raspberry Pi 5 is disconnected from power before you start. The main steps are:

  1. Fit the Active Cooler to the Raspberry Pi 5 (recommended): remove the protective paper from its thermal pads, press its two push pins into the heatsink holes until they click, and plug its fan into the fan socket.

  2. Fit the AI HAT+ 2 heatsink to the HAT before mounting it. Remove the protective paper from the thermal pads, line up the push pins with the holes in opposite corners, and press them in. Raspberry Pi recommends the heatsink especially for intensive AI workloads, to stop the board slowing down due to overheating. It also advises against removing the heatsink once fitted, as this can damage the push pins and thermal pads.

  3. Fit the spacers to the Raspberry Pi 5 with the four longer screws.

  4. Fit the GPIO stacking header onto the Raspberry Pi 5's GPIO pins.

  5. Connect the PCIe ribbon cable to the Raspberry Pi 5's PCIe connector and close the retaining clip.

  6. Mount the HAT on the spacers with the four shorter screws.

  7. Connect the other end of the ribbon cable to the PCIe connector on the HAT and close its retaining clip.

Raspberry Pi's AI HAT+ documentation has diagrams for each step.

Step 2: Update Raspberry Pi OS and the firmware

Start the Raspberry Pi and open a Terminal. Raspberry Pi says the system should be fully up to date with the latest firmware:

sudo apt update
sudo apt full-upgrade -y
sudo rpi-eeprom-update -a
sudo reboot

You don't need to enable PCIe Gen 3.0 speeds manually. Raspberry Pi's documentation says that step is only for the older AI Kit, and the setting is applied automatically for the AI HAT+ and AI HAT+ 2.

Step 3: Install the Hailo drivers

The AI HAT+ 2 uses a different software package from the original AI HAT+ and AI Kit, and Raspberry Pi notes that the two packages can't be installed together. For the AI HAT+ 2, run:

sudo apt install dkms
sudo apt install hailo-h10-all

Then reboot:

sudo reboot

To check that the AI chip has been detected, run:

hailortcli fw-control identify

Raspberry Pi says you should see the device's board details, and that the AI HAT+ 2 may show blank values for the serial number, part number and product name, which is expected. You can also check the kernel log with dmesg | grep -i hailo.

Step 4: Install the Hailo Ollama server

LLMs on the AI HAT+ 2 run through Hailo's own version of an Ollama server, called hailo-ollama. It loads models from Hailo's Gen-AI Model Zoo, runs them on the Hailo-10H and exposes a REST API.

Raspberry Pi's documentation links to version 5.1.1 of the Hailo Model Zoo GenAI Debian package for Raspberry Pi 5. Download it, then install it from the folder you saved it to:

sudo dpkg -i hailo_gen_ai_model_zoo_5.1.1_arm64.deb

Check Raspberry Pi's documentation for the current version before you download, in case it has been updated.

Step 5: Start the server and download a model

Start the server in a Terminal window:

hailo-ollama

In a second Terminal window, list the models available:

curl --silent http://localhost:8000/hailo/v1/list

Download a model from the list. Raspberry Pi's documentation uses qwen2:1.5b as an example:

curl --silent http://localhost:8000/api/pull -H 'Content-Type: application/json' -d '{ "model": "qwen2:1.5b", "stream" : true }'

Then send it a prompt:

curl --silent http://localhost:8000/api/chat -H 'Content-Type: application/json' -d '{"model": "qwen2:1.5b", "messages": [{"role": "user", "content": "Translate to French: The cat is on the table."}]}'

Note that these commands use port 8000, the port Raspberry Pi's documentation gives for hailo-ollama.

Step 6: Add a chat interface with Open WebUI (optional)

Typing curl commands gets old quickly. Raspberry Pi's documentation shows how to use Open WebUI as a browser-based chat interface instead. Open WebUI needs to run in a Docker container on Raspberry Pi OS Trixie, because, as Raspberry Pi explains, it isn't compatible with the Python 3.13 that Trixie uses.

Once you've installed Docker (Raspberry Pi's documentation walks through it, following Docker's Debian instructions), download Open WebUI:

docker pull ghcr.io/open-webui/open-webui:main

With hailo-ollama running, start Open WebUI and point it at the Hailo server:

docker run -d -e OLLAMA_BASE_URL=http://127.0.0.1:8000 -v open-webui:/app/backend/data --name open-webui --network=host --restart always ghcr.io/open-webui/open-webui:main

Raspberry Pi says the container can take up to a minute to start. You can watch its progress with docker logs open-webui -f. Then open http://127.0.0.1:8080 in the Raspberry Pi's web browser, choose a model and start chatting. Our guide to installing Open WebUI with Ollama covers the interface in more detail.

Going further

  • Vision-language models: Raspberry Pi's documentation points to Hailo's hailo-apps GitHub repository for running VLMs and other generative AI tasks on the AI HAT+ 2.

  • Without the AI HAT+ 2: the standard Ollama app has an ARM64 build for Linux, according to Ollama's documentation, so you can also run small models on the Raspberry Pi 5's own processor, though Raspberry Pi says the NPU handles AI work more efficiently than the CPU. Our guide to running a local LLM without a GPU covers CPU-only AI.

  • Something more powerful: if a Raspberry Pi is too limited, see our best mini PCs for local AI.

Our verdict

The Raspberry Pi AI HAT+ 2 turns a Raspberry Pi 5 into a small, self-contained local AI box. Fit the Active Cooler and the supplied heatsink, run Raspberry Pi OS Trixie, install the hailo-h10-all package and the Hailo Model Zoo GenAI package, and you can chat with small models such as Qwen2 1.5B through hailo-ollama on port 8000, with Open WebUI in Docker as an optional chat interface. It's a good fit for small models and tinkering, not a replacement for a PC with a graphics card.

The bottom line

The Raspberry Pi AI HAT+ 2 turns a Raspberry Pi 5 into a small, self-contained local AI box. Fit the Active Cooler and the supplied heatsink, run Raspberry Pi OS Trixie, install the hailo-h10-all package and the Hailo Model Zoo GenAI package, and you can chat with small models such as Qwen2 1.5B through hailo-ollama on port 8000, with Open WebUI in Docker as an optional chat interface. It's a good fit for small models and tinkering, not a replacement for a PC with a graphics card.

Sources

  1. 01Raspberry Pi, AI HAT+ 2 product page
  2. 02Raspberry Pi, AI HATs documentation
  3. 03Raspberry Pi, AI software documentation
  4. 04Hailo, hailo-apps (GitHub)
  5. 05Ollama, Linux documentation

About the author

Marcus Thorne

Systems & Technical Editor

Marcus writes Forge PC's step-by-step build, troubleshooting and system optimisation guides. His background spans Windows kernel and power-state diagnostics, UEFI/BIOS configuration, NVMe storage arrays, ATX 3.1 power delivery and running local AI and LLM workloads on consumer graphics cards.

More from Marcus Thorne

Read next

SGLang vs vLLM: Which LLM Serving Engine Should You Run on Your PC?

Versus

SGLang vs vLLM: Which LLM Serving Engine Should You Run on Your PC?

SGLang vs vLLM for a local AI server: both are fast, open-source LLM serving engines with OpenAI-compatible APIs that run on Linux. vLLM supports more home hardware, including AMD Radeon RX 7900 and RX 9000 cards, while SGLang suits recent NVIDIA RTX cards and agent-heavy workloads.

Callum Reid6 min

ComfyUI vs AUTOMATIC1111: Which Local AI Image Generator Should You Use in 2026?

Versus

ComfyUI vs AUTOMATIC1111: Which Local AI Image Generator Should You Use in 2026?

ComfyUI vs AUTOMATIC1111 in late 2026: ComfyUI is actively developed (v0.46.0 on 18 November 2026), supports Flux.2, Qwen Image and video models and has a desktop installer. A1111's web UI hasn't had a release since v1.10.1 in February 2025, so it only makes sense if you already have a working SD 1.5 or SDXL setup.

Callum Reid6 min