feat(app): M5 step 4a, install the runtime and voice models into the data folder
- download: resumed downloads checked against a pinned SHA-256. - install: uv 0.11.20, the worker/brain venv (Python 3.12, the new src/voice_worker/requirements-brain.txt), the MeloTTS venv (Python 3.11, PyTorch cu128), Whisper large-v3-turbo, the Korean MeloTTS voice and Strata, the M0 kit's recipe; markers per step and version, cancel, retry, everything (caches, temp, HF and NLTK data) inside the data folder, the uv cache cleaned and the worker settings pointed at the venvs when done. - The services give the worker the same environment once installed. - The wizard's model step shows and drives the install. Installed from an empty folder on Linux and started the services on it: worker connected, STT and TTS ready, nothing written outside the folder. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -26,7 +26,7 @@ never deletes anything. `DataDir::choose(path)` creates it and writes the locati
|
||||
|
||||
```
|
||||
config/ runtime/ models/llm models/stt models/tts models/vad memory/ browser/ collect/
|
||||
cache/ logs/
|
||||
cache/ logs/ models/hf models/nltk
|
||||
```
|
||||
|
||||
`free_bytes(path)` reports the free space of the disk holding the folder (or its nearest existing
|
||||
@@ -127,7 +127,39 @@ reaches the screen.
|
||||
The dashboard's state is built from the core's events alone (`Dashboard::on_event` with the time),
|
||||
so it is tested with made-up events.
|
||||
|
||||
## Admin commands (`app/src/admin_api.rs`)
|
||||
## Install (`app/src/install.rs`, `app/src/download.rs`)
|
||||
|
||||
The wizard's model step installs the runtime into the data folder with the recipe the M0 kit used
|
||||
on the game PC (`scripts/m0`). The steps, in order:
|
||||
|
||||
| Step | What |
|
||||
|---|---|
|
||||
| `uv` | `uv` 0.11.20, downloaded with resume and checked against the release's SHA-256, into `runtime/uv` |
|
||||
| `worker_env` | Python 3.12 venv `runtime/venvs/worker` with `src/voice_worker/requirements.txt` and `requirements-brain.txt` (the v2 brain only; the repository's `requirements.txt` is v1's desktop app) |
|
||||
| `melo_env` | Python 3.11 venv `runtime/venvs/melo`: PyTorch 2.11 cu128 (pinned so later installs keep it), MeloTTS at a pinned commit, `python-mecab-ko` instead of the Japanese MeCab |
|
||||
| `stt_model` | Whisper `large-v3-turbo` (faster-whisper) |
|
||||
| `tts_model` | the NLTK data MeloTTS's English g2p reads, then the worker's own `melo_child.py` loads the Korean voice once (downloading it) and must say its warm-up sentence |
|
||||
| `strata` | Strata's own installer (`install.ps1`, `install.sh` elsewhere) with Strata's state, engine and components under `runtime/strata` and no PATH change |
|
||||
|
||||
The LLM itself (Qwen3.6-35B-A3B, about 23 GB) is downloaded by Strata on its first start, which the
|
||||
app runs next (M5, later step).
|
||||
|
||||
- A finished step leaves `runtime/.done/<id>` holding its version (the pin; for `worker_env` a hash
|
||||
of its requirement files), so later runs skip it and a new pin runs it again. Steps run one at a
|
||||
time; a failure stops the run and the next run starts at that step; cancel stops the running
|
||||
command or download (a download's part file stays, so the next try continues it).
|
||||
- Every command runs with the layout's environment: `uv`'s cache and Pythons, `HF_HOME`
|
||||
(`models/hf`), `NLTK_DATA` (`models/nltk`), temp files (`cache/tmp`) and Strata's folders, all
|
||||
inside the data folder. Python comes from `uv` only. Output lines go to the `install` log tab.
|
||||
- Downloads go to `<file>.part`, continue with an HTTP range after a break (a server without ranges
|
||||
starts over), and are checked against the pinned SHA-256; a wrong checksum deletes the part.
|
||||
- When every step is done, `uv`'s download cache is cleaned (the venvs hold copies), and
|
||||
`voiceWorker` in the settings is pointed at the worker venv's Python with
|
||||
`--melo-python <melo venv> --history memory/history.sqlite --brain` (other settings kept).
|
||||
- With the install complete, the services start the worker with the same environment (models,
|
||||
caches and temp files in the data folder; on Linux also the CUDA wheels' library folders).
|
||||
|
||||
|
||||
|
||||
`AdminApi::call(command, args)` is the one entry point of the screens, JSON in and out; errors come
|
||||
back as Korean messages for the screen. The Tauri shell passes the screens' `invoke("admin",
|
||||
@@ -144,6 +176,7 @@ back as Korean messages for the screen. The Tauri shell passes the screens' `inv
|
||||
| `discord_guilds` / `discord_channels` `{guildId}` | the bot's servers / a server's voice and text channels, for the pickers |
|
||||
| `settings_fields` / `settings_view` / `settings_apply` `{changes}` | the settings editor above; `restartNeeded` when the services run |
|
||||
| `service_start` / `service_stop` / `service_restart` / `dashboard` | the controller and its snapshot |
|
||||
| `install_status` / `install_start` / `install_cancel` | the install steps and their state, bytes and last line / run what is not done in the background / stop it |
|
||||
| `logs_query` `{tab, level, find, after, limit}` / `logs_error_report` / `logs_export` `{from, to}` | the log hub; the zip goes to `logs/` and its path comes back |
|
||||
|
||||
The invite link asks for: view channels, send messages, read history, add reactions, manage
|
||||
@@ -158,7 +191,8 @@ Plain HTML, CSS and an ES module, no build step, dark theme after `DESIGN.md`. A
|
||||
- **First-run wizard** (while `firstRun`): data folder (free space, warning under 200 GB), PC check,
|
||||
the model to download (the download itself is step 4 of M5), Discord bot (token check with the
|
||||
Message Content state and the invite link, then save), server and auto-join voice channel
|
||||
pickers, wake words, then start. Each step reached is saved, so a reload or a restart resumes at
|
||||
pickers, wake words, then start. The model step shows the install (each step's state, download
|
||||
bytes and last line; start, cancel, retry) and goes on only once everything is installed. Each step reached is saved, so a reload or a restart resumes at
|
||||
that step; only the last step's start finishes it. A stored token lets the bot step go on
|
||||
without entering it again.
|
||||
- **Dashboard**: the snapshot every second; the header with start, restart and stop is rebuilt
|
||||
|
||||
Reference in New Issue
Block a user