Skip to content

docs(rock4d/npu): add Kiln tutorial — local LLM + vision on a mainline kernel#1926

Open
gahingwoo wants to merge 1 commit into
radxa-docs:mainfrom
gahingwoo:tutorial/rock4d-npu-kiln
Open

docs(rock4d/npu): add Kiln tutorial — local LLM + vision on a mainline kernel#1926
gahingwoo wants to merge 1 commit into
radxa-docs:mainfrom
gahingwoo:tutorial/rock4d-npu-kiln

Conversation

@gahingwoo

Copy link
Copy Markdown
Contributor

What

Adds a self-contained getting-started tutorial to the ROCK 4D NPU docs, in both languages:

  • docs/rock4/rock4d/application-dev/npu/kiln.md (zh)
  • i18n/en/docusaurus-plugin-content-docs/current/rock4/rock4d/application-dev/npu/kiln.md (en)

It walks through running a private, offline local LLM chat + image recognition + an
OpenAI-compatible API
on the ROCK 4D NPU using Kiln,
an open-source community project that runs the vendor RKLLM/RKNN NPU stack on a mainline
linux-7.1.3 kernel (rather than the vendor 6.1 BSP).

Scope

  • End-to-end and self-contained: install → verify (kiln-doctor) → vision (kiln-vision) →
    LLM chat (kiln-chat) → Open WebUI / OpenAI API (kiln-serve) → model conversion
    (kiln-convert) → troubleshooting, each with expected output.
  • Uses the one-command Armbian install only.
  • Clearly framed as an independent third-party project (not official Radxa support), and
    noted as validated on the ROCK 4D (RK3576).

Checks

  • scripts/agent-doc-lint.sh — passed (front matter + H1 + language-labeled code fences,
    no placeholder tokens).
  • scripts/agent-doc-drift-guard.sh — passed (zh + en added together, no path drift).
  • Follows the page structure from AGENT-DOC-SPEC.md (Prerequisites / Steps / Expected
    Output / Validation / Troubleshooting).

Happy to adjust the wording, placement (sidebar_position), or framing per your review.

@gahingwoo gahingwoo requested a review from RadxaStephen as a code owner July 11, 2026 03:10
Copilot AI review requested due to automatic review settings July 11, 2026 03:10

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new, self-contained Kiln getting-started tutorial to the ROCK 4D NPU docs (ZH + EN), describing how to install Kiln’s mainline-kernel stack and use it for local LLM chat, vision inference, and an OpenAI-compatible API.

Changes:

  • Add an English tutorial page covering install, verification (kiln-doctor), vision (kiln-vision), chat (kiln-chat), serving (kiln-serve), conversion (kiln-convert), and troubleshooting.
  • Add a Chinese counterpart with equivalent flow and references.
  • Include expected command outputs and operational tips (reboots, server host binding, version pinning).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
docs/rock4/rock4d/application-dev/npu/kiln.md New Chinese Kiln tutorial page for ROCK 4D NPU on a mainline kernel.
i18n/en/docusaurus-plugin-content-docs/current/rock4/rock4d/application-dev/npu/kiln.md New English Kiln tutorial page mirroring the Chinese content and flow.

Comment on lines +57 to +66
## 1. Install

Run this on the ROCK 4D:

```bash
curl -fsSL https://raw.githubusercontent.com/gahingwoo/kiln/main/scripts/kiln-install.sh | bash
```

It is hands-off: it pre-downloads what it needs, installs the Kiln mainline kernel, then
**reboots itself twice (~10–15 minutes total)** to finish setup and land in a ready system.
Comment on lines +42 to +60
## Prerequisites

- 一块 **ROCK 4D(RK3576)**,运行 **Armbian**。
- 可用网络(首次安装需要联网下载内核与运行时;**以太网最稳**)。
- 模型自备(Kiln 不附带任何模型):
- **视觉**:无需自备,下面用 `kiln-convert` 在板上现转一个 MobileNet 分类器。
- **大模型**:准备一个与 `librkllmrt` **1.2.0** 匹配的 `*-rk3576-w4a16.rkllm`(例如 Qwen2.5-1.5B
或 Llama-3.2-1B),稍后放进 `/opt/models`。

## 1. 安装

在 ROCK 4D 上执行这条命令:

```bash
curl -fsSL https://raw.githubusercontent.com/gahingwoo/kiln/main/scripts/kiln-install.sh | bash
```

它是**免手动**的:预下载所需内容、装上 Kiln 主线内核,然后**自己重启两次(共约 10–15 分钟)**完成
安装并进入就绪系统。
Comment on lines +74 to +77
:::tip
To drive the reboots yourself, use manual mode: `KILN_MANUAL=1 bash kiln-install.sh` (it
tells you when to reboot and re-run).
:::
Comment on lines +67 to +69
:::tip
想自己掌控重启,用手动模式:`KILN_MANUAL=1 bash kiln-install.sh`(它会告诉你何时重启、何时再跑一遍)。
:::
A self-contained getting-started page for running a local LLM chat, image recognition,
and an OpenAI-compatible API on the ROCK 4D NPU with Kiln, a community project that runs
the vendor RKLLM/RKNN stack on a mainline linux-7.1.3 kernel. Covers install -> verify ->
vision -> LLM chat -> Open WebUI -> model conversion -> troubleshooting, each with expected
output. Armbian one-command install; clearly attributed as a third-party project.

Adds zh (docs/) + en (i18n/en/) pages. Passes scripts/agent-doc-lint.sh and
scripts/agent-doc-drift-guard.sh.
@gahingwoo

Copy link
Copy Markdown
Contributor Author

Thanks for the review — addressed both points:

  • Manual mode: fixed to pipe the script with the env var (curl … | KILN_MANUAL=1 bash) so it no longer references a non-existent kiln-install.sh on disk.
  • Structure: wrapped the numbered install/verify/vision/chat/serve/convert sections under a top-level ## Steps (as ### subsections), keeping ## Validation and ## Troubleshooting.

Also tidied the reference links. test (commit) / test (push) are green (ran the repo's pre-commit locally). The check-external-links (optional) job still flags the illustrative API URLs in the examples (e.g. http://<board-ip>:8080/v1, localhost:3000) — these can't resolve from CI and match the pattern already present in existing NPU docs; happy to adjust if you prefer a different placeholder style.

@gahingwoo gahingwoo force-pushed the tutorial/rock4d-npu-kiln branch from d47ff62 to a39104d Compare July 11, 2026 03:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants