Multi-model registry and adapter layer for realtime-0.5b, tts-1.5b, tts-7b#7
Open
Multi-model registry and adapter layer for realtime-0.5b, tts-1.5b, tts-7b#7
Conversation
…l scripts Co-authored-by: groxaxo <76023196+groxaxo@users.noreply.github.com>
…entation Co-authored-by: groxaxo <76023196+groxaxo@users.noreply.github.com>
…or message clarity Co-authored-by: groxaxo <76023196+groxaxo@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add multi-model compatibility for existing repo
Multi-model registry and adapter layer for realtime-0.5b, tts-1.5b, tts-7b
Mar 13, 2026
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.
Refactors the hardcoded single-model runner into a multi-backend TTS system. The
modelfield in OpenAI-compatible requests is now resolved via a registry instead of ignored. Longform models (1.5B/7B) are registered with API plumbing but fail gracefully with 501 until a real backend is wired in. Existing realtime-0.5b behavior is fully preserved.New
runner/packagemodel_registry.py—ModelProfiledataclass, 3 model profiles, alias map (tts-1→realtime-0.5b, etc.),resolve_model_key(),get_model_profile()adapters/base.py—EngineAdapterABC withis_available(),capabilities(),synthesize(),stream(),health()adapters/realtime_demo.py—RealtimeDemoAdapterwrapping existing subprocess demo. Extracteddetect_device(),apply_overrides(),build_realtime_demo_cmd()fromrun_realtime_demo.pyadapters/longform_native.py—LongformNativeAdapterscaffold.is_available()returnsFalse;synthesize()raisesBackendUnavailableError. No fake streamingadapter_factory.py—make_adapter(model_key)dispatches by family/loader_modetypes.py—SpeechRequest/SpeakerTurnpydantic models with per-family validationerrors.py—UnknownModelError,CapabilityError,BackendUnavailableError,InvalidRequestForModelErrorModified files
overrides/app.py—/v1/audio/speechresolves model, returns 400 (invalid combo), 404 (unknown model), 501 (missing backend)./streamrejects non-realtime models./configand/healthexpose model registry infoscripts/download_model.py— Accepts--modelwith registry resolution. Default unchangedscripts/run_realtime_demo.py— Now a thin shim delegating torunner.adapters.realtime_demoscripts/run_server.py— New generic launcher:--model realtime-0.5b|tts-1.5b|tts-7bBackward compatibility
All existing entry points work unchanged:
Remaining TODOs
longform_native.py:_load_backend()— replace placeholderImportErrorwith real backend importlongform_native.py:synthesize()— wire actual inferencerun_server.py— add longform serving pathTests
46 new tests covering registry, alias resolution, per-family validation, adapter factory, graceful degradation, and error classes. All run without GPU/model weights.
📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.