Archilyzer · Source

archilyzer

Archilyzer
git clone https://archilyzer.pages.dev/source/archilyzer.git
Log | Files | Refs | README | LICENSE

commit ed0d0b6831583d8277df28d1e934a9ffdfee7f47
parent 8d24cc0815d51e73deb339f6fa896322c9b7bdf7
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Sun, 11 Oct 2026 12:29:34 -0400

plans: release 25 — T1b, as shipped: Orpheus 3B as a second engine

The record (the engine, settings.tts.orpheus, the ported normalizer and
chunker, the helper's takes and checks, the server lifecycle, the GPU wait,
setup, what Lane B should know), the commit table and the gates — the real
Orpheus synthesis through the route at RTF 1.81. Two [Unreleased] bullets
in editor/CHANGELOG.md.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

Diffstat:
Meditor/CHANGELOG.md | 2++
Mplans/release-25.md | 62++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 64 insertions(+), 0 deletions(-)

diff --git a/editor/CHANGELOG.md b/editor/CHANGELOG.md @@ -1,6 +1,8 @@ # Changelog ## [Unreleased] +- **Orpheus 3B narrates too, on the GPU.** `pnpm ops tts` takes `"engine": "orpheus"` — Orpheus 3B with one of its eight stock speakers (`leah` by default, `zac` the male option, then tara, jess, leo, dan, mia, zoe), which performs the expressive tags (`<laugh>`, `<sigh>`, …) instead of dropping them. It runs on a local llama-server the editor starts for a batch of syntheses — after waiting for the machine's heavy slot and for any transcription on the GPU to finish — and stops once nothing more is queued, so its 4–5 GB of video memory is freed; the server's binary, libraries, port and GPU layers are `settings.tts.orpheus` (Ollama's bundled Vulkan build by default). Each chunk of 1–3 sentences gets up to three takes and the first that passes the checks is kept (it ended, no broken frames, a sane pace, no dead air); a chunk where none passes is kept anyway and flagged in the job's log and the sidecar. Its disclosure line ends "Built with Llama", as its licence (Llama 3.2 Community License + Apache-2.0) asks. About 1.8× slower than real time. `archilyzer tts setup --engine orpheus [--from <dir>]` installs it (3.5 GB of model). Needs a restart of the editor. +- **Narration reads numbers, money, dates and links the way they are said, with Kokoro too.** "3,812" is "three thousand eight hundred twelve", "$12.50" "twelve dollars and fifty cents", "March 14th" "March fourteenth", "3:45" "three forty-five", "45%" "forty-five percent", a link its spoken host ("example dot com"), "Dr." "Doctor", "@name" "at name"; years are read as before. A synthesis made before this is made again the next time it is asked for. - **Narration in a local synthetic voice, as a job.** `pnpm ops tts` (`POST /api/ops/tts`) speaks a line — `{"text"}`, or `{"file"}` an absolute path to a UTF-8 text file, at most 20,000 characters — with a local text-to-speech engine and one of its stock voices, as a `tts-file` job on its own `tts` queue, one synthesis at a time. The default is Kokoro-82M with the voice `af_heart` (`settings.tts`: `engine`, `voice`, `speed`, `home`, `dir`; SETTINGS.md); `"engine": "espeak-ng"` needs no install. Years are read as they are said ("twenty twenty-four"); the expressive tags `<laugh>` `<chuckle>` `<sigh>` `<cough>` `<sniffle>` `<groan>` `<yawn>` `<gasp>` are dropped for an engine that cannot perform them, and any other `<…>` is refused, named, so a typo is never read aloud. The result — `{wav, seconds, engine, voice, cached, durationMs, waitedMs, sha, sampleRate, speed, disclosure}`, printed by `--wait` — names a 48 kHz mono WAV in the synthesis cache (`<repo>/.tts/cache` by default, never inside the corpus), or the `"out"` path it was copied to, with a sidecar beside it that marks it a synthetic voice; `disclosure` is the line a narrated export carries ("Narration: synthetic voice (Kokoro-82M · af_heart)"). The same words with the same voice and speed again are answered from the cache at once, with no engine run. There is no voice cloning and no reference audio: a voice is a name from the engine's list. Needs a restart of the editor. - **`archilyzer tts setup` installs the voice.** It builds `~/.local/share/archilyzer/tts/kokoro` (`settings.tts.home`): a python venv with kokoro-onnx 0.6.1 (made with `uv` when it is installed) and the model's two files, downloaded once from the kokoro-onnx project's release and checked by size and sha256 before they are kept. `--from <dir>` takes files already downloaded instead; `--check` says what is missing and installs nothing. `archilyzer doctor` reports the configured engine and voice as installed or not. - **`pnpm ops site-config` sets a site's cited-only channels and publish policy.** `{"siteId", "citedChannels"?: [slug…], "publishAuto"?: "off" | "build" | "preview" | "production"}` (`POST /api/ops/site-config`) writes through the site form's own validation: a slug the pool holds is dropped, a deploying policy without a Pages project is refused, and a private site is clamped to `build`. An unknown site, channel or key is refused before anything is written. The answer is the saved values. diff --git a/plans/release-25.md b/plans/release-25.md @@ -276,3 +276,65 @@ The review surface first, then the writing guide from the Orpheus tuning round's | `pnpm run test:scripts` | 833: 830 pass, 3 skip | | mcp unit | 306/306 (+1: a sweep plan carries the hard rule verbatim and each of the five writing rules) | | umtool e2e `narration-review.spec.ts` (new) + `report-narration.spec.ts` (start mode) | 5 passed (20.1 s): approve; reject refused without a note, then with one; edit saved through the manifest and un-rejected; play asked the stub once for that card's words and the audio route served the WAV; a build refused with "timeline k02: its narration is not reviewed" and wrote no mp4 | + +### T1b, as shipped — Orpheus 3B as a second engine (`r25/orpheus`) + +The operator's ask after the tuning round (job tmp `tts-orpheus2-report.md`; the pipeline `run_orpheus2.py`): Orpheus as +a second engine, its tuned pipeline ported, Kokoro (af_heart) still the default. + +- **The engine** (`common/lib/ttsApps.ts` `orpheus`): Orpheus 3B 0.1-ft Q8_0 GGUF on llama.cpp's server + the SNAC + 24 kHz ONNX decoder on the CPU (onnxruntime; no torch). `device: "gpu"`, `runtime: "server"`, voices `tara leah jess + leo dan mia zac zoe` (default `leah`, `zac` the male option), speed range [1, 1], licence "Llama 3.2 Community + License + Apache-2.0", attribution "Built with Llama" — the disclosure reads "Narration: synthetic voice (Orpheus 3B · + leah). Built with Llama". The sampler is the round's choice (t 0.7, top_p 0.9, top_k 50, min_p 0, repeat_penalty + 1.1, repeat_last_n 64), seeds 1234 + 101·take + chunk. Files pinned by size and sha256: the GGUF from + `unsloth/orpheus-3b-0.1-ft-GGUF`, `snac_decoder.onnx` and `snac_config.json` from `onnx-community/snac_24khz-ONNX` + (each identical to the bake-off's copy). +- **`settings.tts.orpheus`** (SETTINGS.md): `serverBin` `/usr/lib/ollama/llama-server`, `libraryPath` + `/usr/lib/ollama` (LD_LIBRARY_PATH), `ggmlBackendPath` `/usr/lib/ollama/vulkan/libggml-vulkan.so`, `port` 8799, + `gpuLayers` 99, `contextSize` 8192, `startTimeoutSeconds` 150, `idleStopSeconds` 5, `heavyEstimateMB` 4000, `takes` + 3, `tagCheck` false. Nothing about the server is hard-coded. +- **The normalizer** (`lib/ttsText.ts`): the round's `normalize()` ported, its 17 self-tests as unit tests (all pass + unchanged). Options per engine: tags kept (Orpheus) or stripped; years `guarded` (Orpheus: "1950 people" is a count) + or `plain` (Kokoro keeps T1's rule); paragraphs kept for the chunker or joined. Kokoro now gets the whole spoken form + too (numbers, money, ordinals, times, URLs, handles, abbreviations), so its cache keys change once. +- **The chunker** (`lib/ttsChunk.ts`): the round's `chunk()` and the token budget, held byte-equal to the pipeline's own + output on all nine bake-off lines. The editor chunks; the helper renders. +- **The helper** (`scripts/tts_orpheus.py`, behind `scripts/tts.mjs --engine-kind orpheus`): per chunk up to `takes` + takes, the FIRST that passes kept (end token reached, no malformed frame, not truncated, words/s in band, no long + silence); the rate floor is lowered 0.25 words/s per sentence past the first (min 1.5), so slow multi-sentence and + story reads pass. When none passes: the fewest failures (never a truncated or malformed take) are kept and the chunk + is FLAGGED (job log, sidecar `flagged`); all truncated or malformed fails the job. Joins: trim, loudness match ±6 dB, + 15 ms fades, pauses 0.30 / 0.15 / 0.60 s. **UTMOS is left out**: it needs torch, which the default install does not + carry. The tag-length check (a plain-twin take per tagged chunk) is behind `tagCheck`, off. +- **The server** (`controller/ttsServer.ts`): one holder per engine; started through `queue-lock --heavy --estimate` + for the first synthesis of a batch, `/health` polled, reused by the next, stopped (SIGTERM to its process group, + SIGKILL after 15 s) once `idleStopSeconds` pass with nothing taking it, on a failed or cancelled start, and on the + editor's exit. A port something else answers on is refused. Server output goes to `<install dir>/server.log`, the + gate's lines to the job log. +- **The GPU wait** (`ttsFile.ts` `waitForGpu`): a GPU engine waits to start while a transcription runs on a local + worker whose device is not `cpu`; a synthesis running is not interrupted. +- **Setup and doctor**: `archilyzer tts setup --engine orpheus [--from <dir>]` (venv with onnxruntime 1.31.0 and numpy + 2.5.4; the three files); setup, `--check` and the doctor's `tts` row also check the configured `serverBin`. +- **For Lane B / umtool**: the engine id is `orpheus`, its label `Orpheus 3B` (umtool's fallback label map says + `Orpheus`; the editor's `disclosure` is used verbatim when present, and it carries "Built with Llama"). `speed` must be + 1 for Orpheus (absent is fine). + +| commit | what | +|---|---| +| `edbabe51` | the spoken-form normalizer (17 self-tests) and the chunker, Kokoro on the new normalizer | +| `3be65c04` | the `orpheus` engine, `settings.tts.orpheus`, the server holder, the GPU wait, the helper and the wrapper | +| `1fe6160f` | `tts setup --engine orpheus`, the doctor, the ops help, COMMANDS.md | +| `998a3450` | merge of `r25/integration` (T5) | + +#### Gates (T1b) + +| gate | result | +|---|---| +| tsc (`pnpm -r … exec tsc --noEmit`) | clean at each code commit | +| common unit | 3772 pass, 0 fail (new: ttsChunk 5, ttsServer 6 — a fake llama-server: reuse, idle stop, restart on new settings, port refusal, early death, start timeout, cancel, SIGKILL; ttsFile +5, ttsApps +3, ttsText +3, ttsSettings +1, tts-setup +1) | +| editor unit | 260 pass | +| test:scripts | 827: 824 pass, 3 skip (new: `tts_orpheus.test.mjs` 2 — the helper's selftest of 22 checks; `tts.test.mjs` refusals) | +| `docs env\|files\|cli --check`, `settings example --check` | clean | +| `archilyzer tts setup --engine orpheus --from <bake-off models>` | real: uv venv py3.12 + onnxruntime 1.31.0 + numpy 2.5.4, the three files hard-linked and verified; `--check` 0 | +| one real Orpheus synthesis through the route, voice leah | in-process route handler, isolated temp corpus and cache, under `pnpm heavy` (10 GB free, VRAM idle 115 MB, nothing else on the GPU): 372 characters, 3 paragraphs with a `<sigh>`, numbers and a date → 3 chunks, each passing on its FIRST take → 24.8 s of audio in 44.9 s engine time — **RTF 1.81** (2.09 wall, the 6.8 s server start included); VRAM peak 4442 MB, back to 112 MB after the idle stop; no llama-server left running; the sidecar disclosed "Built with Llama" |