mcspeak/Makefile
Ryan Malloy ec4e1b6093 Fix stream-restore mute + entry tone overlap, make Orpheus opt-in
Stream-restore mute: pw-play streams were being silently restored to
0% volume by PulseAudio's stream-restore module matching the music
role key, producing audible-but-clean-exit playback. audio.py now
bumps each new pw-play sink-input to 100% as a background task; the
new value re-stamps stream-restore on stream end.

Entry tone overlap: when speak() arrived during prior playback, its
entry tone played immediately from the handler and overlapped the
ongoing audio. queue.is_idle() now gates this — tone plays now when
idle (preserves latency-hiding intent), else defers to the consumer
via _WorkItem.entry_tone, which plays it right before the item's
audio. Chunked path defers only on chunk 0.

Docker: llama-server gated behind a `with-orpheus` compose profile;
mcspeak.depends_on uses required:false. `make up` defaults to
kokoro-only with no GPU dependency; `make up-with-orpheus` runs the
full stack. Rename dootie-internal network → mcspeak-internal
(auto-created per-stack via internal:true). Add 127.0.0.1:8371 port
mapping for local MCP clients.

README: fix claude mcp add command (was stdio, must be --transport
http); document kokoro-only default and the with-orpheus path; add
Kokoro model download step. .env.example added so `cp .env.example
.env` matches the documented setup.
2026-05-28 14:14:38 -06:00

43 lines
1.2 KiB
Makefile

# .env is optional in kokoro-only mode (only needed for ORPHEUS_GGUF_PATH).
# The leading dash makes Make silently tolerate a missing file.
-include .env
export
.PHONY: build up up-with-orpheus down logs restart status bench
build:
docker compose build
up: build
docker compose up -d
@sleep 2
docker compose logs --tail 20
up-with-orpheus: build
docker compose --profile with-orpheus up -d
@sleep 2
docker compose logs --tail 20
down:
docker compose down
logs:
docker compose logs -f
restart:
docker compose restart
@sleep 2
docker compose logs --tail 20
status:
@docker compose ps
@echo "---"
@curl -s http://localhost:8371/mcp 2>/dev/null | head -5 || echo "Server not responding"
bench:
@echo "Benchmarking llama-server throughput..."
@docker exec orpheus-llama-server curl -s "http://127.0.0.1:8081/v1/completions" \
-H "Content-Type: application/json" \
-d '{"prompt":"<|audio|>tara: Hello, how are you doing today?<|eot_id|>","max_tokens":500,"stream":false}' | \
python3 -c "import sys,json; d=json.load(sys.stdin); u=d['usage']; t=d.get('timings',{}); print(f\"{u['completion_tokens']} tokens, {t.get('predicted_per_second',0):.1f} tok/s\")"