aboutsummaryrefslogtreecommitdiff
path: root/app/backends/sglomni/constants.py
diff options
context:
space:
mode:
authorhistoria <historiavg@proton.me>2026-09-02 01:26:09 -0400
committerhistoria <historiavg@proton.me>2026-09-02 01:26:09 -0400
commit8579517a35ef1865fc9b428899d73d52dcb27a14 (patch)
treedba52f8d99cfe4014e0b787367de99f238e5a0db /app/backends/sglomni/constants.py
parent391f50da7a085bec75155c0eb9b47910266058cc (diff)
downloadtts-audiobook-generator-8579517a35ef1865fc9b428899d73d52dcb27a14.tar.gz
feat: sglang backend support
Diffstat (limited to 'app/backends/sglomni/constants.py')
-rw-r--r--app/backends/sglomni/constants.py37
1 files changed, 37 insertions, 0 deletions
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"