# Copilot CLI offline on a Raspberry Pi 5: the $375 setup, step by step, and what a 1.5B model can do

> GitHub Copilot CLI can run on a Pi 5 with the AI HAT+ 2 and a local 1.5B coding model, no subscription needed. The stack, the cost, the offline switch and its limits.

Published 2026-11-29 · https://smarterthanus.ai/copilot-cli-offline-raspberry-pi-5-ai-hat-2/

## TL;DR

- GitHub's VP of Developer Relations, Martin Woodward, runs Copilot CLI on a Pi 5 with the AI HAT+ 2 against the local **qwen2.5-coder:1.5b** model.
- The two main boards cost **$375** today ($200 for the HAT, $175 for an 8GB Pi 5), before power supply, cooler and card.
- Copilot CLI needs no Copilot subscription when you bring your own model; add **COPILOT_OFFLINE=true** so it stops talking to GitHub at all.
- It's good for summaries and first drafts; GitHub recommends a 128k context, and the Pi setup runs with **3,072** prompt tokens.

Yes, GitHub Copilot CLI runs on a Raspberry Pi 5 with no cloud model behind it. Martin Woodward, GitHub's VP of Developer Relations, [published the setup](https://www.woodwardweb.com/post/2026/10/raspberry-pi-ai-hat-local-models-for-copilot/): a Pi 5 with the AI HAT+ 2 serves the open **qwen2.5-coder:1.5b** model, a small proxy makes it look like an OpenAI endpoint, and Copilot CLI's bring-your-own-model mode points at it. You don't need a GitHub account, a token or a Copilot subscription. You do need about $375 of boards, patience, and modest expectations: it's a summaries-and-first-drafts machine, not a replacement for a frontier model.

