From 8579517a35ef1865fc9b428899d73d52dcb27a14 Mon Sep 17 00:00:00 2001 From: historia Date: Wed, 2 Sep 2026 01:26:09 -0400 Subject: feat: sglang backend support --- app/backends/sglomni/constants.py | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 app/backends/sglomni/constants.py (limited to 'app/backends/sglomni/constants.py') diff --git a/app/backends/sglomni/constants.py b/app/backends/sglomni/constants.py new file mode 100644 index 0000000..97a4f3d --- /dev/null +++ b/app/backends/sglomni/constants.py @@ -0,0 +1,37 @@ +"""Shared constants for the sglang-omni backend.""" + +from pathlib import Path + +# The pip package providing the `sgl-omni` server CLI. Installed unpinned +# (like qwen-tts and faster-qwen3-tts) so the update action can move with +# upstream releases; the stack this code was verified against is 0.1.4. +SGLOMNI_PIP_PKG = "sglang-omni" +# uv is provisioned into the app env only when a Python the sglang-omni +# stack accepts (>=3.10,<3.13) is not already available. +UV_PIP_PKG = "uv" + +# The dedicated venv is backends.envs.SGLOMNI_ENV_DIR (imported from there +# by the modules that need it) — its interpreter may differ from the +# launching Python's, see pythonenv.prepare_env. + +# The vendored copies of upstream examples/configs/*.yaml (the `sgl-omni +# serve --config` argument). Two catalog models run without one (Higgs, +# ZONOS2) and are launched from --model-path alone. +CONFIGS_DIR = Path(__file__).resolve().parent / "configs" + +# The managed server's port when the configured URL names none. +DEFAULT_PORT = 8100 + +# The ServerSpec name (pid/log files: app/logs/sglomni-server.*). +SERVER_NAME = "sglomni" + +# The managed server boots a multi-stage pipeline (preprocessing, TTS +# generation, vocoder) and may pull companion weights on first start, so +# its spec overrides the shared 600 s start timeout. +SERVER_START_TIMEOUT = 1200 + +# Python interpreters the sglang-omni stack accepts (requires-python +# ">=3.10,<3.13"), newest first — the search order for both the +# compatible-interpreter scan and the uv fallback. +PYTHON_VERSIONS = ((3, 12), (3, 11), (3, 10)) +PYTHON_SPEC = "3.12" -- cgit v1.2.3