[project] name = "flama" version = "2.2.2" description = "Fire up your models with the flame 🔥" license = "Apache-2.0" license-files = ["LICENSE"] readme = "README.md" authors = [ { name = "José Antonio Perdiguero López", email = "perdy@perdy.io" }, { name = "Miguel A. Durán Olivencia", email = "migduroli@gmail.com" }, ] maintainers = [ { name = "José Antonio Perdiguero López", email = "perdy@perdy.io" }, { name = "Miguel A. Durán Olivencia", email = "migduroli@gmail.com" }, ] keywords = [ "llm", "llm-serving", "generative-ai", "machine-learning", "mlops", "model-serving", "inference", "mcp", "model-context-protocol", "openai", "anthropic", "ollama", "mlx", "vllm", "rust", "asgi", "api", "openapi", "domain-driven-design", "tensorflow", "pytorch", "scikit-learn", ] classifiers = [ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Intended Audience :: Developers", "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", "Programming Language :: Python :: 3.14", "Topic :: Internet :: WWW/HTTP :: HTTP Servers", "Topic :: Scientific/Engineering :: Artificial Intelligence", "Topic :: Software Development", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Application Frameworks", ] requires-python = ">=3.10,<3.15" dependencies = [ "click>=8.1,<9.0", "uvicorn[standard]>=0.38,<1.0.0", "Jinja2>=3.1.2,<4.0", "packaging>=24.0,<27.0", "pyyaml>=6.0,<7.0", "typing-extensions>=4.15,<5.0; python_version < '3.14'", # PORT: Replace compat when stop supporting 3.13 "tomli>=2.3.0,<3.0; python_version < '3.11'", # PORT: Replace compat when stop supporting 3.10 "rich>=15.0,<16.0", "httpx[http2]>=0.28,<1.0", ] [project.urls] repository = "https://github.com/vortico/flama" homepage = "https://flama.dev" documentation = "https://flama.dev/docs/" [project.optional-dependencies] pydantic = ["pydantic>=2.12,<3.0"] typesystem = ["typesystem>=0.4.1,<1.0"] marshmallow = ["marshmallow>=4.0,<5.0", "apispec>=6.0,<7.0"] database = ["SQLAlchemy[asyncio]>=2.0,<3.0"] llm = [ "Pillow>=12.0,<13.0", "soundfile>=0.13,<1.0", "vllm>=0.21,<0.27; sys_platform == 'linux' and python_version >= '3.10' and python_version < '3.14'", "mlx>=0.32,<0.33; sys_platform == 'darwin' and python_version >= '3.10' and python_version < '3.14'", "mlx-lm>=0.31,<0.32; sys_platform == 'darwin' and python_version >= '3.10' and python_version < '3.14'", "mlx-vlm>=0.6.7,<0.7; sys_platform == 'darwin' and python_version >= '3.10' and python_version < '3.14'", ] full = [ "pydantic>=2.12,<3.0", "typesystem>=0.4.1,<1.0", "marshmallow>=4.0,<5.0", "apispec>=6.0,<7.0", "SQLAlchemy[asyncio]>=2.0,<3.0", "Pillow>=12.0,<13.0", "soundfile>=0.13,<1.0", "vllm>=0.21,<0.27; sys_platform == 'linux' and python_version >= '3.10' and python_version < '3.14'", "mlx>=0.32,<0.33; sys_platform == 'darwin' and python_version >= '3.10' and python_version < '3.14'", "mlx-lm>=0.31,<0.32; sys_platform == 'darwin' and python_version >= '3.10' and python_version < '3.14'", "mlx-vlm>=0.6.7,<0.7; sys_platform == 'darwin' and python_version >= '3.10' and python_version < '3.14'", ] [project.scripts] flama = 'flama._cli.__main__:cli' [dependency-groups] dev = [ "maturin>=1.8,<2.0", "pytest>=8.4", "pytest-xdist[psutil]>=3.8", "pytest-cov>=7.0", "pytest-asyncio>=1.2", "ipython>=8.0,<9.0; python_version < '3.11'", "ipython>=9.6; python_version >= '3.11'", "ruff>=0.14.1", "ty>=0.0.30; python_version >= '3.13'", "pre-commit>=4.3", "aiosqlite>=0.21.0,<1.0.0", "Faker>=37.11", "scikit-learn>=1.7.2", "tensorflow>=2.20.0; python_version < '3.14'", "torch>=2.9.0; python_version < '3.14'", "transformers>=4.50", "flama[full]", ] [build-system] requires = ["maturin>=1.8,<2.0"] build-backend = "maturin" [tool.maturin] module-name = "flama._core" manifest-path = "lib/core/Cargo.toml" python-source = "." features = ["pyo3/extension-module"] include = [{ path = "flama/_templates/**/*", format = "wheel" }] [tool.uv] environments = [ "sys_platform == 'darwin' and python_version >= '3.10' and python_version < '3.15'", "sys_platform == 'linux' and python_version >= '3.10' and python_version < '3.15'", "sys_platform == 'win32' and python_version >= '3.10' and python_version < '3.15'", ] [tool.ruff] line-length = 120 exclude = [ ".git", ".pytest_cache", ".mypy_cache", ".ruff_cache", ".venv", "buck-out", "build", "dist", "node_modules", ] [tool.ruff.format] docstring-code-format = true [tool.ruff.lint] select = ["C90", "E", "F", "G", "I", "W", "T", "UP"] ignore = ["E721"] # Allow unused variables when underscore-prefixed. dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" [tool.ruff.lint.per-file-ignores] "__init__.py" = ["E402"] [tool.ruff.lint.mccabe] # Unlike Flake8, default to a complexity level of 10. max-complexity = 10 [tool.ty.src] include = ["flama"] exclude = ["**/node_modules", "**/__pycache__"] [tool.pytest.ini_options] minversion = "3" addopts = "--dist=loadfile --junitxml=./test-results/pytest/results.xml --no-cov-on-fail --cov-report=html --cov-report=xml --cov-report=term-missing --cov-config=pyproject.toml --cov=. --pdbcls=IPython.terminal.debugger:TerminalPdb -nauto --import-mode=importlib" testpaths = ["tests/unit"] norecursedirs = [ "*settings*", "*urls*", "*docs*", "benchmarks", "tests/performance", ] markers = [ "benchmark: performance benchmark tests (deselect with '-m \"not benchmark\"')", ] asyncio_mode = "auto" asyncio_default_fixture_loop_scope = "session" [tool.coverage.run] source = ["flama"] branch = true omit = [ ".venv*", "*settings*", "*__init__.py", "*__main__.py", "tests/*", "flama/compat.py", "flama/_cli/*", "flama/types/*", "flama/*/types.py", "build.py", "*_remote_module_non_scriptable*", ] concurrency = ["thread", "multiprocessing", "greenlet"] [tool.coverage.report] show_missing = true skip_covered = true ignore_errors = true fail_under = 90 exclude_lines = [ "noqa", "pragma: no cover", "pass", "\\.\\.\\.", "raise AssertionError", "raise NotImplementedError", "if 0:", "if __name__ == .__main__.:", "def __repr__", "def __str__", "if cls\\.debug", "if settings\\.DEBUG", "if (typing\\.|t\\.)?TYPE_CHECKING:", ] [tool.ty.analysis] replace-imports-with-any = [ "numpy", "numpy.**", "sklearn", "sklearn.**", "torch", "torch.**", "tensorflow", "tensorflow.**", "keras", "keras.**", "transformers", "transformers.**", "vllm", "vllm.**", "mlx", "mlx.**", "mlx_lm", "mlx_lm.**", "mlx_vlm", "mlx_vlm.**", "PIL", "PIL.**", "huggingface_hub", "huggingface_hub.**", ] [tool.coverage.paths] source = ["./flama/"] [tool.coverage.html] directory = "./test-results/coverage_html/" [tool.coverage.xml] output = "./test-results/coverage.xml" [tool.coverage.json] output = "./test-results/coverage.json"