[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "proxym"
version = "0.1.67"
description = "Intelligent AI proxy with multi-provider routing, semantic caching, and delta context buffers"
readme = "README.md"
license = "Apache-2.0"
requires-python = ">=3.11"
authors = [
    {name = "Tom Sapletta", email = "tom@sapletta.com"},
]

dependencies = [
    "fastapi>=0.115.0",
    "uvicorn[standard]>=0.30.0",
    "httpx>=0.27.0",
    "litellm>=1.55.0",
    "redis>=5.0.0",
    "pydantic>=2.9.0",
    "pydantic-settings>=2.5.0",
    "python-dotenv>=1.0.0",
    "tiktoken>=0.8.0",
    "watchfiles>=0.24.0",
    "xxhash>=3.5.0",
    "rich>=13.9.0",
    "structlog>=24.4.0",
    "pyyaml>=6.0",
    "click>=8.1.0",
]

[project.optional-dependencies]
gpu = ["torch>=2.4.0", "sentence-transformers>=3.3.0"]
jetson = ["onnxruntime-gpu"]
vm = ["clonebox>=1.1.2"]
voice = ["faster-whisper>=1.0.0", "sounddevice>=0.4.0", "numpy>=1.26.0"]
tts = ["piper-tts>=1.2.0"]
test = [
    "pytest>=8.3.0",
    "pytest-asyncio>=0.24.0",
    "pytest-httpx>=0.32.0",
    "pytest-cov>=5.0.0",
    "pytest-timeout>=2.3.0",
    "pytest-xdist>=3.5.0",
    "respx>=0.21.0",
    "fakeredis>=2.25.0",
    "playwright>=1.48.0",
]
dev = ["ruff>=0.7.0", "mypy>=1.12.0", "pre-commit>=4.0.0"]

[project.scripts]
proxym = "proxym.ctl:main"
proxym-server = "proxym.main:cli"
proxym-watch = "proxym.watch.client:cli"

[tool.hatch.build.targets.wheel]
packages = ["src/proxym"]

[tool.pytest.ini_options]
testpaths = ["tests"]
asyncio_mode = "auto"
timeout = 30
addopts = [
    "-n", "auto",  # Enable parallel execution with pytest-xdist
    "--dist=worksteal",  # Work-stealing load balancing
    "--max-worker-restart=2",  # Allow worker restarts
]
markers = [
    "e2e: end-to-end tests requiring running services",
    "gpu: tests requiring GPU",
    "slow: slow tests",
    "playwright: tests requiring Playwright browser automation",
]

[tool.ruff]
target-version = "py311"
line-length = 100

[tool.ruff.lint]
select = ["E", "F", "I", "N", "W", "UP", "B", "A", "SIM"]
