Tutorial runs GitHub Copilot CLI fully offline on Raspberry Pi 5 with AI HAT+ 2
A local qwen2.5-coder:1.5b model served through LiteLLM's OpenAI-compatible API lets the Copilot CLI work on a Raspberry Pi 5 with the AI HAT+ 2 accelerator, with no remote API calls.
Summary
Martin Woodward has published a step-by-step tutorial for running a working coding assistant entirely on a Raspberry Pi 5 fitted with the official AI HAT+ 2 neural network accelerator. The setup runs the GitHub Copilot command-line interface natively on the Pi, but points it at a local model instead of a paid remote API, so no traffic leaves the board. The model in question is qwen2.5-coder:1.5b, which the author describes as small but reasonably capable and fast enough on the accelerator.
The stack has three layers: the accelerator board's runtime serves the model, LiteLLM exposes it through a standard OpenAI-compatible API, and Copilot talks to that endpoint. Woodward documents the exact configuration needed to make the Pi boot headless with the whole stack running shortly after power-up, after which a user only needs to SSH in and launch copilot to start a coding task. The result is a private, offline coding assistant on low-cost ARM hardware, albeit with a much smaller model than hosted offerings.
How the offline Copilot stack is assembled on the Pi 5
- Hardware: A Raspberry Pi 5 paired with the official AI HAT+ 2 add-on board, which acts as a neural network accelerator and makes running the qwen2.5-coder:1.5b model at a usable pace feasible.
- Serving layer: The accelerator board's runtime serves the model locally; LiteLLM sits in front of it and presents a standard OpenAI-compatible API interface.
- Client: The GitHub Copilot command-line interface runs natively on the Raspberry Pi and is configured to use local models rather than paid APIs, connecting to the LiteLLM endpoint.
- Deployment: The tutorial covers the exact steps and configuration to boot the Pi headless with the full stack starting automatically, so the user only needs to SSH in and run copilot.
- Model trade-off: qwen2.5-coder:1.5b is far smaller than hosted frontier models, but the author reports it is quite capable for its size and keeps everything private and offline.
Why it matters
The tutorial shows a practical path to private, network-free AI coding assistance on inexpensive ARM hardware, which matters for developers working on air-gapped machines, in restricted networks, or with source code that cannot leave the building. It also demonstrates how the OpenAI-compatible API convention lets a proprietary client like Copilot CLI be redirected to open local models and open serving stacks such as LiteLLM. For the Raspberry Pi and AI HAT+ ecosystem, it is a concrete, reproducible use case beyond demos, and it highlights how small open-weight code models remain useful when paired with dedicated accelerators.
Original reference: hackaday.com →