# AI use cases for NIGHTRUN (hardrave/NIGHTRUN)

Repo: [hardrave/NIGHTRUN](https://github.com/hardrave/NIGHTRUN) | Use cases: 3 | Page: https://dedupedai.com/use-cases/hardrave-nightrun/

NightRun is a Rust runtime that boots a PC or Raspberry Pi 5 straight into a local LLM chat from a USB stick or SD card, with no conventional operating system underneath.

This file holds every use case of this repo. Each one starts with a "## " heading and ends with its URL.

- Boot an offline LLM chat from a USB stick: https://dedupedai.com/use-cases/hardrave-nightrun/boot-offline-llm-from-usb-stick/
- Test a NightRun image in QEMU before flashing: https://dedupedai.com/use-cases/hardrave-nightrun/test-nightrun-image-in-qemu/
- Boot a local LLM on a Raspberry Pi 5 from SD: https://dedupedai.com/use-cases/hardrave-nightrun/boot-llm-on-raspberry-pi-5-sd-card/

## How to boot an offline LLM chat from a USB stick with NIGHTRUN

Repo: [hardrave/NIGHTRUN](https://github.com/hardrave/NIGHTRUN) | Difficulty: Intermediate | Time: 1 hour 30 minutes | Basis: From the README

Turn a spare x86_64 PC into a chat box that runs a local model with no operating system.

**Who it is for:** A person with a spare 64-bit UEFI PC who wants a private, offline chat model and is comfortable with firmware boot menus.

**The problem:** Running a local model usually means installing a full OS, drivers and a runtime, and the machine keeps all of that running in the background.

**The outcome:** A USB stick that boots the PC directly into a NightRun chat prompt, with the model loaded in RAM and answering on the CPU offline.

### Steps

1. Run `git clone https://github.com/hardrave/NIGHTRUN.git` and then `cd NIGHTRUN`.
2. Run `less install.sh` and read what the script does before you run it.
3. Run `./install.sh`, choose the x86_64 USB target and a model, then type `FLASH /dev/sdX` exactly with the device name the installer shows you.
4. Boot the target PC from the USB stick with Secure Boot off and wait for the NightRun chat prompt.

### Prompt to paste into your agent

```text
Use the repo hardrave/NIGHTRUN to prepare an x86_64 USB boot stick for target device <target> (a whole-disk device such as /dev/sdX). Run the installer, confirm the device name it shows matches <target>, and report the verified media result. Verify that the installer reports the written image as verified by SHA-256 read-back before you finish.
```

### Caveat

Real-machine firmware quirks vary, and the README says broad real-hardware coverage on x86 is still open, so test on your own PC before relying on it.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/hardrave-nightrun/boot-offline-llm-from-usb-stick/

## How to test a NightRun image in QEMU before flashing with NIGHTRUN

Repo: [hardrave/NIGHTRUN](https://github.com/hardrave/NIGHTRUN) | Difficulty: Intermediate | Time: 1 hour 30 minutes | Basis: From the README

Build a NightRun image with a Llama model and boot it in QEMU to check it without touching hardware.

**Who it is for:** A developer or tinkerer who wants to see the boot and chat flow on a Linux machine before writing to any USB stick.

**The problem:** Flashing the wrong device or debugging boot problems on real hardware is slow and risky, so an emulator check comes first.

**The outcome:** A built nightrun.img that boots in a QEMU window and shows the NightRun chat with live status.

### Steps

1. Run `git clone https://github.com/hardrave/NIGHTRUN.git` and then `cd NIGHTRUN`.
2. Run `curl -L -o models/Llama-3.2-1B-Instruct-Q8_0.gguf https://huggingface.co/bartowski/Llama-3.2-1B-Instruct-GGUF/resolve/main/Llama-3.2-1B-Instruct-Q8_0.gguf`. (inferred, check the README)
3. Run `cargo run --release -p nrconvert -- models/Llama-3.2-1B-Instruct-Q8_0.gguf models/model.nrm` to convert the model to .nrm. (inferred, check the README)
4. Run `cargo xtask image --model models/model.nrm` to build nightrun.img.
5. Run `cargo xtask run --img --mem 4G --window` to boot the image in QEMU.

### Prompt to paste into your agent

```text
Use the repo hardrave/NIGHTRUN to convert the model at <target> (a GGUF file path) into models/model.nrm and boot it in QEMU with cargo xtask run --img --mem 4G --window. Expected output: a QEMU window showing the NightRun chat prompt. Verify the nrconvert step reports that it re-validated its own output before you boot.
```

### Caveat

The README lists QEMU as the test path and notes that QEMU rows in its benchmarks come from single scripted runs, so QEMU speed is not a guarantee for real hardware.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/hardrave-nightrun/test-nightrun-image-in-qemu/

## How to boot a local LLM on a Raspberry Pi 5 from SD with NIGHTRUN

Repo: [hardrave/NIGHTRUN](https://github.com/hardrave/NIGHTRUN) | Difficulty: Advanced | Time: 2 hours | Basis: From the README

Build a Pi 5 NightRun image with a Llama or Granite model and boot it from a microSD card.

**Who it is for:** A maker with a Raspberry Pi 5 who wants a self-contained offline chat device and can build pinned firmware once.

**The problem:** A Pi normally runs a full Linux system for a local model, and the setup is heavy for a single-purpose device.

**The outcome:** A microSD card that boots the Pi 5 into a NightRun chat prompt with the chosen model in RAM.

### Steps

1. Run `git clone https://github.com/hardrave/NIGHTRUN.git` and then `cd NIGHTRUN`.
2. Run `scripts/build-rpi5-firmware.sh` once to build the UEFI firmware from pinned source, following docs/rpi5-uefi.md.
3. Run `cargo xtask pi-image --model models/model.nrm` to build nightrun-pi5.img.
4. Run `sudo dd if=nightrun-pi5.img of=/dev/REPLACE_WITH_SD_DEVICE bs=4M status=progress conv=fsync`, replacing the placeholder with the whole microSD device after checking it with `lsblk -d -o NAME,SIZE,MODEL,TRAN`. (inferred, check the README)
5. Insert the microSD card into the Pi 5 and power it on.

### Prompt to paste into your agent

```text
Use the repo hardrave/NIGHTRUN to build a Raspberry Pi 5 image at models/model.nrm for the target <target> (a whole-disk microSD device). Expected output: nightrun-pi5.img built with cargo xtask pi-image and written to the card. Verify that the device name matches <target> before any write step runs.
```

### Caveat

The README says the Pi 5 build was validated on a real D0-stepping 8 GB board, and the Llama 3.2 1B and Granite models need at least 4 GB and 6 GB of RAM respectively.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/hardrave-nightrun/boot-llm-on-raspberry-pi-5-sd-card/
