[build-system] build-backend = "hatchling.build" requires = [ "hatchling" ] [project] name = "litserve" description = "Lightweight AI server." readme = "README.md" keywords = [ "AI", "deep learning", "pytorch" ] license = { text = "Apache-2.0" } authors = [ { name = "Lightning-AI et al.", email = "community@lightning.ai" } ] requires-python = ">=3.10" classifiers = [ "Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", "Topic :: Scientific/Engineering :: Artificial Intelligence", "Topic :: Scientific/Engineering :: Information Analysis", ] dynamic = [ "version" ] dependencies = [ "fastapi>=0.112", # first release with py3.10 wheels "pyzmq>=22.2.1", "uvicorn[standard]>=0.29.0", ] [project.scripts] litserve = "litserve.__main__:main" lightning = "litserve.cli:main" [project.urls] Homepage = "https://github.com/Lightning-AI/litserve" "Bug Tracker" = "https://github.com/Lightning-AI/litserve/issues" Documentation = "https://lightning-ai.github.io/litserve/" "Source Code" = "https://github.com/Lightning-AI/litserve" Download = "https://github.com/Lightning-AI/litserve" [dependency-groups] dev = [ "asgi-lifespan>=2.1.0", "coverage[toml]>=7.5.3", # fastmcp 4 requires mcp>=2, which removed `mcp.server.fastmcp` (see litserve/mcp.py) "fastmcp>=2.9.2,<4; python_full_version>='3.10'", "httpx>=0.27.0", "jsonargparse", "lightning>2.0.0", "mypy==2.3.1", "numpy<3.0", "openai>=1.12.0", "pillow>=11.3.0", "psutil>=7.0.0", "pytest>=8.0", "pytest-asyncio>=1.0.0", "pytest-cov>=6.2.1", "pytest-retry>=1.6.3", "python-multipart>=0.0.20", "requests>=2.32.4", "rich", "tenacity>=9.1.2", "torch>2.0.0", "torchvision>=0.22.1", "transformers>=4.53.0", "uvloop>=0.21.0; sys_platform!='win32'", ] [tool.hatch] version.path = "src/litserve/__about__.py" version.pattern = '__version__ = "(?P.+)"' metadata.allow-direct-references = true # hatchling defaults to Metadata-Version 2.5, which twine 6.x rejects; emit 2.4 until CI is on twine 7 build.targets.wheel.core-metadata-version = "2.4" build.targets.sdist.core-metadata-version = "2.4" # [tool.mypy] # files = [ # "src", # ] # install_types = true # non_interactive = true # disallow_untyped_defs = true # ignore_missing_imports = true # show_error_codes = true # warn_redundant_casts = true # warn_unused_configs = true # warn_unused_ignores = true # allow_redefinition = true ## disable this rule as the Trainer attributes are defined in the connectors, not in its __init__ # disable_error_code = "attr-defined" ## style choices # warn_no_return = false [tool.ruff] target-version = "py310" line-length = 120 # Exclude a variety of commonly ignored directories. exclude = [ ".eggs", ".git", ".mypy_cache", ".ruff_cache", "__pypackages__", "_build", "build", "dist", "docs" ] # Enable Pyflakes `E` and `F` codes by default. lint.select = [ "E", "F", # see: https://pypi.org/project/pyflakes # "D", # see: https://pypi.org/project/pydocstyle "I", # implementation for isort "N", # see: https://pypi.org/project/pep8-naming "RUF100", # implementation for yesqa "UP", # implementation for pyupgrade "W", # see: https://pypi.org/project/pycodestyle ] lint.extend-select = [ "C4", # see: https://pypi.org/project/flake8-comprehensions "PT", # see: https://pypi.org/project/flake8-pytest-style "RET", # see: https://pypi.org/project/flake8-return "SIM", # see: https://pypi.org/project/flake8-simplify ] lint.ignore = [ "E731", # Do not assign a lambda expression, use a def "UP007", # TODO: non-pep604-annotation-union "UP045", # TODO: non-pep604-annotation-optional ] # [tool.ruff.pycodestyle] # ignore-overlong-task-comments = true [tool.ruff.lint.mccabe] # Unlike Flake8, default to a complexity level of 10. max-complexity = 10 [tool.ruff.lint.per-file-ignores] "setup.py" = [ "D100", "SIM115" ] "__about__.py" = [ "D100" ] "__init__.py" = [ "D100" ] [tool.ruff.lint.pydocstyle] # Use Google-style docstrings. convention = "google" [tool.codespell] # comma separated list of words; waiting for: # https://github.com/codespell-project/codespell/issues/2839#issuecomment-1731601603 # also adding links until they ignored by its: nature # https://github.com/codespell-project/codespell/issues/2243#issuecomment-1732019960 # ignore-words-list = "" # skip = "*.py" quiet-level = 3 [tool.docformatter] recursive = true wrap-summaries = 120 wrap-descriptions = 120 blank = true [tool.check-manifest] ignore = [ "*.yml", ".github", ".github/*" ] [tool.pyproject-fmt] # preserve the layout this file already had keep_full_version = true # keep generated classifiers in step with the CI matrix in ci-testing.yml max_supported_python = "3.13" expand_tables = [ "project.scripts", "project.urls", "tool.ruff.lint.mccabe", "tool.ruff.lint.per-file-ignores", "tool.ruff.lint.pydocstyle", ] [tool.coverage] report.exclude_lines = [ "pass", "pragma: no cover", ]