Skip to content

Commit a5af87c

Browse files
committed
chore: update build scripts and documentation for llama.cpp submodule integration
1 parent ffe0d13 commit a5af87c

22 files changed

Lines changed: 74 additions & 1594 deletions

.github/workflows/build-sidecar.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ name: Build sidecar (llama-server + gateway)
1010
on:
1111
push:
1212
paths:
13+
- "llama.cpp"
1314
- "minicpm-sidecar/**"
1415
- ".github/workflows/build-sidecar.yml"
1516
pull_request:
1617
paths:
18+
- "llama.cpp"
1719
- "minicpm-sidecar/**"
1820
- ".github/workflows/build-sidecar.yml"
1921
workflow_dispatch:
@@ -43,6 +45,8 @@ jobs:
4345
working-directory: minicpm-sidecar
4446
steps:
4547
- uses: actions/checkout@v4
48+
with:
49+
submodules: true
4650

4751
- name: Install cmake (Linux)
4852
if: runner.os == 'Linux'
@@ -69,10 +73,6 @@ jobs:
6973
irm https://astral.sh/uv/install.ps1 | iex
7074
Add-Content $env:GITHUB_PATH "$env:USERPROFILE\.local\bin"
7175
72-
- name: Clone vendored llama.cpp
73-
shell: bash
74-
run: ./scripts/clone-llama.sh
75-
7676
- name: Build llama-server (POSIX)
7777
if: runner.os != 'Windows'
7878
shell: bash

.github/workflows/release.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ jobs:
3636
name: mac-${{ matrix.triple }}
3737
steps:
3838
- uses: actions/checkout@v4
39+
with:
40+
submodules: true
3941
- uses: actions/setup-node@v4
4042
with:
4143
node-version: 20
@@ -122,6 +124,8 @@ jobs:
122124
name: linux-x64
123125
steps:
124126
- uses: actions/checkout@v4
127+
with:
128+
submodules: true
125129
- uses: actions/setup-node@v4
126130
with:
127131
node-version: 20
@@ -165,6 +169,8 @@ jobs:
165169
shell: pwsh
166170
steps:
167171
- uses: actions/checkout@v4
172+
with:
173+
submodules: true
168174
- uses: actions/setup-node@v4
169175
with:
170176
node-version: 20
@@ -177,11 +183,6 @@ jobs:
177183
irm https://astral.sh/uv/install.ps1 | iex
178184
Add-Content $env:GITHUB_PATH "$env:USERPROFILE\.local\bin"
179185
180-
- name: Clone llama.cpp
181-
working-directory: minicpm-sidecar
182-
shell: bash
183-
run: ./scripts/clone-llama.sh
184-
185186
- name: Build llama-server
186187
working-directory: minicpm-sidecar
187188
run: ./scripts/build-llama.ps1

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ dist/
1515
minicpm-sidecar/bin/
1616
minicpm-sidecar/build/build/
1717
minicpm-sidecar/build/dist/
18-
minicpm-sidecar/third_party/llama.cpp/
18+
19+
# llama.cpp submodule build outputs (the submodule itself is tracked)
20+
llama.cpp/build/
1921

2022
# Model weights — too big to ship, friends/colleagues download separately
2123
models/

CHANGELOG.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,11 @@
1313
- 根级 [`LICENSE`](LICENSE)(AGPL-3.0-only,与 `clawd-on-desk/LICENSE` 同源)。
1414
- 根级 [`NOTICE.md`](NOTICE.md):fork 声明 + llama.cpp / MiniCPM / OpenClaw 等第三方 attribution。
1515
- 根级 [`CONTRIBUTING.md`](CONTRIBUTING.md):quickstart、测试要求、commit / PR 约定。
16-
- [`docs/archive/`](docs/archive/) 子目录,迁入 v0.7 时代的设计文档([PRD-sidecar-cross-platform-refactor.md](docs/archive/PRD-sidecar-cross-platform-refactor.md)[architecture-and-cross-platform-report.md](docs/archive/architecture-and-cross-platform-report.md)),并附 [`README.md`](docs/archive/README.md) 解释归档背景。
1716

1817
### 变更
1918

2019
- [`README.md`](README.md) 删除 deprecated 目录段落,文档索引指向归档后的新路径,新增 CONTRIBUTING 链接。
2120
- [`docs/development.md`](docs/development.md) 删除 conda 路径、双份 sidecar 同步注意事项、旧 `build/build-sidecar.sh` 引用;"仓库结构"框图按新平铺布局重写。
22-
- [`docs/llama-cpp-migration.md`](docs/llama-cpp-migration.md) 旧 PyTorch sidecar / PyInstaller 路径改为历史叙述。
2321
- [`skills/deploy-minicpm-pet/SKILL.md`](skills/deploy-minicpm-pet/SKILL.md) 完整改写:所有 `minicpm-pet-bridge*` 引用替换为 `minicpm-sidecar`,安装步骤更新到 cmake + uv + 几十 MB gateway。
2422
- [`.gitignore`](.gitignore) 删除 `build/*` 历史例外规则。
2523

@@ -30,7 +28,7 @@
3028
### 新增
3129

