From 3ad790770a6af14526654549427d0f5e8e01b5aa Mon Sep 17 00:00:00 2001 From: Mikei386 <44135113+Mikei386@users.noreply.github.com> Date: Tue, 27 Oct 2026 16:49:56 +0100 Subject: [PATCH] Record actual isolated Chatterbox Nano German CPU trial --- .../README.md | 127 +++++++++++++ .../benchmark.py | 91 +++++++++ .../final-verification.json | 13 ++ .../manifest.json | 176 ++++++++++++++++++ .../prepare.py | 75 ++++++++ .../requirements-resolved.txt | 114 ++++++++++++ .../score.py | 36 ++++ .../speed.json | 78 ++++++++ .../support.py | 37 ++++ .../transcriptions.json | 14 ++ .../tts-candidate-shortlist-2026-10-27.md | 10 +- 11 files changed, 768 insertions(+), 3 deletions(-) create mode 100644 docs/experiments/chatterbox-nano-de-cpu-2026-10-27/README.md create mode 100644 docs/experiments/chatterbox-nano-de-cpu-2026-10-27/benchmark.py create mode 100644 docs/experiments/chatterbox-nano-de-cpu-2026-10-27/final-verification.json create mode 100644 docs/experiments/chatterbox-nano-de-cpu-2026-10-27/manifest.json create mode 100644 docs/experiments/chatterbox-nano-de-cpu-2026-10-27/prepare.py create mode 100644 docs/experiments/chatterbox-nano-de-cpu-2026-10-27/requirements-resolved.txt create mode 100644 docs/experiments/chatterbox-nano-de-cpu-2026-10-27/score.py create mode 100644 docs/experiments/chatterbox-nano-de-cpu-2026-10-27/speed.json create mode 100644 docs/experiments/chatterbox-nano-de-cpu-2026-10-27/support.py create mode 100644 docs/experiments/chatterbox-nano-de-cpu-2026-10-27/transcriptions.json diff --git a/docs/experiments/chatterbox-nano-de-cpu-2026-10-27/README.md b/docs/experiments/chatterbox-nano-de-cpu-2026-10-27/README.md new file mode 100644 index 0000000..9482876 --- /dev/null +++ b/docs/experiments/chatterbox-nano-de-cpu-2026-10-27/README.md @@ -0,0 +1,127 @@ +# Chatterbox Nano German · actual Athena CPU trial, 27 October 2026 + +Michael explicitly requested trying this candidate after the earlier research +had only an external CPU measurement. This experiment measures the real Athena +path; it does not replace that evidence with a prediction. Sopro technical B +remains the accepted documentary comparison reference, not a newly activated +production profile. + +## Candidate and native setup + +- Chatterbox source `5de7a54aa4e5e2baadb0182dde554908b48b85c2`, version 0.1.7. +- Official `ResembleAI/chatterbox-nano` checkpoint revision + `71ccd1d0081b430592cea481f4307e764e07bc64`. +- Community German v0.1 V2 LoRA `Pseudonaut/chatterbox-nano-de-lora`, revision + `718bc3d068b0cadbfbdfafda0539e0049df22a0a`. +- Adapter loader source `Pseud0naut/chatterbox-nano-language-training`, revision + `b61b3ef7fa320807c57149482ff91ac550b10ff1`; Perth watermark source pinned to + `ff1c8ac55a976971245cdd53c18d6131ca00d993`. +- Standalone CPython 3.11.18, release 20261026, installed only in the test root + and verified against the GitHub release asset SHA-256. Host Python unchanged. +- Separate venv with torch/torchaudio 2.6.0+cpu, numpy 1.26.4, transformers + 5.2.0, PEFT 0.18.0 and s3tokenizer 0.3.0. Full actual dependency versions in + `requirements-resolved.txt`; `pip check` and import preflight passed. +- Only the required Nano mean-flow decoder was downloaded, not the unused + original S3Gen model or larger Turbo/Multilingual T3 checkpoints. Publisher + LFS SHA-256 values matched; see `manifest.json`. + +The advertised 110M size is not the complete inference stack. After merging +the adapter in RAM, actual parameter counts were T3 178,859,171, S3Gen +266,030,919 and voice encoder 1,423,618: **446,313,708 total**. This does not +reclassify a different model as Nano; the official checkpoint, GPT2_small +architecture and tokenizer dimensions were explicitly validated. + +## Protocol and speed decision + +CPU only, FP32, four intra-op threads, one inter-op thread, affinity 2–5/8–11, +CPU quota 400%, nice 10, MemoryMax 5500 MiB, no swap. The somewhat larger memory +limit than Sopro's reflects this candidate's known load footprint. A guard +terminates only the own test process if host available memory stays below +1.5 GiB; it did not trigger. All actual model parameters were on CPU, and +`torch.version.cuda` was `None`. Inference used `PrivateNetwork=yes`, offline +local model files and a 180-second overall limit. + +The existing private Anna excerpt **B**, 05:25.14–05:33.00, was reused unchanged. +Reference preparation and loading are timed separately. Standard PEFT +`merge_and_unload(safe_merge=True)` removed adapter-wrapper per-token overhead +in RAM before generation; no merged production model or new checkpoint was +written. Default upstream loudness handling and Perth watermarking remained. + +Same 36-word story as the earlier comparisons, seed 42, temperature 0.8, +top-p 0.95, top-k 1000 and repetition penalty 1.2. The raw input is in +`speed.json`. No text normalization or Anna-specific tuning was introduced. + +| Quantity | Observed | +| --- | ---: | +| Model load | 6.967 s | +| In-RAM LoRA merge | 0.367 s | +| First reference preparation | 10.406 s | +| Synthesis including normal upstream watermark | **14.815 s** | +| Generated audio | **16.980 s** | +| RTF | **0.8725** | +| Realtime multiple | **1.146×** | +| Process peak RSS | 4.03 GiB | +| Inference-unit peak memory, including its charged cache | approximately 4.7 GiB | +| Swap | 0 | + +The first complete inference missed the existing minimum 2× realtime gate +(RTF ≤ 0.5). Per Michael's speed-first rule, the script stopped before a second +render and before the six-reference/text quality matrix. No thread sweep, +quantization trial, warm rerun or larger-model fallback followed. This is a +**first-synthesis result**, not a steady-state warmed benchmark or a proof that +every possible Chatterbox implementation/precision must fail on Athena. +First reference preparation can include lazy library/JIT work; it is excluded +from the synthesis time, not counted as decoder throughput. + +For context, the earlier Sopro FP32 story with reference B produced 14.709 s in +5.981 s, approximately 2.46× realtime. These are the same words/reference but +different synthesis models and durations, not waveform-identical work. Strata +remained resident in this trial; no synthetic concurrent LLM load was added. + +## Existing sample and local STT + +The only completed WAV is mono 24 kHz PCM16, with finite samples, peak 0.5795 +and no observed clipping. Upstream emitted its reference mel/token-length +warning; it handled the length mismatch and returned completed audio. Do not +silently label the warning a proven production defect. + +The existing Parakeet Redux v0.6.1 native CPU CLI transcribed this one sample +in 1.328 s: 35 of 36 words match under the case/punctuation comparison; it +recognized **“hohe Tasse” instead of “rote Tasse”**. This is a TTS/STT discrepancy, +not a human-confirmed pronunciation judgment or an Anna-similarity metric. +No accent or identity score is inferred from it. A listening copy was provided +for Michael even though no broader quality matrix followed the failed gate. + +Remote output remains in the own root's `outputs/`. Local listening copy: +`work/chatterbox-nano-de-20261027/audio/chatterbox-nano-de-speed-story-B-1.wav`. +Its SHA-256, WAV header and duration were verified against the remote result. +Private reference recordings/transcripts, model weights and WAVs stay out of Git. + +## Preservation and reproduction + +Own root `/data/athena-chatterbox-nano-de-20261027`, 0700, approximately 3.80 GiB +including the separate Python, venv, public checkpoints, code and one sample. +Preparation, inference and STT transient units all ended and were collected. +No server, container, permanent service, endpoint/profile switch, GPU load, +training, production request or client patch was performed. Production file +hashes, worker PIDs and Deck start time remained unchanged throughout; see +`final-verification.json`. + +For native reproduction, supply host Python 3.11+ with tar extraction's data +filter, Git, CA roots, network for public preparation and a configured test +root. `prepare.py` downloads/verifies standalone Python and exact public pins, +creates its own CPU venv and records a resolved package set. It reads production +files only to hash preservation, not to obtain credentials. Its helper assumes +this current production layout; configure those paths on another host. + +Supply the separately restored private reference WAVs, then run +`venv/bin/python benchmark.py speed` under the above resource limits. Only a +passed gate enables `benchmark.py quality`. Existing result files are never +overwritten. `score.py` requires the separately installed native Parakeet CLI +and model; it never modifies the production STT endpoint. Adjust explicit +paths and local source URLs in dependency pins if the configured root differs. +This is an experiment recipe, not a complete native Deck installer/restore test. + +Public provenance: [Nano](https://huggingface.co/ResembleAI/chatterbox-nano), +[German adapter](https://huggingface.co/Pseudonaut/chatterbox-nano-de-lora), +[adapter source](https://github.com/Pseud0naut/chatterbox-nano-language-training). diff --git a/docs/experiments/chatterbox-nano-de-cpu-2026-10-27/benchmark.py b/docs/experiments/chatterbox-nano-de-cpu-2026-10-27/benchmark.py new file mode 100644 index 0000000..a67a281 --- /dev/null +++ b/docs/experiments/chatterbox-nano-de-cpu-2026-10-27/benchmark.py @@ -0,0 +1,91 @@ +"""Bounded real CPU trial of pinned Chatterbox Nano + German LoRA, no endpoint changes.""" +import os +from pathlib import Path +ROOT=Path('/data/athena-chatterbox-nano-de-20261027') +os.environ.update(CUDA_VISIBLE_DEVICES='',HF_HUB_OFFLINE='1',HF_HUB_DISABLE_IMPLICIT_TOKEN='1',HF_HUB_DISABLE_TELEMETRY='1', + HF_HOME=str(ROOT/'cache/huggingface'),TORCH_HOME=str(ROOT/'cache/torch'),NUMBA_CACHE_DIR=str(ROOT/'cache/numba'), + XDG_CACHE_HOME=str(ROOT/'cache'),OMP_NUM_THREADS='4',MKL_NUM_THREADS='4',OPENBLAS_NUM_THREADS='1',TOKENIZERS_PARALLELISM='false') +import argparse +import gc +import hashlib +import json +import random +import resource +import signal +import threading +import time +import numpy as np +import soundfile as sf +import torch +from nano_de.model import load_adapter_engine,validate_nano_engine,count_parameters +from support import CASES,REFS,available,write,preservation + +def seed():random.seed(42);np.random.seed(42);torch.manual_seed(42) + +def main(): + parser=argparse.ArgumentParser();parser.add_argument('phase',choices=['speed','quality']);args=parser.parse_args() + os.umask(0o077);torch.set_num_threads(4);torch.set_num_interop_threads(1) + os.sched_setaffinity(0,{2,3,4,5,8,9,10,11}) + assert torch.version.cuda is None and not torch.cuda.is_available() + assert available()>=6*1024**3,'Insufficient host reserve for candidate load' + target=ROOT/(args.phase+'.json');assert not target.exists(),'Refuse to overwrite previous trial' + if args.phase=='quality': + gate=json.loads((ROOT/'speed.json').read_text());assert gate['phase']=='complete' and gate['gate_passed'] + (ROOT/'outputs').mkdir(exist_ok=True,mode=0o700) + data=dict(phase='loading',runs=[],references=[],protocol=dict(cpu_threads=4,interop_threads=1,seed=42, + device='cpu',cpu_affinity=sorted(os.sched_getaffinity(0)),precision='fp32',adapter='German v0.1 V2, merged in RAM', + gate_max_rtf=.5,speed_reference='B',s3gen_meanflow=True,temperature=.8,top_p=.95,top_k=1000, + repetition_penalty=1.2,perth_watermark='upstream default',cpu_quota_percent=400,memory_max_mib=5500, + concurrent_llm_load_added=False),initial_available_gib=available()/2**30,torch=torch.__version__) + write(target,data) + # The only cancellation target is this own transient test process. + finished=threading.Event() + def watch(): + low=0 + while not finished.wait(.25): + low=low+1 if available()<1536*1024**2 else 0 + if low>=4:os.kill(os.getpid(),signal.SIGTERM);return + threading.Thread(target=watch,daemon=True).start() + try: + seed();start=time.monotonic() + engine=load_adapter_engine(device='cpu',model_dir=ROOT/'model',adapter_dir=ROOT/'adapter') + data['load_seconds']=time.monotonic()-start + data['t3_before_merge']=count_parameters(engine.t3) + # Standard PEFT merge removes per-token adapter wrapper overhead without quantization. + start=time.monotonic();engine.t3=engine.t3.merge_and_unload(safe_merge=True).eval();gc.collect() + validate_nano_engine(engine);data['merge_seconds']=time.monotonic()-start + data['parameters']={n:count_parameters(getattr(engine,n))['total'] for n in ['t3','s3gen','ve']} + assert all(p.device.type=='cpu' for n in ['t3','s3gen','ve'] for p in getattr(engine,n).parameters()) + work=[('B',CASES[0],1),('B',CASES[0],2)] if args.phase=='speed' else [(label,case,1) for label in 'ABC' for case in CASES] + current=None + for label,case,rep in work: + if label!=current: + seed();start=time.monotonic();refpath=REFS/f'anna-reference-{label}.wav' + engine.prepare_conditionals(str(refpath),exaggeration=0,norm_loudness=True) + data['references'].append(dict(label=label,seconds=time.monotonic()-start,sha256=hashlib.file_digest(refpath.open('rb'),'sha256').hexdigest())) + current=label + seed();start=time.monotonic() + with torch.inference_mode(): + wav=engine.generate(case['text'],audio_prompt_path=None,repetition_penalty=1.2,top_p=.95,temperature=.8,top_k=1000) + seconds=time.monotonic()-start + pcm=wav.detach().cpu().numpy().reshape(-1) + assert len(pcm) and np.isfinite(pcm).all() + name=f'chatterbox-nano-de-{args.phase}-{case["id"]}-{label}-{rep}.wav' + file=ROOT/'outputs'/name;sf.write(file,pcm,engine.sr,subtype='PCM_16') + row=dict(label=label,case=case['id'],text=case['text'],repetition=rep,file=name,sample_rate=engine.sr, + generation_seconds=seconds,duration_seconds=len(pcm)/engine.sr,rtf=seconds/(len(pcm)/engine.sr), + peak=float(np.max(np.abs(pcm))),clipped_fraction=float(np.mean(np.abs(pcm)>=1)), + peak_rss_kib=resource.getrusage(resource.RUSAGE_SELF).ru_maxrss,available_gib=available()/2**30, + sha256=hashlib.file_digest(file.open('rb'),'sha256').hexdigest()) + data['runs'].append(row);data['phase']='running';write(target,data);print(json.dumps(row,ensure_ascii=False),flush=True) + if args.phase=='speed' and row['rtf']>.5: + data['phase']='speed_rejected';data['gate_passed']=False;break + else:data['phase']='complete';data['gate_passed']=True + data['weighted_rtf']=sum(r['generation_seconds'] for r in data['runs'])/sum(r['duration_seconds'] for r in data['runs']) + data['production_preservation']=preservation();write(target,data) + print(json.dumps(dict(phase=data['phase'],gate_passed=data['gate_passed'],weighted_rtf=data['weighted_rtf'],preservation=data['production_preservation'])),flush=True) + except BaseException as error: + data.update(phase='failed',error=type(error).__name__+': '+str(error));write(target,data);raise + finally:finished.set() + +if __name__=='__main__':main() diff --git a/docs/experiments/chatterbox-nano-de-cpu-2026-10-27/final-verification.json b/docs/experiments/chatterbox-nano-de-cpu-2026-10-27/final-verification.json new file mode 100644 index 0000000..5ee24db --- /dev/null +++ b/docs/experiments/chatterbox-nano-de-cpu-2026-10-27/final-verification.json @@ -0,0 +1,13 @@ +{ + "production_preservation": { + "files_equal": true, + "pids_equal": true, + "deck_start_equal": true + }, + "units": { + "prepare": "LoadState=not-found\nActiveState=inactive", + "speed": "LoadState=not-found\nActiveState=inactive", + "stt": "LoadState=not-found\nActiveState=inactive" + }, + "own_disk_bytes": 4079722898 +} \ No newline at end of file diff --git a/docs/experiments/chatterbox-nano-de-cpu-2026-10-27/manifest.json b/docs/experiments/chatterbox-nano-de-cpu-2026-10-27/manifest.json new file mode 100644 index 0000000..076e070 --- /dev/null +++ b/docs/experiments/chatterbox-nano-de-cpu-2026-10-27/manifest.json @@ -0,0 +1,176 @@ +{ + "python_url": "https://github.com/astral-sh/python-build-standalone/releases/download/20261026/cpython-3.11.18%2B20261026-x86_64-unknown-linux-gnu-install_only.tar.gz", + "python_sha256": "a87ee63646c8f8438b7af3954b2135ed2af91d033c631f12a8f20af903046d06", + "repositories": { + "chatterbox": [ + "https://github.com/resemble-ai/chatterbox.git", + "5de7a54aa4e5e2baadb0182dde554908b48b85c2" + ], + "adapter-source": [ + "https://github.com/Pseud0naut/chatterbox-nano-language-training.git", + "b61b3ef7fa320807c57149482ff91ac550b10ff1" + ], + "perth": [ + "https://github.com/resemble-ai/Perth.git", + "ff1c8ac55a976971245cdd53c18d6131ca00d993" + ] + }, + "models": { + "model": [ + "ResembleAI/chatterbox-nano", + "71ccd1d0081b430592cea481f4307e764e07bc64", + [ + "t3_nano_v1.safetensors", + "s3gen_meanflow.safetensors", + "ve.safetensors", + "conds.pt", + "vocab.json", + "merges.txt", + "added_tokens.json", + "special_tokens_map.json", + "tokenizer_config.json", + "t3_nano_v1.yaml", + "README.md" + ] + ], + "adapter": [ + "Pseudonaut/chatterbox-nano-de-lora", + "718bc3d068b0cadbfbdfafda0539e0049df22a0a", + [ + "adapter_model.safetensors", + "adapter_config.json", + "nano_de_adapter.json", + "training_config.yaml", + "README.md", + "NOTICE" + ] + ] + }, + "files": [ + { + "folder": "model", + "file": "t3_nano_v1.safetensors", + "bytes": 869899204, + "sha256": "72b110185087d945dbdf54dee4e333848e1811bdd5fd6cb16ceb8da50006f0c9", + "publisher_lfs_sha256": "72b110185087d945dbdf54dee4e333848e1811bdd5fd6cb16ceb8da50006f0c9" + }, + { + "folder": "model", + "file": "s3gen_meanflow.safetensors", + "bytes": 1064875036, + "sha256": "d65cb687a2ed581ee6cc297e919ffefa63386944f42364ae13b78a594945514f", + "publisher_lfs_sha256": "d65cb687a2ed581ee6cc297e919ffefa63386944f42364ae13b78a594945514f" + }, + { + "folder": "model", + "file": "ve.safetensors", + "bytes": 5695784, + "sha256": "f0921cab452fa278bc25cd23ffd59d36f816d7dc5181dd1bef9751a7fb61f63c", + "publisher_lfs_sha256": "f0921cab452fa278bc25cd23ffd59d36f816d7dc5181dd1bef9751a7fb61f63c" + }, + { + "folder": "model", + "file": "conds.pt", + "bytes": 169454, + "sha256": "b1852099306fd6a7814eb9d0bd10186caba7249596cc23868f78a0eefbfa5033", + "publisher_lfs_sha256": "b1852099306fd6a7814eb9d0bd10186caba7249596cc23868f78a0eefbfa5033" + }, + { + "folder": "model", + "file": "vocab.json", + "bytes": 999186, + "sha256": "f6bd25a65e4e63ca31360e9fb11c7e4f9a391a78385d640acd814092dd6eee4f", + "publisher_lfs_sha256": null + }, + { + "folder": "model", + "file": "merges.txt", + "bytes": 456318, + "sha256": "1ce1664773c50f3e0cc8842619a93edc4624525b728b188a9e0be33b7726adc5", + "publisher_lfs_sha256": null + }, + { + "folder": "model", + "file": "added_tokens.json", + "bytes": 418, + "sha256": "72e4ab6acb0d9309ac3df4b526ae5fd80a2da5bc5ab7bb02d85096a374f69193", + "publisher_lfs_sha256": null + }, + { + "folder": "model", + "file": "special_tokens_map.json", + "bytes": 470, + "sha256": "92ba8063bf40aa163eadebbfe0de07c2aebe44cf0d4a9e8726580b0781fd2640", + "publisher_lfs_sha256": null + }, + { + "folder": "model", + "file": "tokenizer_config.json", + "bytes": 3878, + "sha256": "bca16a2ac1ddbd78b8d6228f0031884cc74b6ea54b967d6f6d2ebae9ccde23e6", + "publisher_lfs_sha256": null + }, + { + "folder": "model", + "file": "t3_nano_v1.yaml", + "bytes": 8488, + "sha256": "e1aed076644bb64dbd534dedb6b94cb8ff9a1e30b564036d13fa353a729668eb", + "publisher_lfs_sha256": null + }, + { + "folder": "model", + "file": "README.md", + "bytes": 10773, + "sha256": "5956fccde9b5438b42e66a59a0a06a7ea1daf22d781ad87bc20ff7ac340562bc", + "publisher_lfs_sha256": null + }, + { + "folder": "adapter", + "file": "adapter_model.safetensors", + "bytes": 9448672, + "sha256": "7eb5097c5287e7ab0b2a55de19e5321d67f66771ea1ffd1201d2215cb7517b06", + "publisher_lfs_sha256": "7eb5097c5287e7ab0b2a55de19e5321d67f66771ea1ffd1201d2215cb7517b06" + }, + { + "folder": "adapter", + "file": "adapter_config.json", + "bytes": 1039, + "sha256": "1d417fd052465398e10dba2575b0aa2e5baa004842346df977968cb001bd6424", + "publisher_lfs_sha256": null + }, + { + "folder": "adapter", + "file": "nano_de_adapter.json", + "bytes": 570, + "sha256": "597192d90707e2be7d86a3a82493efa34a011818c0e19432357b6aa1dd1908a4", + "publisher_lfs_sha256": null + }, + { + "folder": "adapter", + "file": "training_config.yaml", + "bytes": 1407, + "sha256": "bb5ab00638e3037eaeb06878a3016b4d15405447e461d54d618cec3b042ca2d9", + "publisher_lfs_sha256": null + }, + { + "folder": "adapter", + "file": "README.md", + "bytes": 7040, + "sha256": "1b6cd48687c223a72031f5459ef798a3b84347ac87e27855a664428a1bfa7bd1", + "publisher_lfs_sha256": null + }, + { + "folder": "adapter", + "file": "NOTICE", + "bytes": 1666, + "sha256": "367705607465ccb707b886e1fdaef3be789f5bc8e5b5a2fff68e97da700d1dc1", + "publisher_lfs_sha256": null + } + ], + "total_model_bytes": 1951579403, + "production_preservation": { + "files_equal": true, + "pids_equal": true, + "deck_start_equal": true + } +} \ No newline at end of file diff --git a/docs/experiments/chatterbox-nano-de-cpu-2026-10-27/prepare.py b/docs/experiments/chatterbox-nano-de-cpu-2026-10-27/prepare.py new file mode 100644 index 0000000..c55c972 --- /dev/null +++ b/docs/experiments/chatterbox-nano-de-cpu-2026-10-27/prepare.py @@ -0,0 +1,75 @@ +"""Own native Python/CPU venv, pinned public code and Nano + German adapter assets.""" +from pathlib import Path +import hashlib +import json +import os +import subprocess +import tarfile +import tomllib +import urllib.request +from support import ROOT,snapshot,write,preservation + +PYTHON_URL='https://github.com/astral-sh/python-build-standalone/releases/download/20261026/cpython-3.11.18%2B20261026-x86_64-unknown-linux-gnu-install_only.tar.gz' +PYTHON_SHA='a87ee63646c8f8438b7af3954b2135ed2af91d033c631f12a8f20af903046d06' +REPOSITORIES={ + 'chatterbox':('https://github.com/resemble-ai/chatterbox.git','5de7a54aa4e5e2baadb0182dde554908b48b85c2'), + 'adapter-source':('https://github.com/Pseud0naut/chatterbox-nano-language-training.git','b61b3ef7fa320807c57149482ff91ac550b10ff1'), + 'perth':('https://github.com/resemble-ai/Perth.git','ff1c8ac55a976971245cdd53c18d6131ca00d993')} +MODELS={ + 'model':('ResembleAI/chatterbox-nano','71ccd1d0081b430592cea481f4307e764e07bc64', + ['t3_nano_v1.safetensors','s3gen_meanflow.safetensors','ve.safetensors','conds.pt','vocab.json', + 'merges.txt','added_tokens.json','special_tokens_map.json','tokenizer_config.json','t3_nano_v1.yaml','README.md']), + 'adapter':('Pseudonaut/chatterbox-nano-de-lora','718bc3d068b0cadbfbdfafda0539e0049df22a0a', + ['adapter_model.safetensors','adapter_config.json','nano_de_adapter.json','training_config.yaml','README.md','NOTICE'])} + +def run(args):subprocess.run([str(x) for x in args],check=True) +def download(url,path,expected=None): + if path.exists() and expected and hashlib.file_digest(path.open('rb'),'sha256').hexdigest()==expected:return + tmp=path.with_suffix(path.suffix+'.part') + with urllib.request.urlopen(url,timeout=120) as r,tmp.open('wb') as w: + while chunk:=r.read(1024*1024):w.write(chunk) + digest=hashlib.file_digest(tmp.open('rb'),'sha256').hexdigest() + assert not expected or digest==expected,'Downloaded checksum mismatch: '+path.name + tmp.replace(path) + +os.umask(0o077);ROOT.mkdir(exist_ok=True,mode=0o700) +os.environ.update(PIP_DISABLE_PIP_VERSION_CHECK='1',CUDA_VISIBLE_DEVICES='',OMP_NUM_THREADS='2',OPENBLAS_NUM_THREADS='1', + HF_HOME=str(ROOT/'cache/huggingface'),HF_HUB_DISABLE_TELEMETRY='1',HF_HUB_DISABLE_IMPLICIT_TOKEN='1', + TORCH_HOME=str(ROOT/'cache/torch'),NUMBA_CACHE_DIR=str(ROOT/'cache/numba'),XDG_CACHE_HOME=str(ROOT/'cache')) +if not (ROOT/'production-before.json').exists():write(ROOT/'production-before.json',snapshot()) +archive=ROOT/'cpython-3.11.18.tar.gz' +if not (ROOT/'python/bin/python3.11').exists(): + download(PYTHON_URL,archive,PYTHON_SHA) + with tarfile.open(archive) as tar:tar.extractall(ROOT,filter='data') +python=ROOT/'venv/bin/python' +if not python.exists():run([ROOT/'python/bin/python3.11','-m','venv',ROOT/'venv']) +for name,(url,rev) in REPOSITORIES.items(): + path=ROOT/name + if not path.exists():run(['git','clone','--quiet',url,path]) + run(['git','-C',path,'checkout','--quiet','--detach',rev]) + assert subprocess.check_output(['git','-C',str(path),'rev-parse','HEAD'],text=True).strip()==rev +run([python,'-m','pip','install','--quiet','--no-cache-dir','--index-url','https://download.pytorch.org/whl/cpu', + 'torch==2.6.0','torchaudio==2.6.0']) +deps=tomllib.loads((ROOT/'chatterbox/pyproject.toml').read_text())['project']['dependencies'] +deps=[d for d in deps if not d.startswith(('torch','resemble-perth','numpy'))] +deps += ['numpy==1.26.4','peft==0.18.0','s3tokenizer==0.3.0','psutil==7.2.2','PyYAML==6.0.3'] +run([python,'-m','pip','install','--quiet','--no-cache-dir',*deps,ROOT/'perth']) +run([python,'-m','pip','install','--quiet','--no-cache-dir','--no-deps',ROOT/'chatterbox',ROOT/'adapter-source']) +manifest=[] +for folder,(mid,rev,files) in MODELS.items(): + target=ROOT/folder;target.mkdir(exist_ok=True,mode=0o700) + with urllib.request.urlopen(f'https://huggingface.co/api/models/{mid}/revision/{rev}?blobs=true',timeout=30) as r:metadata=json.load(r) + assert metadata['sha']==rev + names={x['rfilename']:x for x in metadata['siblings']} + for name in files: + expected=names[name].get('lfs',{}).get('sha256') + path=target/name + download(f'https://huggingface.co/{mid}/resolve/{rev}/{name}',path,expected) + row=dict(folder=folder,file=name,bytes=path.stat().st_size,sha256=hashlib.file_digest(path.open('rb'),'sha256').hexdigest(),publisher_lfs_sha256=expected) + manifest.append(row);print(json.dumps(row),flush=True) +(ROOT/'requirements-resolved.txt').write_text(subprocess.check_output([str(python),'-m','pip','freeze'],text=True)) +write(ROOT/'manifest.json',dict(python_url=PYTHON_URL,python_sha256=PYTHON_SHA,repositories=REPOSITORIES,models=MODELS,files=manifest, + total_model_bytes=sum(x['bytes'] for x in manifest),production_preservation=preservation())) +run([python,'-m','pip','check']) +run([python,'-c','import torch,torchaudio; from chatterbox.tts_turbo import ChatterboxTurboTTS; from nano_de.model import load_adapter_engine; print("CPU_TORCH",torch.__version__,"CUDA_BUILD",torch.version.cuda); assert torch.version.cuda is None']) +print('PREPARED',flush=True) diff --git a/docs/experiments/chatterbox-nano-de-cpu-2026-10-27/requirements-resolved.txt b/docs/experiments/chatterbox-nano-de-cpu-2026-10-27/requirements-resolved.txt new file mode 100644 index 0000000..ed96be7 --- /dev/null +++ b/docs/experiments/chatterbox-nano-de-cpu-2026-10-27/requirements-resolved.txt @@ -0,0 +1,114 @@ +accelerate==1.15.0 +aiofiles==24.1.0 +annotated-doc==0.0.5 +annotated-types==0.8.0 +anyio==4.15.1 +audioread==3.1.0 +brotli==1.2.1 +catalogue==2.0.10 +certifi==2026.10.23 +cffi==2.1.1 +cfgv==3.5.0 +charset-normalizer==3.5.2 +chatterbox-nano-de @ file:///data/athena-chatterbox-nano-de-20261027/adapter-source +chatterbox-tts @ file:///data/athena-chatterbox-nano-de-20261027/chatterbox +click==8.5.0 +cloudpickle==3.1.2 +conformer==0.3.2 +decorator==5.3.1 +Deprecated==1.3.1 +diffusers==0.29.0 +distlib==0.4.4 +einops==0.8.2 +fastapi==0.162.0 +ffmpy==1.0.0 +filelock==3.32.3 +fsspec==2026.7.0 +gradio==6.8.0 +gradio_client==2.2.0 +groovy==0.1.2 +h11==0.16.0 +hf-xet==1.7.0 +httpcore==1.0.9 +httpx==0.28.1 +huggingface_hub==1.33.0 +identify==2.6.20 +idna==3.20 +importlib_metadata==10.1.0 +jaconv==0.5.0 +Jinja2==3.1.6 +joblib==1.6.0 +lazy-loader==0.6 +librosa==0.11.0 +llvmlite==0.50.0 +markdown-it-py==4.2.0 +MarkupSafe==3.0.3 +mdurl==0.1.2 +ml_dtypes==0.5.4 +mpmath==1.3.0 +msgpack==1.2.4 +narwhals==2.28.0 +networkx==3.6.1 +nodeenv==1.11.0 +numba==0.68.0 +numpy==1.26.4 +omegaconf==2.4.0 +onnx==1.23.2 +opentelemetry-api==1.45.1 +orjson==3.13.0 +packaging==26.3 +pandas==3.0.6 +peft==0.18.0 +pillow==12.3.0 +platformdirs==4.13.6 +pooch==1.9.0 +pre_commit==4.7.0 +protobuf==7.36.2 +psutil==7.2.2 +pycparser==3.12 +pydantic==2.14.1 +pydantic_core==2.50.1 +pydub==0.25.1 +Pygments==2.21.0 +pykakasi==2.3.0 +pyloudnorm==0.2.0 +python-dateutil==3.0.0 +python-discovery==1.6.5 +python-multipart==0.0.32 +pytz==2026.5 +PyYAML==6.0.3 +regex==2026.9.29 +requests==2.34.2 +resemble-perth @ file:///data/athena-chatterbox-nano-de-20261027/perth +rich==15.0.0 +s3tokenizer==0.3.0 +safehttpx==0.1.7 +safetensors==0.5.3 +scikit-learn==1.9.1 +scipy==1.17.1 +semantic-version==2.10.0 +shellingham==1.5.4 +six==1.17.0 +soundfile==0.14.0 +soxr==1.1.0 +spacy_pkuseg==1.0.2 +srsly==2.5.5 +starlette==0.52.1 +sympy==1.13.1 +threadpoolctl==3.7.0 +tokenizers==0.22.2 +tomlkit==0.13.3 +torch==2.6.0+cpu +torchaudio==2.6.0+cpu +tqdm==4.70.1 +transformers==5.2.0 +typer==0.27.3 +typer-slim==0.24.0 +typing-inspection==0.4.4 +typing_extensions==4.16.0 +tzdata==2026.5 +urllib3==2.8.0 +uvicorn==0.54.0 +virtualenv==21.15.0 +wrapt==2.5.1 +zipp==4.1.2 diff --git a/docs/experiments/chatterbox-nano-de-cpu-2026-10-27/score.py b/docs/experiments/chatterbox-nano-de-cpu-2026-10-27/score.py new file mode 100644 index 0000000..b9aa187 --- /dev/null +++ b/docs/experiments/chatterbox-nano-de-cpu-2026-10-27/score.py @@ -0,0 +1,36 @@ +"""Verify actual synthetic speech with existing native local CPU ASR.""" +from pathlib import Path +import json +import re +import subprocess +import time +from support import ROOT,write + +BASE=Path('/opt/athena-deck-dev/runtime/state/parakeet-runtime/v0.6.1') +CLI=BASE/'runtime/parakeet-v0.6.1-bin-linux-cpu-x64/parakeet-cli' + +def edits(a,b): + prev=list(range(len(b)+1)) + for i,x in enumerate(a,1): + row=[i] + for j,y in enumerate(b,1):row.append(min(row[-1]+1,prev[j]+1,prev[j-1]+(x!=y))) + prev=row + return prev[-1] + +rows=[] +for name in ['speed','quality']: + source=ROOT/(name+'.json') + if not source.exists():continue + data=json.loads(source.read_text()) + assert data['phase'] in ['complete','speed_rejected'],'Do not score a failed/incomplete run' + for run in data['runs']: + started=time.monotonic() + proc=subprocess.run([str(CLI),'transcribe','--model',str(BASE/'redux-packed.gguf'), + '--input',str(ROOT/'outputs'/run['file']),'--lang','de','--threads','2','--json'], + capture_output=True,text=True,timeout=90) + row=dict(file=run['file'],case=run['case'],label=run['label'],exit_code=proc.returncode,seconds=time.monotonic()-started) + if proc.returncode==0: + actual=json.loads(proc.stdout)['text'];a=re.findall(r'\w+',run['text'].casefold());b=re.findall(r'\w+',actual.casefold()) + row.update(expected=run['text'],recognized=actual,reference_words=len(a),word_edits=edits(a,b),exact_word_match=a==b) + else:row['error']=proc.stderr[-1000:] + rows.append(row);write(ROOT/'transcriptions.json',rows);print(json.dumps(row,ensure_ascii=False),flush=True) diff --git a/docs/experiments/chatterbox-nano-de-cpu-2026-10-27/speed.json b/docs/experiments/chatterbox-nano-de-cpu-2026-10-27/speed.json new file mode 100644 index 0000000..54d62f9 --- /dev/null +++ b/docs/experiments/chatterbox-nano-de-cpu-2026-10-27/speed.json @@ -0,0 +1,78 @@ +{ + "phase": "speed_rejected", + "runs": [ + { + "label": "B", + "case": "story", + "text": "Wenn du magst, erzähle ich dir eine kurze Geschichte. Anna öffnete das Fenster und hörte drei Vögel singen. Auf dem Tisch lagen sieben Bücher und eine rote Tasse. Zum Schluss sagte sie: Das hat wunderbar funktioniert.", + "repetition": 1, + "file": "chatterbox-nano-de-speed-story-B-1.wav", + "sample_rate": 24000, + "generation_seconds": 14.815006536999135, + "duration_seconds": 16.98, + "rtf": 0.8724974403415274, + "peak": 0.5794569253921509, + "clipped_fraction": 0.0, + "peak_rss_kib": 4228036, + "available_gib": 4.187732696533203, + "sha256": "2d36233a80e5bcfef84b5c5267fa09fccd16d3a1cbaea4735dd1139d20d09975" + } + ], + "references": [ + { + "label": "B", + "seconds": 10.406259766008588, + "sha256": "17429deffc2ca5c66518e3152f0a427ba133b6005fbc7cb9b00c883f2e488c55" + } + ], + "protocol": { + "cpu_threads": 4, + "interop_threads": 1, + "seed": 42, + "device": "cpu", + "cpu_affinity": [ + 2, + 3, + 4, + 5, + 8, + 9, + 10, + 11 + ], + "precision": "fp32", + "adapter": "German v0.1 V2, merged in RAM", + "gate_max_rtf": 0.5, + "speed_reference": "B", + "s3gen_meanflow": true, + "temperature": 0.8, + "top_p": 0.95, + "top_k": 1000, + "repetition_penalty": 1.2, + "perth_watermark": "upstream default", + "cpu_quota_percent": 400, + "memory_max_mib": 5500, + "concurrent_llm_load_added": false + }, + "initial_available_gib": 6.746311187744141, + "torch": "2.6.0+cpu", + "load_seconds": 6.9673835470021, + "t3_before_merge": { + "total": 181218467, + "trainable": 0, + "trainable_percent": 0.0 + }, + "merge_seconds": 0.3666530250047799, + "parameters": { + "t3": 178859171, + "s3gen": 266030919, + "ve": 1423618 + }, + "gate_passed": false, + "weighted_rtf": 0.8724974403415274, + "production_preservation": { + "files_equal": true, + "pids_equal": true, + "deck_start_equal": true + } +} \ No newline at end of file diff --git a/docs/experiments/chatterbox-nano-de-cpu-2026-10-27/support.py b/docs/experiments/chatterbox-nano-de-cpu-2026-10-27/support.py new file mode 100644 index 0000000..02cd882 --- /dev/null +++ b/docs/experiments/chatterbox-nano-de-cpu-2026-10-27/support.py @@ -0,0 +1,37 @@ +"""Small stdlib-only helpers; no production settings or credentials are read out.""" +from pathlib import Path +import hashlib +import json +import subprocess + +ROOT=Path('/data/athena-chatterbox-nano-de-20261027') +REFS=Path('/data/athena-articulino-references-20261027/references') +STATE=Path('/opt/athena-deck-dev/runtime/state') +FILES=[STATE/n for n in ('profiles.json','endpoint.json','audio-policy.json','cpu-partition.json')] +FILES += [STATE/'speech-voices/Anna/reference.wav',Path('/opt/athena-deck-dev/source/qwen_native_worker.py')] +CASES=[dict(id='story',text='Wenn du magst, erzähle ich dir eine kurze Geschichte. Anna öffnete das Fenster und hörte drei Vögel singen. Auf dem Tisch lagen sieben Bücher und eine rote Tasse. Zum Schluss sagte sie: Das hat wunderbar funktioniert.'), + dict(id='technical',text='Home Assistant läuft in Docker auf Unraid. Die SSD hat 47 Grad Celsius. Das Logfile enthält keinen Fehler. Die Datei ist 512 MiB groß und die Verbindung überträgt 100 Mbit pro Sekunde. Um 18:30 CEST startet der nächste Scan.')] + +def write(path,data): + tmp=path.with_suffix('.tmp');tmp.write_text(json.dumps(data,indent=2,ensure_ascii=False));tmp.replace(path) + +def available(): + return next(int(s.split()[1])*1024 for s in Path('/proc/meminfo').read_text().splitlines() if s.startswith('MemAvailable:')) + +def snapshot(): + pids=dict(strata=[],articulino=[],qwen_tts=[]) + for p in Path('/proc').iterdir(): + if not p.name.isdigit():continue + try:args=(p/'cmdline').read_bytes().split(b'\0') + except OSError:continue + if args and args[0].endswith(b'/engine/strata'):pids['strata'].append(int(p.name)) + for key,name in [('articulino','articulino_worker.py'),('qwen_tts','qwen_native_worker.py')]: + if any(a.endswith(('/'+name).encode()) for a in args):pids[key].append(int(p.name)) + return dict(hashes={str(p):hashlib.file_digest(p.open('rb'),'sha256').hexdigest() for p in FILES},pids=pids, + deck_started=subprocess.check_output(['docker','inspect','--format','{{.State.StartedAt}}','athena-deck-dev'],text=True).strip()) + +def preservation(): + before=json.loads((ROOT/'production-before.json').read_text());after=snapshot() + write(ROOT/'production-after.json',after) + return dict(files_equal=before['hashes']==after['hashes'],pids_equal=before['pids']==after['pids'], + deck_start_equal=before['deck_started']==after['deck_started']) diff --git a/docs/experiments/chatterbox-nano-de-cpu-2026-10-27/transcriptions.json b/docs/experiments/chatterbox-nano-de-cpu-2026-10-27/transcriptions.json new file mode 100644 index 0000000..7ce2ea3 --- /dev/null +++ b/docs/experiments/chatterbox-nano-de-cpu-2026-10-27/transcriptions.json @@ -0,0 +1,14 @@ +[ + { + "file": "chatterbox-nano-de-speed-story-B-1.wav", + "case": "story", + "label": "B", + "exit_code": 0, + "seconds": 1.3278299039957346, + "expected": "Wenn du magst, erzähle ich dir eine kurze Geschichte. Anna öffnete das Fenster und hörte drei Vögel singen. Auf dem Tisch lagen sieben Bücher und eine rote Tasse. Zum Schluss sagte sie: Das hat wunderbar funktioniert.", + "recognized": "Wenn du magst, erzähle ich dir eine kurze Geschichte. Anna öffnete das Fenster und hörte drei Vögel singen. Auf dem Tisch lagen sieben Bücher und eine hohe Tasse. Zum Schluss sagte sie, das hat wunderbar funktioniert.", + "reference_words": 36, + "word_edits": 1, + "exact_word_match": false + } +] \ No newline at end of file diff --git a/docs/experiments/tts-candidate-shortlist-2026-10-27.md b/docs/experiments/tts-candidate-shortlist-2026-10-27.md index 5a30203..c0bb90e 100644 --- a/docs/experiments/tts-candidate-shortlist-2026-10-27.md +++ b/docs/experiments/tts-candidate-shortlist-2026-10-27.md @@ -16,6 +16,7 @@ record the verdict and clean up its own test data when requested. | --- | --- | --- | | Sopro V2 Turbo, FP32 | **Serious candidate; retain — preferred listening sample: technical B** | About 2.42× realtime on Athena CPU, four threads. All three story samples matched all words in local STT. Raw technical text still has ASR discrepancies around Unraid, MiB, CEST and time wording. Michael hears technical B as the closest Anna approximation so far, better than Articulino but not perfect. Reference B is 05:25.14–05:33.00 of the supplied recording; fixed recipe and results: [Sopro experiment](sopro-cpu-2026-10-27/README.md). No activation/integration authorized; continue evaluating other models. | | Qwen3-TTS 0.6B Q4 / Q8 codec | Retained comparison reference | Same three clips/text gave about 15 s in 14.111–14.645 s. This passage was complete in STT; previous intermittent noise failures remain unresolved. This row makes no claim about which profile is currently published. | +| Chatterbox Nano + German community LoRA, FP32 | **Actual Athena speed probe misses reserve target** | Explicitly tested after Michael's follow-up: Anna B, four CPU threads, adapter merged in RAM, 16.98 s audio in 14.815 s (RTF 0.8725, 1.146× realtime), first synthesis. No warm repeat or quality matrix after missing the 2× gate. STT: one discrepancy, “hohe” instead of “rote Tasse”. No general claim about untested precision/runtime alternatives. Active TTS unchanged; Sopro technical B remains the reference. [Actual trial](chatterbox-nano-de-cpu-2026-10-27/README.md). | | Audio8 TTS Preview 0.1B ONNX INT8 | **Rejected and deleted** | CPU speed fails; Michael also reports a Chinese-sounding accent. All isolated weights, venv, derived voices, pilot data and audio deleted remotely and locally: about 1.49 GiB on Athena plus 8.3 MiB local. Small records remain in `audio8-cpu-2026-10-27/`. Qwen and Articulino preserved. | | Pocket TTS German | Already tested, not a newly discovered alternative | Existing 17 October Anna CPU runs had RTF 0.453/0.462. Do not present it as untested or claim the newly advertised tiny English models support German. A different German checkpoint/recipe would need a specific reason to retest. | | MOSS-TTS-Nano / NeuTTS-Nano German Q8 | Rejected; test weights removed | Michael rejected pronunciation/naturalness. Do not silently reinstall or rank them as acceptable based on ASR. | @@ -33,8 +34,9 @@ This is **documentation only**: do not delete or disable Articulino, change the published TTS profile, install an integration, alter Hermes/Mac clients or start another experiment based solely on this shortlist update. Existing production configuration and all retained models/files stay as they are. -Michael wants further model comparisons before choosing a replacement; no next -model has been selected or test started by this update. +Michael wants further model comparisons before choosing a replacement. The +shortlist-only preference update itself started no test; his subsequent explicit +instruction authorized the separately recorded Chatterbox Nano German CPU trial. ## Remaining leads checked after cleanup @@ -86,9 +88,11 @@ an installed Hermes integration or verified native-client playback. - [Phonon German model and license](https://huggingface.co/gradium/phonon-40m-de) - [Phonon runtime: provider-based custom voice creation](https://github.com/gradium-ai/xn-ptts#voices) - [Sopro V2 Turbo publisher model card](https://huggingface.co/samuel-vitorino/sopro-v2-turbo) +- [Chatterbox Nano German community adapter](https://huggingface.co/Pseudonaut/chatterbox-nano-de-lora) - Local measurements: `articulino-reference-comparison-2026-10-27/`, `qwen-reference-comparison-2026-10-27/`, `small-tts-2026-10-17/`, - `mini-tts-cpu-2026-10-26/` and `sopro-cpu-2026-10-27/`. + `mini-tts-cpu-2026-10-26/`, `sopro-cpu-2026-10-27/` and + `chatterbox-nano-de-cpu-2026-10-27/`. The initial shortlist discussion added documentation only. Michael later authorized the isolated Audio8 experiment: its own weights and CPU venv were