[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"

[project]
name = "sglang-omni"
version = "0.1.0"
description = "Multi-stage pipeline framework for omni models"
readme = "README.md"
license = {text = "Apache-2.0"}
requires-python = ">=3.10"
dependencies = [
    # Core dependencies
    "pyzmq>=25.0.0",          # ZMQ messaging for control plane
    "msgpack>=1.0.0",         # Message serialization
    "numpy>=1.24.0",          # Array operations
    "pydantic>=2.0.0",        # Data validation and serialization
    "PyYAML>=6.0",            # YAML config parsing
    "pybase64>=1.4.0",        # Fast base64 decoding for inline media payloads
    "torch==2.11.0",          # PyTorch for tensor operations
    "torchvision==0.26.0",    # torchvision for vision processor, pinned version based on torch 2.11.0
    "accelerate>=0.27.0",     # init_empty_weights for meta initialization
    "transformers==5.6.0",   # HF models/tokenizers
    "safetensors>=0.4.3",     # Direct weight loading
    "pillow>=10.0.0",         # Required by AutoImageProcessor
    "huggingface-hub>=0.36.0",# HF model downloads
    "datasets>=2.14.0",       # Arrow-based SeedTTS dataset loading
    "fastapi>=0.110.0",       # OpenAI-compatible API adapter
    "uvicorn>=0.23.0",        # ASGI server for FastAPI
    "sglang==0.5.12.post1",
    "flash-attn-4>=4.0.0b9,<4.0.0b16",  # Avoid cutlass-dsl>=4.5.2 conflict
    "kernels>=0.14.0,<0.15",  # Match Transformers 5.6 / SGLang 0.5.12.post1 stack (ships kernels 0.14.1)
    "nixl-cu13>=1.1.0",  # CUDA 13 relay wheel; the generic nixl/-cu12 wheel breaks on cu130
    "mooncake-transfer-engine-cuda13>=0.3.10",  # CUDA 13 relay wheel; generic mooncake-transfer-engine pulls cu12 and breaks `import mooncake` on cu130
    "logger",
    "httpx",
    "xxhash>=3.0.0",
    "av>=16.1.0",
    "qwen-vl-utils==0.0.11",
    "numba==0.63.1",
    "librosa>=0.11.0",
    "pandas",
    "tabulate",
    "typer>=0.9.0",
    "openai==2.6.1",
    "openai-harmony==0.0.4",
    "soundfile>=0.12.0",
    "mistral_common[audio]>=1.11.0",
    # /v1/realtime — server-side VAD
    "silero-vad>=5.1",
    "onnxruntime>=1.17",
    "websockets>=12.0",       # FastAPI WebSocket library + example clients
    # Testing
    "pytest>=7.0.0",
    "pytest-asyncio>=0.21.0",
    "jiwer",
    "scipy>=1.10.0",
    "openai-whisper==20250625",
    # SeedTTS speaker similarity (WavLM-large SV head). The pip-installed
    # package supplies s3prl.upstream.wavlm.hubconf at runtime, so no source
    # clone is required.
    "s3prl>=0.4.18",
    # S2-Pro
    "tiktoken",
    "hydra-core",
    "omegaconf",
    "descript-audiotools",
    "descript-audio-codec",
    "torchaudio==2.11.0",
    "torchcodec==0.11.1",     # Matches sglang==0.5.12.post1 dependency
    # Gradio playground
    "gradio>=4.0.0",
    # Ming-Omni
    "diffusers==0.37.0",      # Align with sglang 0.5.12.post1 hard pin (diffusers==0.37.0)
    "x-transformers",          # Ming talker rotary embeddings
]

[project.scripts]
sgl-omni = "sglang_omni.cli:app"
sgl-omni-router = "sglang_omni_router.serve:main"

[tool.uv]
override-dependencies = [
    "protobuf>=6.31.1,<7.0.0",
]

[tool.pytest.ini_options]
pythonpath = ["."]
markers = [
    "benchmark: performance benchmark tests (may require GPU and long runtime)",
    "tts_stage(name): select an in-file TTS benchmark CI stage",
    "gpu: requires a CUDA device (auto-skipped without one)",
]

[tool.setuptools.packages.find]
where = ["."]
include = ["sglang_omni*"]

# Non-Python data files that must ship with the wheel.
[tool.setuptools.package-data]
"sglang_omni.models.fishaudio_s2_pro" = ["fish_speech/configs/*.yaml"]
"sglang_omni.models.higgs_tts" = ["_vendored/*.json"]