3230
- 单一推理目录 [`minicpm-sidecar/`](minicpm-sidecar/),结构为「llama-server(vendor llama.cpp)+ 瘦 FastAPI gateway」。
33-
- vendor 子模块脚本 [`scripts/clone-llama.sh`](minicpm-sidecar/scripts/clone-llama.sh)(pin 在 [zhangtao2-1/llama.cpp@c5ede29](https://github.com/zhangtao2-1/llama.cpp),即 [PR #23384](https://github.com/ggml-org/llama.cpp/pull/23384) 的 MiniCPM5 tokenizer 提交)。
31+
- 顶层 git submodule [`llama.cpp/`](llama.cpp)(pin 在 [zhangtao2-1/llama.cpp@c5ede29](https://github.com/zhangtao2-1/llama.cpp),即 [PR #23384](https://github.com/ggml-org/llama.cpp/pull/23384) 的 MiniCPM5 tokenizer 提交)。
3432
- 各平台编译脚本:`scripts/build-llama.sh`(macOS / Linux)+ `scripts/build-llama.ps1`(Windows),按 `LLAMA_ACCEL=metal|cuda|cpu` 走 cmake。
3533
- Gateway PyInstaller 单文件打包:`scripts/build-gateway.sh` + [`build/gateway.spec`](minicpm-sidecar/build/gateway.spec),无 torch 依赖,最终二进制几十 MB 量级。
3634
- `scripts/build-all.sh` / `scripts/run-dev.sh` 一站式入口。
@@ -60,7 +58,7 @@
6058

6159
### 文档
6260

63-
- 新增 [`docs/llama-cpp-migration.md`](docs/llama-cpp-migration.md) 记录本次变动 + vendor 升级路径。
61+
- 新增过 `docs/llama-cpp-migration.md` 记录本次变动 + vendor 升级路径,后续文档精简时已移除
6462
- [`README.md`](README.md) 顶部状态行 / 安装步骤 / 文档索引同步更新到 v0.8。
6563
- 旧的两套 bridge 目录写入 [`DEPRECATED.md`](minicpm-pet-bridge/DEPRECATED.md)
6664

NOTICE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ The sidecar embeds [`llama-server`](https://github.com/ggml-org/llama.cpp)
2727
(MIT License, © 2023 Georgi Gerganov and llama.cpp contributors).
2828
While MiniCPM5 tokenizer support is still in flight upstream
2929
([PR #23384](https://github.com/ggml-org/llama.cpp/pull/23384)), the
30-
vendored sources are pinned to
30+
sources are included as a git submodule at `llama.cpp/`, pinned to
3131
[zhangtao2-1/llama.cpp@c5ede29](https://github.com/zhangtao2-1/llama.cpp).
32-
See [minicpm-sidecar/scripts/clone-llama.sh](minicpm-sidecar/scripts/clone-llama.sh)
33-
for the exact commit and [minicpm-sidecar/README.md](minicpm-sidecar/README.md#vendor-分支)
32+
See [.gitmodules](.gitmodules) for the URL and
33+
[minicpm-sidecar/README.md](minicpm-sidecar/README.md#submodule--vendor-分支)
3434
for the upgrade path.
3535

3636
### MiniCPM model weights

adapters/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ adapters/
3030

3131
## 从 PEFT safetensors 转成 GGUF
3232

33-
llama.cpp 只认 GGUF 格式的 LoRA。`minicpm-sidecar/third_party/llama.cpp/convert_lora_to_gguf.py`
34-
vendor 在 `scripts/clone-llama.sh` pin 的版本里)会把 PEFT 适配器 + 一份只读的 HF
33+
llama.cpp 只认 GGUF 格式的 LoRA。仓库顶层的 `llama.cpp/convert_lora_to_gguf.py`
34+
submodule pin 的版本里)会把 PEFT 适配器 + 一份只读的 HF
3535
base config 拼成 llama-server 能消费的单文件 GGUF。
3636

3737
```bash
@@ -41,8 +41,8 @@ ADAPTER=adapters/lora_nekoqa_adapter_20260515_0738
4141

4242
# 2. 跑转换脚本(需要一个带 torch + transformers 的 venv,
4343
# 本仓库的 minicpm-pet-bridge-uv/.venv 即可)
44-
minicpm-pet-bridge-uv/.venv/bin/python3 \
45-
minicpm-sidecar/third_party/llama.cpp/convert_lora_to_gguf.py \
44+
python3 \
45+
llama.cpp/convert_lora_to_gguf.py \
4646
--base "$BASE" \
4747
--outtype f16 \
4848
--outfile "$ADAPTER/adapter_model.f16.gguf" \

clawd-on-desk/docs/investigations/permission-hook-fail-deny-investigation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ PreToolUse matcher 接受 `Bash`, `Edit|Write`, `mcp__.*` 等所有工具名。
9696
- [ ] 监控 anthropics/claude-code#46193 的 status
9797
- [ ] CC 修了之后:
9898
- 删除 `README.md` / `README.zh-CN.md` 里 Known Limitations 表格的对应行
99-
- 把这个文档归档(移到 `docs/archive/` 或在标题加 RESOLVED
99+
- 在标题加 RESOLVED,或直接删除这份调查文档
100100
- 顺手更新 `hooks/install.js:248-250` 那条过时注释("Edit/Write permissions are handled by Claude Code's own permission mode — not our hook"),写明历史脉络
101101

102102
## 不要做的事

0 commit comments

Comments
 (0)