The story went round this weekend via [XDA](https://www.xda-developers.com/someone-got-a-private-offline-github-copilot-cli-on-a-raspberry-pi-5-with-the-ai-hat-2/) and Hackaday. Below is the whole stack, what it costs today, the one setting the guide leaves out if you want it truly offline, and what we know about speed. We haven't built this box ourselves; everything here comes from Woodward's guide, GitHub's docs and published benchmarks.

## What you need and what it costs

Prices checked 29 November 2026. Raspberry Pi has raised prices several times this year, so check again before you buy.

| Part | Price | Source |
|---|---|---|
| Raspberry Pi AI HAT+ 2 (Hailo-10H, 40 TOPS INT4, 8GB RAM) | **$200** | [Raspberry Pi product page](https://www.raspberrypi.com/products/ai-hat-plus-2/) |
| Raspberry Pi 5, 8GB | $175 | [PiShop.us](https://www.pishop.us/product/raspberry-pi-5-8gb/) |
| Official 27W USB-C power supply, Active Cooler, fast microSD (U3/A2) | not priced here | Woodward's parts list |
| Copilot CLI | free with your own model | [GitHub Docs](https://docs.github.com/copilot/how-tos/copilot-cli/set-up-copilot-cli/authenticate-copilot-cli) |

The HAT launched at [$130 in January](https://www.raspberrypi.com/news/introducing-the-raspberry-pi-ai-hat-plus-2-generative-ai-on-raspberry-pi-5/); the product page now says $200. It only works with the Pi 5.

Power is the appealing part. Woodward points out that the official 27W supply tops out at **25.5W** for the whole stack, so that's the ceiling, not a measured draw. It's the kind of thing you can leave running on a shelf.

## How the stack fits together

There are three layers, all on the Pi, all on localhost:

1. **hailo-ollama** (from Hailo's [Model Zoo GenAI](https://github.com/hailo-ai/hailo_model_zoo_genai)) runs the model on the HAT and speaks the Ollama API on port 8000.
2. **LiteLLM** translates that into an OpenAI-compatible API on port 4000.
3. **Copilot CLI** talks to port 4000 as if it were any OpenAI-style provider.

GitHub added this provider mode in April: Copilot CLI [accepts any OpenAI-compatible endpoint](https://github.blog/changelog/2026-04-07-copilot-cli-now-supports-byok-and-local-models/), including local runtimes like Ollama and vLLM. In this mode it doesn't need a GitHub account or token. What you lose without signing in: `/delegate`, the GitHub MCP server and GitHub Code Search.

## The setup, step by step

The full commands, including systemd units to start everything at boot, are in [Woodward's guide](https://www.woodwardweb.com/post/2026/10/raspberry-pi-ai-hat-local-models-for-copilot/). The short version:

**1. Install the Hailo driver and check the HAT is seen.**

```bash
sudo apt-get update
sudo apt-get install -y h10-hailort h10-hailort-pcie-driver hailo-h10-all
hailortcli scan
```

**2. Build and start hailo-ollama**, then pull the model from a second terminal. The build needs `git cmake build-essential curl jq libssl-dev` from apt first.

```bash
git clone https://github.com/hailo-ai/hailo_model_zoo_genai.git
cd hailo_model_zoo_genai
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --config Release -j"$(nproc)"
sudo cmake --install build
hailo-ollama
```

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

**3. Run LiteLLM in a Python virtual environment** with a `config.yaml` that maps `qwen2.5-coder:1.5b` to `ollama_chat/qwen2.5-coder:1.5b` at `http://127.0.0.1:8000`, then start it with `litellm --config config.yaml --host 127.0.0.1 --port 4000`.

**4. Install Copilot CLI.** GitHub's [install docs](https://docs.github.com/en/copilot/how-tos/set-up/install-copilot-cli) list several Linux routes. The two simplest are `npm install -g @github/copilot` (needs Node.js 22 or later) and the script at `https://gh.io/copilot-install`. GitHub's docs don't list ARM64 Linux explicitly; Woodward reports it runs natively on the Pi.

**5. Point Copilot at the proxy.** These go in `~/.bashrc`:

```bash
export COPILOT_PROVIDER_BASE_URL=http://127.0.0.1:4000/v1
export COPILOT_PROVIDER_TYPE=openai
export COPILOT_PROVIDER_MODEL_ID=gpt-4o-mini
export COPILOT_PROVIDER_WIRE_MODEL=qwen2.5-coder:1.5b
export COPILOT_MODEL=gpt-4o-mini
export COPILOT_PROVIDER_MAX_PROMPT_TOKENS=3072
export COPILOT_PROVIDER_MAX_OUTPUT_TOKENS=1024
export COPILOT_OFFLINE=true
```

The first seven lines are Woodward's. His config gives the CLI a model name it knows (`gpt-4o-mini`) while the request on the wire asks for the Qwen model. The token limits matter: GitHub's [BYOK docs](https://docs.github.com/copilot/how-tos/copilot-cli/customize-copilot/use-byok-models) warn that without a limit the CLI can assume 128,000 prompt tokens for an unknown model.

The last line is ours, and it's the one the guide doesn't include. Pointing Copilot at a local model keeps your code off the cloud for inference, but that alone doesn't make the CLI offline. `COPILOT_OFFLINE=true` stops it contacting GitHub's servers and disables all telemetry. With it, the CLI [only talks to your configured provider](https://github.blog/changelog/2026-04-07-copilot-cli-now-supports-byok-and-local-models/). Then type `copilot` and you're in.

## How fast it is, and how good

Nobody has published a tokens-per-second figure for this exact setup. Woodward doesn't give a speed figure, but says it works surprisingly well for such a small box.

The closest benchmark is [Jeff Geerling's review of the HAT](https://jeffgeerling.com/blog/2026/raspberry-pi-ai-hat-2): on most models the Pi's own CPU "trounces the Hailo 10H". The exception happens to be the model this guide uses: on Qwen2.5 Coder 1.5B the Hailo comes close. The HAT's advantage is power: Geerling puts the Hailo at a maximum of about **3W**, against the 10W the Pi's chip is allowed to draw. If you already own a 16GB Pi 5, a CPU runtime may be just as fast without the HAT; Geerling's verdict on the board is "a solution in search of a problem" outside niche cases.

Quality is the bigger limit. The HAT's launch models are 1 to 1.5 billion parameters. Woodward uses his for summaries and first-pass drafts, notes you have to be "a lot more explicit" than with a frontier model, and switches to cloud models when he needs "proper thinking done".

Two of GitHub's own requirements explain why. The BYOK docs say the model must support **tool calling and streaming**, and GitHub's [changelog for the feature](https://github.blog/changelog/2026-04-07-copilot-cli-now-supports-byok-and-local-models/) recommends a context window of at least **128k tokens**. The Pi setup runs with 3,072 prompt tokens, about 2% of that. Copilot CLI's agent work (reading files, editing them, running commands) depends on tool calls, and Woodward's guide doesn't say how reliably the 1.5B model makes them. Treat file edits and multi-step tasks as unproven on this box.

## Who should build it

Build it if you want a private, always-on terminal helper for small jobs: explaining a script, drafting a commit message, summarising a log, all without your code leaving the house. It's also a cheap way to learn how Copilot CLI's provider settings work before you point them at a bigger local machine.

Skip it if you want an agent that refactors a repo. For that you need a much larger model; our guide to [running Qwen3.8-Flash-Next locally](https://smarterthanus.ai/run-qwen3-8-flash-next-locally-gguf/) covers what fits in 96 to 128 GB of memory, and the same provider variables work against any OpenAI-compatible server. If you're weighing Copilot CLI against Claude Code or Cursor on price, note that [there's no Black Friday price cut on Claude or Cursor this year](https://smarterthanus.ai/black-friday-ai-coding-deals-2026/); a local model is how you use Copilot CLI with no model bill.

## Sources

- [Local LLMs in Copilot CLI on a Raspberry Pi 5 (Martin Woodward)](https://www.woodwardweb.com/post/2026/10/raspberry-pi-ai-hat-local-models-for-copilot/)
- [Copilot CLI now supports BYOK and local models (GitHub Changelog)](https://github.blog/changelog/2026-04-07-copilot-cli-now-supports-byok-and-local-models/)
- [Using your own LLM models in Copilot CLI (GitHub Docs)](https://docs.github.com/copilot/how-tos/copilot-cli/customize-copilot/use-byok-models)
- [Authenticating Copilot CLI (GitHub Docs)](https://docs.github.com/copilot/how-tos/copilot-cli/set-up-copilot-cli/authenticate-copilot-cli)
- [Installing GitHub Copilot CLI (GitHub Docs)](https://docs.github.com/en/copilot/how-tos/set-up/install-copilot-cli)
- [Raspberry Pi AI HAT+ 2 product page](https://www.raspberrypi.com/products/ai-hat-plus-2/)
- [Introducing the Raspberry Pi AI HAT+ 2 (Raspberry Pi)](https://www.raspberrypi.com/news/introducing-the-raspberry-pi-ai-hat-plus-2-generative-ai-on-raspberry-pi-5/)
- [Raspberry Pi 5 8GB (PiShop.us)](https://www.pishop.us/product/raspberry-pi-5-8gb/)
- [Raspberry Pi's new AI HAT adds 8GB of RAM for local LLMs (Jeff Geerling)](https://jeffgeerling.com/blog/2026/raspberry-pi-ai-hat-2)
- [Someone got a private, offline GitHub Copilot CLI running on a Raspberry Pi 5 with the AI HAT+ 2 (XDA)](https://www.xda-developers.com/someone-got-a-private-offline-github-copilot-cli-on-a-raspberry-pi-5-with-the-ai-hat-2/)
