Skip to content
OpenSmartRoute
Skillv1.0.0

nightrun

Build, test, run, and flash NightRun — a bare-metal, no_std Rust UEFI application that boots straight into a local LLM (Llama 3.2, Qwen3, or Granite 4.1) with no operating system underneath. Use when

by akillness(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from akillness/jeo-skills (.agent-skills/nightrun/SKILL.md). Install upstream with npx skills add akillness/jeo-skills --skill nightrun. Copyright stays with the author.

NightRun

NightRun is a single no_std Rust UEFI application that boots directly into a chat prompt for a quantized local LLM (Llama 3.2, Qwen3, or dense Granite 4.1) — no Linux, no kernel, no browser, no network stack. The model is streamed into RAM with inline CRC-32 verification, storage is sealed once loaded, and inference runs entirely on-CPU (AVX2+FMA+F16C on x86_64, NEON on Pi 5). This skill drives the build → convert → test → flash workflow safely.

When to use this skill

  • Building BOOTX64.EFI or a full bootable nightrun.img from source
  • Converting a GGUF checkpoint into the .nrm container with nrconvert
  • Running/debugging the inference engine on the host (nrhost) before reaching for QEMU
  • Booting NightRun in QEMU/OVMF (cargo xtask run) for screenshots or scripted verification
  • Flashing a real USB stick or Raspberry Pi 5 SD card via install.sh
  • Diagnosing tokenizer/parity failures against llama.cpp reference fixtures

When not to use this skill

  • General local-LLM serving without bare-metal/no-OS constraints → use a normal inference runtime, not this skill
  • Generic Rust workspace refactors unrelated to the boot/model/kernel path → use harness or build-fix
  • Cross-compiling for targets other than x86_64 UEFI / Raspberry Pi 5 → out of scope; NightRun is UEFI-only, no legacy BIOS

Instructions

Step 1: Clone and read the workspace rules first

git clone https://github.com/hardrave/NIGHTRUN.git
cd NIGHTRUN

Read CLAUDE.md before touching crates/nr-boot. Two hard rules:

  • Never run cargo build --workspace / cargo test --workspacenr-boot only builds through cargo xtask (nightly + -Zbuild-std + the custom hard-float target x86_64-nightrun-uefi.json); its panic handler collides with the host std target.
  • Never add ExitBootServices() and never call firmware services from AP worker code (nr-tensor::parallel workers are atomics + compute only).

Step 2: Pick the smallest working mode

Use references/commands.md for the full command reference. Pick one:

  1. Host-side engine work (kernels, tokenizer, sampling) → cargo test, cargo run --release -p nrhost
  2. Model conversioncargo run --release -p nrconvert
  3. Firmware build onlycargo xtask build
  4. Full image + QEMU verificationcargo xtask image then cargo xtask run
  5. Real hardware flash./install.sh (interactive, confirmation-gated)

Do not jump straight to flashing real media before a green QEMU boot.

Step 3: Convert a model before any boot attempt

cargo run --release -p nrconvert -- path/to/model.gguf models/model.nrm

The converter re-parses and re-checksums its own output before declaring success. Qwen needs 6 GB QEMU RAM (--mem 6G); other models need 4 GB.

Step 4: Verify on host, then in QEMU, before flashing hardware

cargo run --release -p nrhost -- models/model.nrm --prompt "..." --temp 0
cargo xtask image --model models/model.nrm
cargo xtask run --img --model models/model.nrm --mem 4G --smp 8 \
  --shot 5:boot.png

Only escalate to ./install.sh (flashes a real USB/SD device) after the QEMU boot and chat response look correct. The installer refuses non-removable disks and requires typing FLASH /dev/sdX verbatim — never script around that confirmation.

Step 5: Use the wrapper for a guided, non-destructive dry run

bash .agent-skills/nightrun/scripts/nightrun.sh doctor /path/to/NIGHTRUN
bash .agent-skills/nightrun/scripts/nightrun.sh build /path/to/NIGHTRUN
bash .agent-skills/nightrun/scripts/nightrun.sh convert /path/to/NIGHTRUN in.gguf models/model.nrm
bash .agent-skills/nightrun/scripts/nightrun.sh qemu /path/to/NIGHTRUN models/model.nrm

doctor only reports prerequisite status (Rust toolchains, QEMU, disk space); it never writes to disk. Flashing real media stays a manual, interactive ./install.sh run — the wrapper deliberately does not automate it.

Step 6: Debug parity failures with the reference fixtures

Greedy output is pinned token-for-token against llama.cpp for every model family (crates/nr-model/tests/parity.rs). If a kernel/rope/rmsnorm change breaks parity, the kernel is wrong, not the fixture. Regenerate tokenizer fixtures with scripts/gen_tokenizer_fixtures.py when the tokenizer or chat template changes.

Best practices

  1. Never bypass the flash confirmationinstall.sh demands an exact typed FLASH /dev/sdX; do not script that input.
  2. QEMU before hardware, always — a red QEMU boot means real media isn't ready either.
  3. Treat parity breaks as engine bugs — the llama.cpp fixtures are the source of truth, not the new kernel.
  4. Keep nr-boot on the xtask path — nightly + -Zbuild-std + the custom hard-float target, never plain cargo build --workspace.
  5. Regenerate models after tokenizer/format changes — stale .nrm files make test failures look like regressions when they're just stale fixtures.

References

  • Upstream repo: hardrave/NIGHTRUN
  • Full command reference: references/commands.md
  • Wrapper script: scripts/nightrun.sh
  • Project standards: .agent-skills/skill-standardization/SKILL.md

Examples

Example 1: Prototype a new model without touching real hardware

bash .agent-skills/nightrun/scripts/nightrun.sh doctor ~/src/NIGHTRUN
cargo run --release -p nrconvert -- ~/models/llama-3.2-1b-q8_0.gguf ~/src/NIGHTRUN/models/model.nrm
cargo run --release -p nrhost -- ~/src/NIGHTRUN/models/model.nrm --prompt "hello" --temp 0

Example 2: Full QEMU verification before flashing a USB stick

bash .agent-skills/nightrun/scripts/nightrun.sh qemu ~/src/NIGHTRUN models/model.nrm --shot 5:boot.png
# only after a correct boot + chat response:
cd ~/src/NIGHTRUN && ./install.sh

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/akillness-jeo-skills-nightrun/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

akillness-jeo-skills-nightrun.ocm.jsonjson
{
  "ocm": "1",
  "id": "akillness-jeo-skills-nightrun",
  "kind": "skill",
  "name": "nightrun",
  "description": "Build, test, run, and flash NightRun — a bare-metal, no_std Rust UEFI application that boots straight into a local LLM (Llama 3.2, Qwen3, or Granite 4.1) with no operating system underneath. Use when the user wants to build/flash a bootable NightRun USB or Raspberry Pi 5 SD image, convert a GGUF model into the `.nrm` container, run/debug the inference engine on the host or in QEMU/OVMF, or troubleshoot no_std kernel/tokenizer parity issues in the NightRun codebase. Triggers on: \"nightrun\", \"boot into an LLM\", \"bare-metal LLM runtime\", \"UEFI LLM appliance\", \"nrconvert\", \"nrhost\", \"cargo xtask\", \"nrm model file\", \"flash a bootable LLM USB\".",
  "publisher": "akillness",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "coding"
    ],
    "tags": [
      "skill-md",
      "nightrun",
      "rust",
      "no-std",
      "uefi",
      "bare-metal",
      "local-llm",
      "llama-cpp-parity",
      "gguf",
      "qemu"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "Build, test, run, and flash NightRun — a bare-metal, no_std Rust UEFI application that boots straight into a local LLM (Llama 3.2, Qwen3, or Granite 4.1) with no operating system underneath. Use when the user wants to build/flash a bootable NightRun USB or Raspberry Pi 5 SD image, convert a GGUF model into the `.nrm` container, run/debug the inference engine on the host or in QEMU/OVMF, or troubleshoot no_std kernel/tokenizer parity issues in the NightRun codebase. Triggers on: \"nightrun\", \"boot into an LLM\", \"bare-metal LLM runtime\", \"UEFI LLM appliance\", \"nrconvert\", \"nrhost\", \"cargo xtask\", \"nrm model file\", \"flash a bootable LLM USB\"."
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "skills.sh",
      "repository": "https://github.com/akillness/jeo-skills",
      "path": ".agent-skills/nightrun/SKILL.md",
      "ref": "HEAD",
      "url": "https://github.com/akillness/jeo-skills/blob/HEAD/.agent-skills/nightrun/SKILL.md",
      "key": "akillness/jeo-skills/.agent-skills/nightrun/SKILL.md"
    },
    "compatibility": "Linux host required for building/flashing (installer refuses non-removable disks). Needs Rust (stable + nightly), QEMU/OVMF for emulator testing, and ~6 GB free disk per model. Raspberry Pi 5 target a",
    "allowed_tools": [
      "Bash",
      "Read",
      "Write",
      "Edit",
      "Glob",
      "Grep"
    ]
  },
  "instructions": "# NightRun\n\nNightRun is a single `no_std` Rust UEFI application that boots directly into a\nchat prompt for a quantized local LLM (Llama 3.2, Qwen3, or dense Granite\n4.1) — no Linux, no kernel, no browser, no network stack. The model is\nstreamed into RAM with inline CRC-32 verification, storage is sealed once\nloaded, and inference runs entirely on-CPU (AVX2+FMA+F16C on x86_64, NEON on\nPi 5). This skill drives the build → convert → test → flash workflow safely.\n\n## When to use this skill\n\n- Building `BOOTX64.EFI` or a full bootable `nightrun.img` from source\n- Converting a GGUF checkpoint into t",
  "cost": {
    "context_tokens": 1473
  }
}

Fetch it by URL: GET /api/v1/registry/akillness-jeo-skills-nightrun/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.