litellm/pyproject.toml
Gauarv Chaudhary b4589fc7d1
feat(gnani): add Prisma v2.5 and v3.0 realtime transcription (#53828)
* feat(gnani): add Prisma realtime transcription

Signed-off-by: Gaurav Chaudhary <chaudharygaurav2004@gmail.com>

* fix(gnani): account for forwarded realtime transcription audio

Signed-off-by: Gaurav Chaudhary <chaudharygaurav2004@gmail.com>

* fix(gnani): bound realtime audio appends to four seconds at the client rate

* chore(deps): authorize the PSF-2.0 license of audioop-lts

* fix(gnani): anti-alias resampled audio, honor drop_params, and bill each utterance

Resampled 24, 44.1 and 48 kHz input now runs through an 8 kHz low-pass filter before
ratecv, with the filter tail flushed on commit. Tuned server_vad, semantic_vad and
prompt fail unless drop_params is on, which drops them and keeps server_vad. Prisma
v2.5 sessions need one explicit language before the first append, matching REST.
Each transcript bills Gnani's audio_duration_ms, with silence billed with the next
transcript or at close. The README names the session limits and the missing price

* fix(gnani): keep realtime sessions open on rejected events and hold real-time pacing

A rejected client event now returns an error and the session keeps relaying, since Gnani sets up at connect time through headers

Forwarding keeps a fixed 32 ms schedule, so sleep overshoot no longer adds up over a session, and a stall still never bursts

Gnani speech_start and the transcript now emit input_audio_buffer.speech_started and speech_stopped with the transcript's item id

turn_detection null or any detector other than server_vad is dropped under drop_params, and repeating the session rate no longer resets the filter

* fix(gnani): refuse plaintext realtime bases and document commits that get no reply

The realtime URL builder turned any api_base into a wss URL but kept a ws:// or http:// base as plaintext ws, which would send the Gnani key unencrypted. It now accepts only https:// and wss:// bases and always connects over wss

The README now says a commit with no speech since the last transcript gets no reply, and that api_base must be https:// or wss://

* fix(gnani): refuse noise_reduction and include unless drop_params drops them

The shared session parser now reports noise_reduction, in either layout, and
include as unsupported session settings. Gnani refuses them with an error naming
drop_params, and drops them with a warning when drop_params is on, as it already
does for a transcription prompt and server_vad tuning. Soniox only logs them

noise_reduction set to null and an empty include stay accepted, since they ask
for nothing Gnani lacks

* fix(gnani): keep realtime on when a deployment stores a transcription-only endpoint list

* fix(gnani): gate realtime on the loaded cost map so deployments cannot switch it on or off

* fix(gnani): open realtime for a model registered under its bare name

* docs(gnani): keep the realtime usage guide on the docs site only

The realtime README sends user docs to litellm-docs, where the Gnani provider page now covers the same setup, client example, session rules and limits, so the duplicate section here is removed and only the provider entry stays

---------

Signed-off-by: Gaurav Chaudhary <chaudharygaurav2004@gmail.com>
Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com>
2026-11-25 10:51:59 +00:00

641 lines
27 KiB
TOML

[project]
name = "litellm"
version = "1.113.0"
description = "Library to easily interface with LLM API providers"
readme = "README.md"
requires-python = ">=3.10, <3.16"
license = "MIT"
license-files = ["LICENSE"]
authors = [
{ name = "BerriAI" },
]
dependencies = [
# Ranges (not exact pins) so SDK consumers can coexist with their other
# deps. Reproducibility for our Docker/CI comes from `uv.lock`.
# When changing a floor, verify it installs + imports on every supported
# Python with: `uv pip install --resolution=lowest-direct .`
"fastuuid>=0.14.0,<1.0; python_version < '3.15'",
"filelock>=3.16.1,<5",
"httpx[http2]>=0.28.0,<1.0",
"openai>=2.20.0,<4.0.0",
"python-dotenv>=1.0.0,<2.0",
"pyyaml>=6.0.3,<7.0",
"packaging>=24.0",
"importlib-metadata>=8.0.0,<9.0",
"tiktoken>=0.8.0,<1.0; python_version < '3.14'",
"tiktoken>=0.12.0,<1.0; python_version == '3.14'",
"tiktoken>=0.14.0,<1.0; python_version >= '3.15'",
"tokenizers>=0.21.0,<1.0",
"huggingface-hub>=0.34.0,<3.0",
"click>=8.0.0,<9.0",
"jinja2>=3.1.6,<4.0",
"aiohttp>=3.14.2,<4.0",
"anyio>=4.14.0,<5.0",
"async-timeout>=4.0.3,<6.0; python_version < '3.11'",
"pydantic>=2.11.0,<3.0.0; python_version < '3.14'",
"pydantic>=2.12.0,<3.0.0; python_version == '3.14'",
"pydantic>=2.14.0,<3.0.0; python_version >= '3.15'",
"pydantic-settings>=2.14.1,<3.0",
"jsonschema>=4.0.0,<5.0",
"boto3>=1.43.117,<2.0",
"certifi>=2026.10.19",
"typing-extensions>=4.13.0,<5.0",
]
[project.urls]
Homepage = "https://litellm.ai"
Repository = "https://github.com/BerriAI/litellm"
Documentation = "https://docs.litellm.ai"
# Optional extras use compatible ranges (like the core SDK above) so downstream
# consumers can coexist with other packages and pick up security patches without
# forking. Reproducibility for our Docker/CI comes from `uv.lock` (images install
# via `uv sync --frozen`). A few deps stay exact-pinned: litellm's own
# sub-packages and the opentelemetry trio move in lockstep, and grpcio is
# supply-chain-pinned to a vetted, aged release.
[project.optional-dependencies]
switchyard = ["nemo-switchyard==0.4.0a1"]
proxy = [
"audioop-lts>=0.2.2,<1; python_version >= '3.13'",
"sqlalchemy>=2.0.49,<2.1",
"alembic>=1.18.4,<2.0",
"psycopg>=3.2,<4.0",
"psycopg-binary>=3.2,<4.0",
"casbin==1.43.0",
"gunicorn>=23.0.0,<24.0",
"uvicorn>=0.33.0,<1.0",
"granian>=2.7.4,<3.0; python_version < '3.15'",
"granian>=2.8.0,<3.0; python_version >= '3.15'",
"uvloop>=0.22.1,<1.0; sys_platform != 'win32'",
"fastapi>=0.136.3,<1.0",
"opentelemetry-api==1.45.2",
"opentelemetry-sdk==1.45.2",
"opentelemetry-exporter-otlp==1.45.2",
"opentelemetry-instrumentation-fastapi==0.66b2",
"starlette>=1.0.1,<2.0",
"backoff>=2.2.1,<3.0",
"pyyaml>=6.0.3,<7.0",
"rq>=2.7.0,<3.0",
"orjson>=3.11.6,<4.0; python_version < '3.15'",
"orjson>=3.12.0,<4.0; python_version >= '3.15'",
# redis-py's C response parser. It arrives with redis (via rq) either way; naming
# it here is what makes redis-py select _HiredisParser instead of the Python one.
"hiredis>=3.0.0,<4.0; python_version < '3.15'",
"hiredis>=3.5.0,<4.0; python_version >= '3.15'",
"apscheduler>=3.11.2,<4.0",
"ldap3>=2.9.1,<3.0",
"tzdata>=2024.1",
"fastapi-sso>=0.19.0,<1.0",
"PyJWT>=2.13.0,<3.0",
"python-multipart>=0.0.27,<1.0",
"cryptography>=49.0.0,<51.0",
"pynacl>=1.6.2,<2.0",
"websockets>=15.0.1,<16.0",
"boto3>=1.43.117,<2.0",
"azure-identity>=1.25.2,<2.0",
"azure-storage-blob>=12.28.0,<13.0",
"mcp>=2.3.0,<3",
"httpx2>=2.10.0,<3",
"pydantic>=2.12.0,<3",
"litellm-proxy-extras==0.4.122",
"litellm-enterprise==0.1.90",
"RestrictedPython>=8.5,<9.0",
"rich>=13.9.4,<14.0",
"InquirerPy>=0.3.4,<1.0",
"tomlkit>=0.13.3,<1.0",
"polars>=1.38.1,<2.0",
"soundfile>=0.12.1,<1.0",
"pyroscope-io>=0.8.16,<1.0; sys_platform != 'win32'",
"expression>=5.6.0,<6.0",
"backports-zstd>=1.0.0,<2.0; python_version < '3.14'",
"semver>=3.0.4,<4",
]
# Thin client install for the `lite` CLI on developer laptops. The CLI's heavy
# imports are all guarded, so it runs on the base SDK plus these packages, and
# none of the server runtime in `proxy` is pulled in. On Linux,
# keyring reaches the Secret Service through secretstorage, which brings
# cryptography with it.
cli = [
"rich>=13.9.4,<14.0",
"pyyaml>=6.0.3,<7.0",
"requests>=2.32.0,<3.0",
"InquirerPy>=0.3.4,<1.0",
"keyring>=25.6.0,<26.0",
"tomlkit>=0.13.3,<1.0",
]
extra_proxy = [
"prisma>=0.11.0,<1.0",
# Used by ProxyExtrasDBManager.spend_logs_is_partitioned() to detect a
# partitioned LiteLLM_SpendLogs and keep schema reconciliation from
# fighting its composite primary key.
"psycopg>=3.2,<4.0",
"psycopg-binary>=3.2,<4.0",
"azure-identity>=1.25.2,<2.0",
"azure-keyvault-secrets>=4.10.0,<5.0",
# Not in PyPI proxy extra.
"google-cloud-kms>=2.24.2,<3.0",
"google-cloud-iam>=2.19.1,<3.0",
# Not in PyPI proxy extra.
"resend>=2.23.0,<3.0",
"redisvl>=0.4.1,<1.0",
"a2a-sdk>=1.1.0,<2.0",
]
utils = [
# Not in Docker or PyPI proxy extra.
"numpydoc>=1.8.0,<2.0",
]
mcp = ["mcp>=2.3.0,<3", "httpx2>=2.10.0,<3", "pydantic>=2.12.0,<3"]
# Driver for the MongoDB Atlas vector store; Atlas Vector Search has no HTTP query API.
# The floor is 4.9 because that is the release AsyncMongoClient landed in.
# SAML SSO for the admin UI. python3-saml pulls in xmlsec/lxml, whose wheels
# bundle the native libxmlsec1/libxml2 libraries, so no system packages are
# required. Kept out of the base `proxy` extra so it stays optional.
saml = ["python3-saml>=1.16.0,<2.0"]
semantic-router = [
"semantic-router>=0.1.15,<1.0; python_version < '3.14'",
"aurelio-sdk>=0.0.19,<1.0; python_version < '3.14'",
]
mlflow = ["mlflow>=3.17.2,<4.0"]
grpc = [
# First release whose bundled roots.pem drops the compromised eMudhra roots, ahead of the 30-day cutoff
"grpcio==1.84.1",
]
stt-vertex-chirp = [
# Google Cloud Speech-to-Text v2 streaming (gRPC) for Chirp models on
# /v1/realtime. Imported lazily inside the backend so litellm core stays
# usable without it.
"google-cloud-speech>=2.40.0,<3.0",
]
stt-nvidia-riva = [
# NVIDIA Riva STT provider (gRPC). These are imported lazily inside the
# provider handler so litellm core remains usable without them.
"grpcio>=1.67.1,<2.0",
"protobuf>=5.26.1,<7.0",
"soundfile>=0.12.1",
"audioread>=3.0.1",
"numpy>=1.26.0",
]
google = ["google-cloud-aiplatform>=1.133.0,<2.0"]
bedrock-realtime = [
# Bedrock Nova Sonic realtime (speech-to-speech) uses the
# InvokeModelWithBidirectionalStream API, which boto3 cannot do. This
# experimental AWS SDK (with its smithy-* deps, pulled transitively)
# provides the bidirectional stream; imported lazily in the realtime
# handler so litellm core stays usable without it. The awscrt extra is
# required: the SDK's default aiohttp transport has no duplex streaming.
"aws-sdk-bedrock-runtime[awscrt]>=0.10.0,<0.12.0; python_version >= '3.12'",
]
proxy-runtime = [
# Historically bundled in the proxy Docker images via requirements.txt.
# Keep these in a dedicated extra so uv-based images preserve the same
# feature surface without forcing the base SDK install to grow.
"google-cloud-aiplatform>=1.133.0,<2.0",
"google-cloud-speech>=2.40.0,<3.0",
"google-genai>=1.37.0,<2.0",
"anthropic[vertex]>=0.84.0,<1.0",
"grpcio==1.84.1",
"prometheus-client>=0.20.0,<1.0",
"langfuse>=4.7,<5.0",
"opentelemetry-api==1.45.2",
"opentelemetry-sdk==1.45.2",
"opentelemetry-exporter-otlp==1.45.2",
"opentelemetry-instrumentation-fastapi==0.66b2",
"ddtrace>=4.8.2,<5.0",
"sentry-sdk>=2.21.0,<3.0",
"mangum>=0.17.0,<1.0",
"azure-ai-contentsafety>=1.0.0,<2.0",
"azure-storage-file-datalake>=12.20.0,<13.0",
"pypdf>=6.21.2,<7.0",
"llm-sandbox>=0.3.39,<1.0",
"detect-secrets>=1.5.0,<2.0",
]
[project.scripts]
litellm = "litellm_cli.main:proxy_server"
lite = "litellm_cli.main:cli"
litellm-proxy = "litellm_cli.main:litellm_proxy_cli"
[dependency-groups]
dev = [
"numpy>=1.26.0,<3.0",
"diff-cover==9.7.2",
"hypothesis==6.165.10",
"reportlab==5.0.1",
"basedpyright==1.39.7",
"mypy==1.20.1",
"keyring==25.7.0",
"pytest==9.0.3",
"pytest-socket==0.8.1",
"tomli==2.4.1; python_version < '3.11'",
"pytest-mock==3.15.1",
"pytest-asyncio==1.3.0",
"psycopg==3.3.6",
"psycopg-binary==3.3.6",
"pytest-xdist==3.8.0",
"requests-mock==1.12.1",
"responses==0.26.0",
"respx==0.22.0",
"ruff==0.15.3",
"types-requests==2.32.4.20260107",
"types-setuptools==75.8.0.20250225",
"types-redis==4.6.0.20241004",
"types-PyYAML==6.0.12.20250915",
"botocore-stubs==1.43.14",
"types-boto3[bedrock,bedrock-agent,bedrock-runtime,kms,s3,sagemaker-runtime,sts]==1.43.30",
"opentelemetry-api==1.45.2",
"opentelemetry-sdk==1.45.2",
"opentelemetry-exporter-otlp==1.45.2",
"opentelemetry-instrumentation-fastapi==0.66b2",
"langfuse>=4.7,<5.0",
"fastapi-offline==1.7.6",
"fakeredis==2.34.1",
"pytest-rerunfailures==15.1",
"pytest-cov==5.0.0",
"parameterized==0.9.0",
"openapi-core==0.22.0",
"pytest-timeout==2.4.0",
"vcrpy==8.2.1",
"pytest-recording==0.13.4",
"nvidia-riva-client==2.16.0",
"time-machine==2.19.0",
]
e2e-dev = [
"playwright==1.61.0",
"websockets>=15.0.1,<16.0",
"locust==2.45.0",
"anthropic==0.84.0",
"psutil==7.2.2",
"mcp>=2.3.0,<3",
]
admin-mcp = [
"litellm-admin-mcp @ https://github.com/BerriAI/liteadmin-mcp/archive/31fb096904ae05684c0779110a93b135b5601182.tar.gz#sha256=5803a20a00a18177f4591706956f31be311879543049b8b38143ad90bb1cb0a6 ; python_version >= '3.12'",
]
proxy-dev = [
"sqlalchemy==2.0.49",
"pynacl==1.6.2",
"alembic==1.18.4",
{ include-group = "admin-mcp" },
"prisma==0.11.0",
"hypercorn==0.17.3",
"prometheus-client==0.20.0",
"sentry-sdk==2.21.0",
"opentelemetry-api==1.45.2",
"opentelemetry-sdk==1.45.2",
"opentelemetry-exporter-otlp==1.45.2",
"opentelemetry-instrumentation-fastapi==0.66b2",
"azure-identity==1.25.2",
"a2a-sdk==1.1.0",
"nemo-switchyard==0.4.0a1",
"backports-zstd==1.8.0; python_version < '3.14'",
"httptools>=0.7.1,<0.8",
"semver>=3.0.4,<4",
]
ci = [
"psutil==7.2.2",
"tzdata==2026.2",
# These are lazily imported at call sites; keep them out of core deps to
# avoid bloating the base SDK install (google-generativeai pulls grpcio +
# protobuf, Pillow is a compiled C extension).
"tenacity==8.5.0",
"google-generativeai==0.8.6",
# The Riva tests serve NVIDIA's own message definitions, which checks
# LiteLLM's hand-written copy of them on every run.
"nvidia-riva-client==2.16.0",
"time-machine==2.19.0",
"Pillow==12.3.0; python_version == '3.10'",
"Pillow==13.0.0; python_version >= '3.11'",
# Azure batch E2E tests still import psycopg2 directly.
"psycopg2-binary==2.9.11",
"pytest-codspeed==4.3.0",
"pytest-retry==1.7.0",
"pyarrow==23.0.1",
"langchain==1.3.9",
"lunary==1.4.36; python_version == '3.10'",
"lunary==1.4.37; python_version >= '3.11'",
"logfire==5.2.0",
"traceloop-sdk==0.34.0",
"detect-secrets==1.5.0",
"PyGithub==2.8.1",
"aiodynamo==24.7",
"argon2-cffi==25.1.0",
"assemblyai==0.52.4",
"jsonlines==4.0.0",
"anthropic==0.84.0",
"blockbuster==1.5.26",
"beautifulsoup4==4.14.3",
"pylint==4.0.9",
"langchain-openai==1.1.14",
"langgraph>=1.2.4,<1.3.0",
"langgraph-prebuilt>=1.1.0,<1.3.0",
"claude-agent-sdk==0.2.165",
"google-cloud-speech==2.40.0",
]
healthcheck = [
"httpx==0.28.1",
"pyyaml==6.0.3",
]
benchmarks = [
"pytest==9.0.3",
"pytest-codspeed==4.3.0",
"mcp>=2.3.0,<3",
"a2a-sdk==1.1.0",
"pypdf>=6.21.2,<7.0",
]
[build-system]
requires = ["maturin==1.15.0"]
build-backend = "build_backend"
backend-path = [".github/packaging"]
[tool.maturin]
manifest-path = "litellm/rust/crates/python-bridge/Cargo.toml"
module-name = "litellm.rust_bridge._native"
python-source = "."
python-packages = ["litellm"]
bindings = "pyo3"
features = ["extension-module"]
profile = "release"
editable-profile = "dev"
include = [
{ path = ".github/packaging/*.py", format = "sdist" },
{ path = "litellm/rust/rust-toolchain.toml", format = "sdist" },
{ path = "litellm/rust/.cargo/config.toml", format = "sdist" },
"litellm/integrations/prometheus_helpers/grafana_dashboards/**",
"litellm/proxy/_experimental/out/**",
"litellm/router_strategy/complexity_router/artifacts/*.json",
"litellm/router_strategy/complexity_router/fuse_presets.json",
"litellm/proxy/model_insights_tasks.json",
"litellm/proxy/public_endpoints/whats_new.json",
"litellm/proxy/common_utils/codex_base_instructions.md",
"litellm/proxy/common_utils/codex_bundled_models_0.166.0.json",
"litellm/proxy/common_utils/codex_bedrock_mantle_models_0.166.0.json",
"litellm/proxy/common_utils/codex_bedrock_runtime_models_0.166.0.json",
{ path = "model_prices_and_context_window.json", format = "sdist" },
]
exclude = [
"litellm/scripts",
"litellm/scripts/**",
"litellm/runtime",
"litellm/runtime/**",
"litellm/schema.prisma",
"litellm/enterprise",
"litellm/enterprise/**",
"litellm/proxy-extras",
"litellm/proxy-extras/**",
"litellm/packaging",
"litellm/packaging/**",
{ path = "litellm/rust", format = "wheel" },
{ path = "litellm/rust/**", format = "wheel" },
"litellm/rust/target/**",
"litellm/deploy",
"litellm/deploy/**",
"litellm/ui",
"litellm/ui/**",
"litellm/vscode-extension",
"litellm/vscode-extension/**",
"litellm/proxy/discovery_endpoints/skill_scanner_adapter",
"litellm/proxy/discovery_endpoints/skill_scanner_adapter/**",
"litellm/proxy/enterprise",
"litellm/proxy/enterprise/**",
"litellm/proxy/guardrails/guardrail_hooks/litellm_content_filter/guardrail_benchmarks",
"litellm/proxy/guardrails/guardrail_hooks/litellm_content_filter/guardrail_benchmarks/**",
"**/__pycache__",
"**/__pycache__/**",
"**/.pytest_cache",
"**/.pytest_cache/**",
"**/.ruff_cache",
"**/.ruff_cache/**",
]
[tool.uv]
concurrent-builds = 1
cache-keys = [
{ file = "pyproject.toml" },
{ env = "MATURIN_PEP517_ARGS" },
{ file = "litellm/rust/rust-toolchain.toml" },
{ file = "litellm/rust/.cargo/config.toml" },
{ file = "litellm/rust/Cargo.lock" },
{ file = "litellm/rust/Cargo.toml" },
{ file = "litellm/rust/crates/**/*" },
{ file = "model_prices_and_context_window.json" },
]
constraint-dependencies = [
"tornado>=6.5.8",
"tornado>=6.6.1; python_version >= '3.11'",
"aiohttp>=3.14.2,<4.0",
"packaging>=24.0",
"soupsieve>=2.10",
"soupsieve>=4.0; python_full_version >= '3.11.5'",
"httplib2>=0.32.0",
"setuptools>=84.1.0",
"dnspython>=2.9.2; python_version >= '3.11'",
"filelock<3.20.4; python_version < '3.11'",
"filelock>=4.2.1; python_version >= '3.11'",
]
override-dependencies = [
# a2a-sdk 1.x requires packaging>=24.0; lunary 1.4.x still caps at <24.0.
"packaging>=24.0",
"cryptography>=50.0.0,<51.0",
"mcp>=2.3.0,<3",
]
default-groups = ["dev"]
required-version = ">=0.10.9"
exclude-newer = "3 days"
[tool.uv.exclude-newer-package]
# TODO: remove after 2026-10-25, once brotli 1.2.1 (CVE-2026-111497) clears the 3-day window
brotli = "2026-10-22T14:01:00Z"
# TODO: remove after 2026-10-31, once pypdf 6.21.4 clears the 3-day window
pypdf = "2026-10-28T17:01:00Z"
[tool.uv.sources]
litellm-proxy = { workspace = true }
litellm-proxy-extras = { workspace = true }
litellm-enterprise = { workspace = true }
[tool.uv.workspace]
members = ["litellm/enterprise", "litellm/proxy-extras", "litellm/packaging/litellm-proxy"]
[tool.commitizen]
version = "1.113.0"
version_files = [
"pyproject.toml:^version",
"litellm/packaging/litellm-proxy/pyproject.toml:^version",
]
[tool.pytest.ini_options]
norecursedirs = ["*.egg", ".*", "_darcs", "build", "CVS", "dist", "node_modules", "venv", "{arch}", "**/litellm/ui", "**/litellm/vscode-extension", "**/litellm/enterprise", "**/litellm/proxy-extras", "**/litellm/packaging", "**/litellm/rust", "**/litellm/scripts", "**/litellm/runtime"]
pythonpath = ["litellm/scripts", "litellm/runtime"]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "session"
markers = [
"asyncio: mark test as an asyncio test",
"limit_leaks: mark test with memory limit for leak detection (e.g., '40 MB')",
"no_parallel: mark test to run sequentially (not in parallel) - typically for memory measurement tests",
"requires_rust_extension: public Python contract tests that run against the release-built wheel",
]
filterwarnings = [
# Suppress Pydantic serializer warnings from mock server responses (non-critical for memory tests)
# These occur because the mock server returns a simplified response format
"ignore:Pydantic serializer warnings:UserWarning",
"ignore::UserWarning:pydantic.main",
# Suppress pytest-asyncio event loop deprecation warning (handled automatically by pytest-asyncio)
"ignore::DeprecationWarning:pytest_asyncio.plugin",
]
[tool.mutmut]
# Mutation-testing scope. Driven by the manually-triggered workflow at
# .github/workflows/mutation-test.yml. mutmut is not part of the project's
# default install; it is pulled in via `uv run --with mutmut==<version>` in CI.
# `also_copy = ["litellm/"]` is required because mutmut runs in a `mutants/`
# sandbox and the test conftest imports from across the litellm package.
paths_to_mutate = [
"litellm/proxy/management_endpoints/",
]
# Only the unit tier that maps to paths_to_mutate. mutmut times and
# coverage-maps this whole set once before mutating, so a tier that needs a
# seeded database (tests/proxy_behavior/) kills the run before it starts, and
# a mutation score is only meaningful against the tests that claim to cover
# the mutated code anyway.
tests_dir = [
"tests/unit/proxy/management_endpoints/",
]
also_copy = [
"litellm/",
]
# Run the test suite once before mutation to gather line coverage, then skip
# mutating lines no test exercises. Those mutants would survive regardless
# (no test hits the line to kill them), so generating them wastes hours of CI.
# The score now reads as "mutation score over covered code" — pair with a
# line-coverage number when reporting.
mutate_only_covered_lines = true
# Disable rerun/parallel plugins for mutation runs:
# - pytest-retry triggers an `INTERNALERROR: no option named 'filtered_exceptions'`
# when invoked via mutmut's in-process `pytest.main()` call.
# - rerunning a "failed" test on a mutant would mask which mutants are killed
# vs. survive, so reruns are wrong for mutation testing regardless.
# - xdist is unnecessary inside mutmut (mutmut handles its own parallelism).
# test_saml_sso.py cannot run inside mutmut's mutants/ sandbox: the copied tree
# re-imports cryptography's hash classes under a second identity, so x509 .sign()
# rejects the SHA256 instance the fixture builds with "Algorithm must be a
# registered hash algorithm". Nothing to do with mutation coverage, and one
# erroring test is enough to end the stats phase before any mutant runs.
pytest_add_cli_args = [
"-p", "no:pytest-retry",
"-p", "no:rerunfailures",
"-p", "no:xdist",
"--ignore=tests/unit/proxy/management_endpoints/test_saml_sso.py",
]
[tool.coverage.run]
source = ["litellm"]
relative_files = true
[tool.ruff]
src = [".", "litellm/runtime"]
lint.ignore = ["F405", "E402", "F403"]
# The second group is the strict gate's graduates: rules the codebase already has zero
# violations of, so they hard-fail here instead of being counted by the strict gate.
# That gives editors and `ruff check --fix` the diagnostic, which the gate script cannot.
lint.extend-select = [
"T20", "PGH004", "RUF008", "RUF009", "RUF100",
"B004", "B018", "B021", "B033", "FURB136", "FURB168", "FURB188", "I001", "PERF402", "PIE790",
"PIE800", "PLC0208", "PLR0124", "PLR0402", "PLR0206", "PLR1704", "PLR1711", "PLR1730", "PLR2044",
"PLW0133", "PYI030", "PYI041", "PYI064", "RET501", "RUF010", "RUF022", "RUF023", "RUF051", "S113",
"SIM114", "SIM118", "SIM201", "SIM211", "SIM222", "TC005", "UP006", "UP007", "UP008",
"UP012", "UP018", "UP024", "UP032", "UP034", "UP035", "UP036", "UP037", "UP045",
"C404", "C419", "TID253",
# Rust repositories stay behind the Python repositories in litellm/repositories/.
# The banned names live in [tool.ruff.lint.flake8-tidy-imports.banned-api] below.
"TID251",
]
# RUF100 (unused-noqa) only knows the rules enabled in THIS config, so it would strip
# `# noqa` directives that protect rules enforced elsewhere. List those codes as external
# so RUF100 leaves their directives alone: the strict gate (.github/linters/ruff-strict.toml) and upstream
# litellm's own ruff config both rely on suppressions this config can't see.
lint.external = [
# Enforced by the strict-rule gate (litellm/scripts/ruff_strict_gate.py + .github/linters/ruff-strict.toml).
# Family entries whose every strict rule graduated into extend-select above (FURB), and
# standalone graduated codes (I001, RUF010, RUF022, RUF023, RUF051), are dropped so this
# config's RUF100 polices their directives itself.
"ANN", "ASYNC230", "B", "C", "D202", "D403", "D417", "D419", "DTZ", "EXE", "LOG015", "N999", "PERF",
"PIE", "PL", "PYI", "RET", "RUF012", "RUF015", "RUF019",
"RUF046", "RUF059", "S110", "S112", "SIM", "TC", "TID251", "TRY", "UP",
# Enforced by upstream litellm's ruff config, but not run in this repo's CI
"PLC0415", "E402", "BLE001", "ARG002", "S102", "S324", "S606", "D401", "F403", "F405",
]
line-length = 120
extend-exclude = ["litellm/scripts", "litellm/runtime", "litellm/deploy", "litellm/ui", "litellm/vscode-extension", "litellm/enterprise", "litellm/proxy-extras", "litellm/packaging", "litellm/rust", "litellm/proxy/discovery_endpoints/skill_scanner_adapter"]
format.exclude = ["**/enterprise/**"]
# Was the top-level `exclude`. Scoped to lint so `ruff format` still formats these paths
# (Black did) while `ruff check` keeps skipping them.
lint.exclude = ["litellm/__init__.py", "litellm/proxy/example_config_yaml/*", "tests/*"]
[tool.ruff.lint.flake8-tidy-imports]
banned-module-level-imports = ["prisma"]
# Only litellm/repositories/ reaches a Rust repository (the per-file-ignores below allow it
# there); everything else goes through the Python repository that wraps it. tests/ is outside
# this config's lint scope, so tests may patch and exercise rust_database directly.
# .github/linters/ruff-strict.toml sets its own banned-api and per-file-ignores, which replace
# these two tables rather than merge with them, so the strict gate's TID251 bans keep applying
# to litellm/repositories/ and these Rust bans hard-fail here instead of being counted there.
[tool.ruff.lint.flake8-tidy-imports.banned-api]
"litellm.repositories.rust_database".msg = "Use a Python repository in litellm/repositories/; only it may reach a Rust repository."
"litellm.rust_bridge._native.RustKeyRepository".msg = "Use a Python repository in litellm/repositories/; only it may reach a Rust repository."
"litellm.rust_bridge._native.RustJwtKeyMappingRepository".msg = "Use a Python repository in litellm/repositories/; only it may reach a Rust repository."
"litellm.rust_bridge._native.RustModelAccessGroupRepository".msg = "Use a Python repository in litellm/repositories/; only it may reach a Rust repository."
"litellm.rust_bridge._native.RustBudgetRepository".msg = "Use a Python repository in litellm/repositories/; only it may reach a Rust repository."
"litellm.rust_bridge._native.RustEndUserRepository".msg = "Use a Python repository in litellm/repositories/; only it may reach a Rust repository."
"litellm.rust_bridge._native.RustUserRepository".msg = "Use a Python repository in litellm/repositories/; only it may reach a Rust repository."
"litellm.rust_bridge._native.RustOrganizationRepository".msg = "Use a Python repository in litellm/repositories/; only it may reach a Rust repository."
"litellm.rust_bridge._native.RustTeamMembershipRepository".msg = "Use a Python repository in litellm/repositories/; only it may reach a Rust repository."
"litellm.rust_bridge._native.RustTeamRepository".msg = "Use a Python repository in litellm/repositories/; only it may reach a Rust repository."
"litellm.rust_bridge._native.RustProjectRepository".msg = "Use a Python repository in litellm/repositories/; only it may reach a Rust repository."
"litellm.rust_bridge._native.RustTagRepository".msg = "Use a Python repository in litellm/repositories/; only it may reach a Rust repository."
"litellm.rust_bridge._native.RustAccessGroupRepository".msg = "Use a Python repository in litellm/repositories/; only it may reach a Rust repository."
"litellm.rust_bridge._native.RustObjectPermissionRepository".msg = "Use a Python repository in litellm/repositories/; only it may reach a Rust repository."
"litellm.rust_bridge._native.RustSpendLogRepository".msg = "Use a Python repository in litellm/repositories/; only it may reach a Rust repository."
[tool.ruff.lint.per-file-ignores]
"litellm/main.py" = ["F401"]
"litellm/types/caching.py" = ["F401"]
"litellm/types/integrations/slack_alerting.py" = ["F401"]
"litellm/types/llms/custom_http.py" = ["F401"]
"litellm/types/llms/openai.py" = ["F401"]
"litellm/types/proxy/management_endpoints/scim_v2.py" = ["F401"]
"litellm/types/responses/main.py" = ["F401"]
"litellm/utils.py" = ["F401"]
"litellm/proxy/proxy_server.py" = ["F401"]
"litellm/caching/__init__.py" = ["F401"]
"litellm/llms/anthropic/chat/__init__.py" = ["F401"]
"litellm/llms/azure_ai/embed/__init__.py" = ["F401"]
"litellm/llms/azure_ai/rerank/__init__.py" = ["F401"]
"litellm/llms/bedrock/chat/__init__.py" = ["F401"]
"litellm/proxy/utils.py" = ["F401"]
# The only TID251 bans in this config are the Rust repository ones above, so this unbans nothing else.
"litellm/repositories/**" = ["TID251"]
"litellm/rust_bridge/**" = ["TID251"]
# Tests patch and exercise rust_database directly (tests/unit/proxy/rust_auth_stores.py).
"tests/**" = ["TID251"]
[tool.pyright]
extraPaths = ["litellm/runtime"]
include = ["litellm"]
ignore = []
exclude = ["**/node_modules", "**/__pycache__", "tests/e2e/claude_code", "tests/e2e_harness/claude_code", "tests/e2e/ui", "litellm/types/utils.py", "litellm/proxy/_types.py", "litellm/scripts", "litellm/runtime", "litellm/deploy", "litellm/ui", "litellm/vscode-extension", "litellm/enterprise", "litellm/proxy-extras", "litellm/packaging", "litellm/rust", "litellm/proxy/discovery_endpoints/skill_scanner_adapter"]
pythonVersion = "3.12"
typeCheckingMode = "strict"
enableTypeIgnoreComments = false
reportMissingImports = false
reportPrivateImportUsage = false
reportExplicitAny = "error"
reportAny = "error"
[[tool.pyright.executionEnvironments]]
root = "tests/e2e_harness"
extraPaths = ["tests/e2e", "tests/e2e/batches", "tests/e2e/guardrails", "tests/e2e/perf", "tests/e2e/logging"]