1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
不需要懂 Rust、不需要懂 LLM:克隆仓库,跑一个脚本,看到结果。
只需要一个东西:Rust 工具链([rustup.rs](https://rustup.rs) 一键安装)。
**不需要联网下载任何依赖**——pagoda 是零第三方依赖的。
```powershell
cd pagoda
powershell -ExecutionPolicy Bypass -File scripts\quickstart.ps1
```
这个脚本会自动做四件事:
```
[1/4] cargo build --offline ← 编译(零依赖,离线可编译)
[2/4] cargo test --offline ← 跑 72 项测试,全绿说明环境没问题
[3/4] sample --repeat 3 ← 同一个 prompt 跑 3 遍,看前缀缓存省算力
[4/4] program ← 跑一个 gen/select/fork 的 DSL 示例
```
```bash
cd pagoda
bash scripts/quickstart.sh
```
内容完全一样。
```powershell
powershell -ExecutionPolicy Bypass -File scripts\demo-agent-cluster.ps1 # Windows
bash scripts/demo-agent-cluster.sh # Linux/macOS
```
你会看到:
1. 2.3.
```powershell
cargo run --offline --bin pagoda -- serve --port 8080
Invoke-RestMethod http://127.0.0.1:8080/health
Invoke-RestMethod http://127.0.0.1:8080/generate -Method Post `
-ContentType "application/json" `
-Body '{"text":"the quick brown fox","sampling_params":{"max_tokens":20}}'
Invoke-RestMethod http://127.0.0.1:8080/stats
```
**Q:`cargo build --offline` 报错?**
先确认在 `pagoda/` 目录里(有 Cargo.toml 的那层)。离线构建不下载任何东西,
报错最常见的原因是 Rust 版本太旧——`rustup update` 一下。
**Q:测试有几项失败?**
当前全部应为绿。如果红了,把输出发给维护者——72 项测试就是 pagoda 的行为规格。
**Q:脚本里的输出是乱码/看不懂的英文碎片?**
正常!默认模型是"玩具 n-gram 模型",只负责把链路跑通,不负责聪明。
看 `prefix_hit` 和 `compute_saved` 这些数字就行——它们才是演示的主角。