Commit graph

6 commits

Author SHA1 Message Date
03877588e1 Fix two podcast failures: dead TTS server after reboot + CUDA OOM
Podcast generation failed twice at the audio stage, for two unrelated reasons
that look similar from the UI but need opposite fixes.

1) TTS/STT ran as nohup background processes and silently did not survive a
   reboot. Podcasts then failed with "Failed to generate speech: All connection
   attempts failed" (httpx.ConnectError) even though outline and transcript had
   generated fine.

   Both now run as systemd user units. The unit files are versioned in
   services/systemd/ (using %h, not a hardcoded home) and installed by
   scripts/start_services.sh, which also enables linger so they start on boot
   without a login session. They pin GPU 2 by UUID, not by index: CUDA orders
   devices "fastest first", so index 2 can resolve to the T600.

2) GPU 2 is shared by three processes (TTS, STT and the separate chatterbox-tts
   MCP service on :9999), leaving ~12 GB of headroom. podcast_creator sends
   TTS_BATCH_SIZE (default 5) clips concurrently, and since /audio/speech is a
   sync FastAPI handler, they generated genuinely in parallel on one shared
   model. Activation memory multiplied, the TTS process hit 16.7 GB and threw
   torch.OutOfMemoryError, surfacing as "HTTP 500" from the endpoint.

   tts_server.py now serializes generation behind a lock (GPU-bound work, so
   parallelism buys no throughput — it only multiplies peak VRAM) and frees the
   cache afterwards. TTS_BATCH_SIZE=1 keeps the client from queuing requests in
   that lock and running into esperanto's 300s TTS timeout; ESPERANTO_TTS_TIMEOUT
   is raised to 600s as headroom.

Verified: 5 concurrent /audio/speech requests all return 200 with GPU 2 peaking
at ~11.5 GB (was 16.7 GB for the TTS process alone), and the previously failed
episode now completes end to end — 38/38 batches, 10:56 min of audio, zero OOM.

Docs record both failure signatures side by side, since ConnectError (server
dead) and HTTP 500 (server alive, out of VRAM) have very different remedies.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-11 13:02:32 +02:00
054f867a8a Fix podcasts generating in English + failing with invalid JSON
Two root causes, both fixed in the bind-mounted podcast prompt templates
(prompts/podcast/*.jinja):

1. Language: the episode profile's `language` field IS passed to both
   podcast_creator templates as {{ language }}, but the stock templates never
   reference it — so podcasts came out English (driven only by the English
   stock briefings/speakers), then read aloud by the German-locked Chatterbox
   TTS = "English with a German accent". Added a CRITICAL LANGUAGE REQUIREMENT
   block keyed on {{ language }} to both templates; now `language: "de"`
   actually forces German. Verified end-to-end: a full run produced a 44-line
   all-German transcript + audio.

2. Invalid json output failures: qwen3.5:27b is a thinking model; on long
   segments the <think> block ate the response-token budget and truncated the
   JSON. Prepended /no_think to both templates (~3x faster, valid JSON).

Templates are bind-mounted read-only via docker-compose (directory mount, so
edits survive a container restart without inode-staleness). Bundled briefings
and speaker backstories were also translated to German to reduce drift.

Known limitation documented: feeding an entire book (~70k tokens) as podcast
content makes each of the 6 LLM calls take ~3.5 min and is unreliable; use a
shorter source or summary. Confirmed working with concise content.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-11 02:30:05 +02:00
e2fb113213 Add dedicated API usage section (curl + Python) to BEDIENUNGSANLEITUNG.md
Consolidates and extends the curl patterns already scattered across other
sections into one reference point, notes the API requires no auth (loopback-
only), and points to the interactive /docs Swagger UI as the best starting
point for exploring endpoints not yet covered here.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-11 01:02:17 +02:00
83fd13fb98 Close two documentation gaps found during an accuracy audit
- README's "Bekannte Stolpersteine" quick-reference list was missing the
  podcast-language pitfall (already documented in CLAUDE.md/BEDIENUNGSANLEITUNG.md).
- The search/ask feature was only mentioned in passing; added a full section
  with the working curl examples and the SSE response shape, since it's the
  fastest/most accurate way to query long documents.

Everything else cross-checked against live state (credential num_ctx,
default models, running services, episode profile languages) and matched.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-11 00:59:06 +02:00
81b2e90326 Fix podcasts defaulting to English: set language=de on default episode profiles
The three bundled episode profiles (business_analysis, solo_expert,
tech_discussion) shipped with language=null, which podcast_creator treats as
"unspecified" and defaults to English for outline/transcript generation
regardless of source language. Set language="de" on all three.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-11 00:37:09 +02:00
7838863dbf Add README.md, BEDIENUNGSANLEITUNG.md, and setup/start scripts
README.md gives the precise, reproducible install path (tested the two
scripts against the live instance - both idempotent, correctly detect
already-registered credentials/models). BEDIENUNGSANLEITUNG.md covers daily
usage: notebooks/sources, the three chat context modes (and why "nur
Erkenntnisse" needs a transformation run first), podcasts, voice cloning,
and troubleshooting for the issues actually hit during setup (num_ctx
truncation, embedding GPU contention, ufw).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-10 23:50:58 +02:00