commit d105c8fb54e089070bcfe2b575d86974583066e0
parent 9d02a1bbd5cb1285e35f15bf6db692f2b78d37bc
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Sun, 11 Oct 2026 12:24:42 -0400
tts: `tts setup --engine orpheus`, the doctor and `pnpm ops tts` know Orpheus
`archilyzer tts setup --engine orpheus [--from <dir>]` builds its venv
(onnxruntime, numpy) and takes its GGUF, SNAC decoder and config — pinned by
size and sha256, from Hugging Face or a directory that holds them — and says
when the llama-server it runs on (settings.tts.orpheus.serverBin) is
missing. The doctor's tts row checks that server too. The ops help, the
route's comment and COMMANDS.md name the engine, its voices and its GPU
server.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Diffstat:
8 files changed, 61 insertions(+), 23 deletions(-)
diff --git a/COMMANDS.md b/COMMANDS.md
@@ -68,7 +68,7 @@ Run from the repo root (in the container: `docker compose exec editor pnpm archi
| `archilyzer docs files` | `[--check]` | write SITE.md + CHANNEL.md + REPORT.md + CITATIONS.md from the file schemas |
| `archilyzer docs cli` | `[--check]` | write COMMANDS.md from this command table and `pnpm ops --help` |
| `archilyzer settings example` | `[--check]` | write settings.json.example + SETTINGS.md from the schema |
-| `archilyzer tts setup` | `[--engine kokoro\|espeak-ng] [--from <dir>] [--python <py>] [--check]` | install a text-to-speech engine under settings.tts.home/<engine> (default ~/.local/share/archilyzer/tts/kokoro): a python venv with the pinned kokoro-onnx (uv venv --python 3.12 when uv is on PATH, else --python <py> -m venv) and the two model files, downloaded once from the kokoro-onnx project's model-files-v1.0 release (one stream, no retries) and verified by size and sha256; --from <dir> takes already-downloaded model files from <dir> instead (hard links where it can, else copies; verified the same way); --check installs nothing, lists what is missing and exits 1 when anything is |
+| `archilyzer tts setup` | `[--engine kokoro\|orpheus\|espeak-ng] [--from <dir>] [--python <py>] [--check]` | install a text-to-speech engine under settings.tts.home/<engine> (default ~/.local/share/archilyzer/tts/<engine>): a python venv with its pinned packages (uv venv --python 3.12 when uv is on PATH, else --python <py> -m venv) — kokoro-onnx for kokoro, onnxruntime and numpy for orpheus — and its model files, downloaded once (kokoro: the kokoro-onnx model-files-v1.0 release; orpheus: the Q8\_0 GGUF and the SNAC decoder from Hugging Face, 3.5 GB) one stream at a time with no retries, verified by size and sha256; --from <dir> takes already-downloaded model files from <dir> instead (hard links where it can, else copies; verified the same way); orpheus's llama-server is not installed here (settings.tts.orpheus.serverBin) but is checked; --check installs nothing, lists what is missing and exits 1 when anything is |
| `archilyzer doctor` | `[--json]` | read-only report: node, the checkout, the corpus, settings, every tool, the port block; exit 1 on a failure |
| `archilyzer release show` | `[editor\|export]` | latest release, its date, how many bullets wait under \[Unreleased\] |
| `archilyzer release cut` | `<editor\|export\|all> <X.Y.Z\|next\|next-minor> [--commit] [--date YYYY-MM-DD]` | \[Unreleased\] -> a dated heading; all = both, one version, two commits |
@@ -119,7 +119,7 @@ Drives a running editor over HTTP (`/api/ops/*`, the same actions its pages run)
| `fetch-windows` | fetch-windows fetches clip windows, one paced job per platform queue (YouTube and Rumble side by side): {"siteId"} fetches every window the site's published reports cite and the disk does not hold; {"items": \[{"slug", "id", "from", "to", "clipId"?, "reason"?, "pad"?, "webpageUrl"?}, ...\], "requestedBy", "manifest"?} fetches a list. "maxHeight" caps the source height (default 720). "dryRun": true lists the windows per platform, the ones already on disk ("cached") and the ones no fetch can fill ("unfetchable": deleted, off the site) and starts nothing. A platform cooling down or held is refused for its group; a 429, or two 403s in a row, backs the platform off and stops its job. Running the same body again resumes — fetched windows are cached, and a window a queued or running job will already write is answered in "inFlight" with that job, whose id joins "jobIds" (so --wait follows it) and no second job is queued. Windows run on the platform's clip queue (clips:youtube), never behind its long downloads. | `pnpm ops fetch-windows --json '{"siteId":"demo-site","dryRun":true}'`<br>`pnpm ops fetch-windows --file windows.json --wait` |
| `cut-release` | cut-release turns a changelog's \[Unreleased\] into "## \[<version>\] - <date>": {"workspace": "editor" \| "export" \| "all", "version": "X.Y.Z" \| "next" \| "next-minor", "commit": boolean (default false), "date": "YYYY-MM-DD" (default today)}. "all" cuts both with ONE version and commits each ("Release <workspace> <version>") — or neither: every check runs before either file is written. Only an editor built from release 10 or later has the route (an older one answers 404); with no editor running, `archilyzer release cut` does the same locally. | `pnpm ops cut-release --json '{"workspace":"all","version":"next","commit":true}'` |
| `transcribe` | transcribe runs ONE local file through a local transcription worker, as a job: {"path": "/abs/file"} (audio or video), "start"/"end" (seconds) for a window, "workerId" (a settings worker id; default: the one auto-transcribe would get), "out" (an absolute path for the result JSON, never inside the corpus). The result is {path, window, worker: {id, appId, model, device}, cues: \[{start, end, text}\], text, ...}, cue times on the file's own clock. "words": true adds words: \[{w, start, end, conf?}\] on the same clock -- from parakeet, which keeps its word timestamps; \[\] from an engine that does not. With --wait it is printed on stdout (the response and the log go to stderr), so `pnpm ops transcribe ... --wait \| jq -r .text` works. | `pnpm ops transcribe --json '{"path":"/abs/clip.mp4","start":120,"end":150}' --wait`<br>`pnpm ops transcribe --json '{"path":"/abs/a.wav","workerId":"parakeet-cpu","out":"/tmp/a.json"}' --wait` |
-| `tts` | tts speaks a line with a local text-to-speech engine and a STOCK voice, as a job on the `tts` queue: {"text": "..."} or {"file": "/abs/script.txt"} (UTF-8, at most 20,000 characters), "engine" (kokoro \| espeak-ng), "voice" (one of the engine's stock voices; kokoro: af\_heart, bm\_george, ...), "speed" (0.5-2) — defaults from settings.tts (kokoro, af\_heart, 1) — and "out" (an absolute .wav path the result is copied to, never inside the corpus). The expressive tags <laugh> <chuckle> <sigh> <cough> <sniffle> <groan> <yawn> <gasp> are stripped for an engine that cannot perform them; any other <...> is refused. Years are spoken (2024: "twenty twenty-four"). The result is {wav, seconds, engine, voice, cached, durationMs, waitedMs, sha, sampleRate, speed, disclosure}: wav is the 48 kHz mono WAV the editor wrote (out, or its cache), disclosure the line a narrated export carries. The same ask again is answered from the cache (cached: true, no engine run). Kokoro needs `archilyzer tts setup` first. With --wait the result is printed on stdout. | `pnpm ops tts --json '{"text":"In 2024 the archive spoke."}' --wait`<br>`pnpm ops tts --json '{"file":"/abs/script.txt","voice":"bm_george","out":"/abs/line.wav"}' --wait` |
+| `tts` | tts speaks a line with a local text-to-speech engine and a STOCK voice, as a job on the `tts` queue: {"text": "..."} or {"file": "/abs/script.txt"} (UTF-8, at most 20,000 characters), "engine" (kokoro \| orpheus \| espeak-ng), "voice" (one of the engine's stock voices; kokoro: af\_heart, bm\_george, ...; orpheus: leah, zac, ...), "speed" (0.5-2; orpheus has none) — defaults from settings.tts (kokoro, af\_heart, 1) — and "out" (an absolute .wav path the result is copied to, never inside the corpus). The expressive tags <laugh> <chuckle> <sigh> <cough> <sniffle> <groan> <yawn> <gasp> are performed by orpheus and stripped for the others; any other <...> is refused. Numbers, years, money and times are spoken (2024: "twenty twenty-four"). The result is {wav, seconds, engine, voice, cached, durationMs, waitedMs, sha, sampleRate, speed, disclosure}: wav is the 48 kHz mono WAV the editor wrote (out, or its cache), disclosure the line a narrated export carries. The same ask again is answered from the cache (cached: true, no engine run). Kokoro and orpheus need `archilyzer tts setup [--engine orpheus]` first; orpheus runs on the GPU (a local llama-server the editor starts and stops) and waits while a transcription holds it. With --wait the result is printed on stdout. | `pnpm ops tts --json '{"text":"In 2024 the archive spoke."}' --wait`<br>`pnpm ops tts --json '{"file":"/abs/script.txt","voice":"bm_george","out":"/abs/line.wav"}' --wait` |
| `settings` | settings patches settings.json through the editor's one writer: {"patch": {"<top-level key>": value, …}} (SETTINGS.md). A block's keys merge one level; an array, a scalar or an object nested in a block replaces. Refused before anything is written: an unknown key; a key another writer owns (channelPriority, autoQueue, workers, storage — the refusal names it); a value the schema would not keep as sent (clamped, dropped), named with what would be saved. Answers the saved values. | `pnpm ops settings --json '{"patch":{"minFreeDiskGB":20}}'` |
| `clear-platform-hold` | clear-platform-hold clears a platform's rate-limit hold, backoff and raised pace, as the lane strip's Clear hold: {"platform"}. Answers the sentence. | |
| `workers` | workers switches transcription workers as /workers does: {"op": "enable" \| "disable" \| "drain", "ids": \[...\]} — the live pool; a restart restores the launch default. An unknown id is named; the others still apply. | `pnpm ops workers --json '{"op":"disable","ids":["parakeet-cpu"]}'` |
diff --git a/common/bin/archilyzer.ts b/common/bin/archilyzer.ts
@@ -714,7 +714,7 @@ export const COMMANDS: Command[] = [
{
path: ["tts", "setup"],
usage:
- "[--engine kokoro|espeak-ng] [--from <dir>] [--python <py>] [--check] install a text-to-speech engine under settings.tts.home/<engine> (default ~/.local/share/archilyzer/tts/kokoro): a python venv with the pinned kokoro-onnx (uv venv --python 3.12 when uv is on PATH, else --python <py> -m venv) and the two model files, downloaded once from the kokoro-onnx project's model-files-v1.0 release (one stream, no retries) and verified by size and sha256; --from <dir> takes already-downloaded model files from <dir> instead (hard links where it can, else copies; verified the same way); --check installs nothing, lists what is missing and exits 1 when anything is",
+ "[--engine kokoro|orpheus|espeak-ng] [--from <dir>] [--python <py>] [--check] install a text-to-speech engine under settings.tts.home/<engine> (default ~/.local/share/archilyzer/tts/<engine>): a python venv with its pinned packages (uv venv --python 3.12 when uv is on PATH, else --python <py> -m venv) — kokoro-onnx for kokoro, onnxruntime and numpy for orpheus — and its model files, downloaded once (kokoro: the kokoro-onnx model-files-v1.0 release; orpheus: the Q8_0 GGUF and the SNAC decoder from Hugging Face, 3.5 GB) one stream at a time with no retries, verified by size and sha256; --from <dir> takes already-downloaded model files from <dir> instead (hard links where it can, else copies; verified the same way); orpheus's llama-server is not installed here (settings.tts.orpheus.serverBin) but is checked; --check installs nothing, lists what is missing and exits 1 when anything is",
flags: { engine: "string", from: "string", python: "string", check: "boolean" },
run: async ({ flags }) =>
(await import("./tts-setup")).main({
diff --git a/common/bin/doctor.ts b/common/bin/doctor.ts
@@ -832,7 +832,12 @@ export async function collectDoctorReport(deps: DoctorDeps): Promise<DoctorRepor
});
const voiceOk = engine.voices.includes(settings!.tts.voice);
return {
- ...ttsInstallState(engine, { home, paths: { espeakNgBin: paths.espeakNgBin ?? "espeak-ng" }, envPath: env.PATH }),
+ ...ttsInstallState(engine, {
+ home,
+ paths: { espeakNgBin: paths.espeakNgBin ?? "espeak-ng" },
+ envPath: env.PATH,
+ tts: settings!.tts,
+ }),
voice: settings!.tts.voice,
voiceOk,
};
diff --git a/common/bin/tts-setup.test.ts b/common/bin/tts-setup.test.ts
@@ -113,3 +113,17 @@ test("an unknown engine is refused; espeak-ng has nothing to install", async ()
assert.equal(await main({ engine: "espeak-ng", envPath: path.join(ROOT, "no-bin"), log: (l) => missing.push(l) }), 1);
assert.match(missing[0], /espeak-ng is not on PATH — install espeak-ng/);
});
+
+test("--check for orpheus names its files and the engine in its hint", async () => {
+ const home = path.join(ROOT, "empty-orpheus");
+ await mkdir(home);
+ const lines: string[] = [];
+ const code = await main({ engine: "orpheus", check: true, home, log: (l) => lines.push(l), envPath: path.join(ROOT, "no-bin") });
+ assert.equal(code, 1);
+ const text = lines.join("\n");
+ assert.match(text, /Orpheus 3B at .*empty-orpheus\/orpheus — missing:/);
+ assert.match(text, /- orpheus-3b-0\.1-ft-Q8_0\.gguf/);
+ assert.match(text, /- snac_decoder\.onnx/);
+ assert.match(text, /Run `archilyzer tts setup --engine orpheus`/);
+ assert.deepEqual(await readdir(home), []);
+});
diff --git a/common/bin/tts-setup.ts b/common/bin/tts-setup.ts
@@ -21,6 +21,14 @@
// at its pinned version — by importing it — each model file at its size) and
// exits 1 when anything is.
//
+// Orpheus (`--engine orpheus`) is the same shape: a venv with onnxruntime and
+// numpy (the SNAC decoder; no torch), and its GGUF, decoder and decoder config
+// from Hugging Face (unsloth/orpheus-3b-0.1-ft-GGUF, onnx-community/
+// snac_24khz-ONNX) — 3.5 GB, so `--from` a directory that holds them already is
+// the polite way on a machine that has them. The llama-server it runs on is not
+// installed here (settings.tts.orpheus.serverBin, Ollama's bundled build by
+// default); setup and `--check` say when it is missing.
+//
// espeak-ng (a `system` engine) has nothing to install: setup says whether it
// is on PATH.
//
@@ -161,13 +169,14 @@ export async function main(opts: TtsSetupOptions = {}): Promise<number> {
return found ? 0 : 1;
}
- const home = opts.home ?? resolveTtsHome(getSettings().tts, paths);
+ const tts = getSettings().tts;
+ const home = opts.home ?? resolveTtsHome(tts, paths);
const dir = ttsInstallDir(home, engine);
const python = ttsVenvPython(dir);
const [dist, pinned] = setup.packages[0].split("==");
if (opts.check) {
- const state = ttsInstallState(engine, { home, paths, envPath });
+ const state = ttsInstallState(engine, { home, paths, envPath, tts });
const missing = [...state.missing];
if (!missing.some((m) => m.startsWith("the python venv"))) {
const v = await installedVersion(python, setup.importName, dist);
@@ -179,7 +188,7 @@ export async function main(opts: TtsSetupOptions = {}): Promise<number> {
}
log(`${engine.label} at ${dir} — missing:`);
for (const m of missing) log(` - ${m}`);
- log("Run `archilyzer tts setup` to install it.");
+ log(`Run \`archilyzer tts setup${engine.id === DEFAULT_TTS_ENGINE_ID ? "" : ` --engine ${engine.id}`}\` to install it.`);
return 1;
}
@@ -259,5 +268,9 @@ export async function main(opts: TtsSetupOptions = {}): Promise<number> {
{ indent: 2 },
);
log(`${engine.label} installed: ${dir}`);
- return 0;
+ // What setup cannot install: a server binary the engine runs on (Orpheus's
+ // llama-server, settings.tts.orpheus.serverBin).
+ const absent = (engine.requires?.(tts) ?? []).filter((r) => !findOnPath(r.path, envPath));
+ for (const r of absent) log(` but ${r.what} is not there: ${r.path} — install it, or point the setting at one`);
+ return absent.length ? 1 : 0;
}
diff --git a/editor/app/api/ops/tts/route.ts b/editor/app/api/ops/tts/route.ts
@@ -13,11 +13,14 @@ export const dynamic = "force-dynamic";
// /jobs (`tts-file`, the `tts` queue, one synthesis at a time) — narration is
// never synthesized by hand. `text` is the words, or `file` an absolute path to
// a UTF-8 text file holding them (at most 20,000 characters); `engine`
-// (`kokoro` | `espeak-ng`), `voice` (one of the engine's stock voices) and
-// `speed` (0.5-2) default to settings.tts (kokoro · af_heart · 1); `out` is an
-// absolute .wav path the result is copied to. The expressive tags (`<laugh>`,
-// `<sigh>`, ... lib/ttsText.ts TTS_EXPRESSIVE_TAGS) are stripped for an engine
-// that cannot perform them; any other `<...>` is refused.
+// (`kokoro` | `orpheus` | `espeak-ng`), `voice` (one of the engine's stock
+// voices; Orpheus: leah by default, zac the male option) and `speed` (0.5-2;
+// Orpheus has none) default to settings.tts (kokoro · af_heart · 1); `out` is
+// an absolute .wav path the result is copied to. The expressive tags
+// (`<laugh>`, `<sigh>`, ... lib/ttsText.ts TTS_EXPRESSIVE_TAGS) are performed by
+// Orpheus and stripped for the others; any other `<...>` is refused. Orpheus
+// runs on the GPU, on a llama-server the editor starts for the batch and stops
+// once the `tts` queue is idle, and waits while a transcription holds the GPU.
//
// The job's log ends with the result as ONE line, `@@tts-result {json}`:
// `{wav, seconds, engine, voice, cached, durationMs (the engine's time), waitedMs
diff --git a/scripts/archilyzer-ops.mjs b/scripts/archilyzer-ops.mjs
@@ -1044,18 +1044,21 @@ export function usage() {
"",
'tts speaks a line with a local text-to-speech engine and a STOCK voice, as a',
' job on the `tts` queue: {"text": "..."} or {"file": "/abs/script.txt"} (UTF-8,',
- ' at most 20,000 characters), "engine" (kokoro | espeak-ng), "voice" (one of',
- ' the engine\'s stock voices; kokoro: af_heart, bm_george, ...), "speed"',
- ' (0.5-2) — defaults from settings.tts (kokoro, af_heart, 1) — and "out" (an',
- ' absolute .wav path the result is copied to, never inside the corpus). The',
- " expressive tags <laugh> <chuckle> <sigh> <cough> <sniffle> <groan> <yawn>",
- " <gasp> are stripped for an engine that cannot perform them; any other <...>",
- " is refused. Years are spoken (2024: \"twenty twenty-four\"). The result is",
+ ' at most 20,000 characters), "engine" (kokoro | orpheus | espeak-ng), "voice"',
+ " (one of the engine's stock voices; kokoro: af_heart, bm_george, ...; orpheus:",
+ ' leah, zac, ...), "speed" (0.5-2; orpheus has none) — defaults from',
+ ' settings.tts (kokoro, af_heart, 1) — and "out" (an absolute .wav path the',
+ " result is copied to, never inside the corpus). The expressive tags <laugh>",
+ " <chuckle> <sigh> <cough> <sniffle> <groan> <yawn> <gasp> are performed by",
+ " orpheus and stripped for the others; any other <...> is refused. Numbers,",
+ ' years, money and times are spoken (2024: "twenty twenty-four"). The result is',
" {wav, seconds, engine, voice, cached, durationMs, waitedMs, sha, sampleRate,",
" speed, disclosure}: wav is the 48 kHz mono WAV the editor wrote (out, or its",
" cache), disclosure the line a narrated export carries. The same ask again is",
- " answered from the cache (cached: true, no engine run). Kokoro needs",
- " `archilyzer tts setup` first. With --wait the result is printed on stdout.",
+ " answered from the cache (cached: true, no engine run). Kokoro and orpheus",
+ " need `archilyzer tts setup [--engine orpheus]` first; orpheus runs on the GPU",
+ " (a local llama-server the editor starts and stops) and waits while a",
+ " transcription holds it. With --wait the result is printed on stdout.",
"",
"Env: ARCHILYZER_EDITOR_URL (default http://localhost:3001), WORKER_TOKEN,",
" ARCHILYZER_AGENT (provenance of a tag write; default \"cli\").",
diff --git a/scripts/archilyzer-ops.test.mjs b/scripts/archilyzer-ops.test.mjs
@@ -670,7 +670,7 @@ test("tts posts its body and carries its own result marker", () => {
assert.equal(TTS_RESULT_MARKER, "@@tts-result ");
assert.equal(p.resultMarker, TTS_RESULT_MARKER);
assert.match(usage(), /tts speaks a line with a local text-to-speech engine and a STOCK voice/);
- assert.match(usage(), /<laugh> <chuckle> <sigh> <cough> <sniffle> <groan> <yawn>/);
+ assert.match(usage(), /The expressive tags <laugh>\n\s+<chuckle> <sigh> <cough> <sniffle> <groan> <yawn> <gasp> are performed by\n\s+orpheus and stripped for the others/);
assert.match(usage(), /\{wav, seconds, engine, voice, cached, durationMs, waitedMs, sha, sampleRate,/);
// The result line comes out of the log as transcribe's does.
const result = { wav: "/c/x.wav", seconds: 2.5, cached: true };