File size: 3,078 Bytes
f4931e8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# Raspberry Pi 5 deployment

## Target

- Raspberry Pi 5, 16 GB, 64-bit Raspberry Pi OS;
- active cooling and the official power supply;
- NVMe storage and Ethernet;
- `whisper.cpp` kept warm as a local HTTP service;
- Q5 Tiny and Base compared on the same held-out child manifest.

The 16 GB board adds model/context headroom but does not add CPU cores. Benchmark one and two active conversations; do not infer multi-user capacity from idle WebSocket counts.

## Build runtime

Install system packages:

```bash
sudo apt update
sudo apt install -y git cmake build-essential libopenblas-dev ffmpeg
```

Build a fresh, pinned runtime directory:

```bash
./scripts/build_pi_runtime.sh /opt/buddi/whisper.cpp
```

The script defaults to `v1.9.2`; override explicitly if you have validated another revision:

```bash
WHISPER_CPP_REF=v1.9.2 ./scripts/build_pi_runtime.sh /opt/buddi/whisper.cpp
```

Copy the exported model and its JSON metadata into `/opt/buddi/models/`, then verify the SHA-256 printed by the export metadata:

```bash
sha256sum /opt/buddi/models/buddi-asr-tiny-argulf-v1-q5_0.bin
```

## Run locally

```bash
/opt/buddi/whisper.cpp/build/bin/whisper-server \
  --host 127.0.0.1 \
  --port 8080 \
  --model /opt/buddi/models/buddi-asr-tiny-argulf-v1-q5_0.bin \
  --threads 4
```

Keep the service on `127.0.0.1`. Put the Buddi API on the same device, or use a private authenticated tunnel. Do not expose the inference endpoint directly to the public internet.

## systemd

Create a dedicated unprivileged user and install the included unit after reviewing paths:

```bash
sudo useradd --system --home /nonexistent --shell /usr/sbin/nologin buddi
sudo cp deploy/systemd/buddi-asr.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable --now buddi-asr
sudo systemctl status buddi-asr
```

## Measure real capacity

Use the persistent server so model-loading time is excluded. Run identical samples at concurrency one and two:

```bash
buddi-asr benchmark-server data/manifests/splits/test.jsonl reports/pi-c1 \
  --concurrency 1 --limit 100

buddi-asr benchmark-server data/manifests/splits/test.jsonl reports/pi-c2 \
  --concurrency 2 --limit 100
```

Compare:

- p50 and p95 ASR latency;
- p50 and p95 real-time factor;
- WER/CER, to catch export/quantization regressions;
- CPU temperature, throttling, memory, and request failures.

Suggested monitoring commands:

```bash
vcgencmd measure_temp
vcgencmd get_throttled
systemd-cgtop
```

A real-time factor below `1.0` means transcription is faster than audio duration. Voice UX also includes VAD endpointing, network, LLM first-token latency, and TTS startup; measure the whole Buddi turn separately.

## Operational rules

- Rate-limit by child/session in the parent Buddi API.
- Cap upload duration and body size before forwarding to ASR.
- Avoid logging raw audio or full child transcripts.
- Use an outbound Tailscale/Cloudflare tunnel if remote access is required; do not depend on public IPv4 or port forwarding.
- Keep Tiny as a fallback if Base misses latency or thermal targets.