Repository navigation
drama voices: admin keys add and delete catalog voices under --manage-voices; inline voices under --request-voices - #3140
Merged
Merged
Conversation
ashhart
force-pushed
the
lead/tts-voices
branch
7 times, most recently
from
November 18, 2026 17:36
0b75504 to
156536e
Compare
This was referenced Nov 19, 2026
…-voices; inline voices under --request-voices The served catalog moves into a store (drama_voice_store.zig): a request copies its voice's references when it arrives, so a change frees the old catalog at once and never reaches a request already running. With --manage-voices, POST /v1/voices adds or replaces a voice from an attested voice file's fields or from a base64 WAV with its transcript, and DELETE /v1/voices/NAME deletes one (never the configured default voice); both need the admin scope and write or remove DIR/NAME.json under --voices DIR through a temporary renamed into place. A WAV is checked for attestation and transcript first, then encoded on the speech host's thread by an idle lane's codec (the engine's new optional encode_voice hook; a file the codec refuses keeps the engine open, a device error closes it as advance does). With --request-voices, a speech request's voice may be an attested inline voice object, checked as a catalog file is. Both flags are off by default: every reply, refusal and the default voice are as before. Raw ref_audio, ref_text and references stay refused.
speech_voice_http_test.zig drives the server through speech_stream_test.zig's socket-pair harness, which root.zig already leaves out on Windows; importing it unguarded failed zig-windows (std.c.socketpair is void there).
ashhart
force-pushed
the
lead/tts-voices
branch
from
November 19, 2026 05:43
156536e to
0aa13e0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Drama voices could only come from
--voices DIRat startup. Two opt-in flags, both off by default:--manage-voices: admin keys add voices withPOST /v1/voices(an attested voice file, or a WAV with its transcript, encoded by the loaded codec) and delete them withDELETE /v1/voices/NAME, written to--voices DIR. Without an API key every client counts as admin and these routes write and delete files, so the docs say to set a key.--request-voices:voicemay be an attested inline object.A request copies its voice from the catalog when it arrives (at most about 100 KB, under one lock), so deleting a voice never frees one a running request uses. A WAV upload checks attestation and transcript before any encoding; the encode runs on an idle lane while busy lanes wait, and a device error closes the speech engine, as it already does mid-generation. With both flags off, replies equal main's; those replies were recorded on main and are pinned in a test.
Tests:
test-server-cpu1344 pass; drama host 41; Metal native host 11 (+2 skip); prefill 2; a fake-host test for the upload hand-off (idle lane encodes, busy lanes wait, a bad file keeps the engine open, closing answers a waiting upload).engine_api.zigandserver.zigstay at 600 lines.Device check pending (an M5 Mac and a GB10, fixed seed): a WAV uploaded with
POST /v1/voicesgives codes equal todrama3-generate --codec … --ref-audio X.wav --encode; the same voice loaded at startup, added at runtime and sent inline gives the same WAV sha256, and the default voice matches main; a request running while its voice is deleted finishes equal to its solo reply; 2-4 concurrent streams plus an upload each equal their solo replies. Conflicts with the speed and formats PRs (unions);server.zig's line count is re-checked when the second lands.