[project] name = "agentlightning" version = "0.3.1" description = "Agent-lightning is the absolute trainer to light up AI agents." readme = "README.md" requires-python = ">=3.10" dependencies = [ "graphviz", "psutil", "gpustat", "setproctitle", "flask", "agentops>=0.4.13", "uvicorn", "fastapi", "aiohttp", "opentelemetry-api>=1.35", "opentelemetry-sdk>=1.35", "opentelemetry-exporter-otlp>=1.35", "litellm[proxy]>=1.74", "pydantic>=2.11", "openai", "rich", "portpicker", "gunicorn", "uvicorn_worker", "aiologic", ] [project.optional-dependencies] apo = [ "poml", ] # It's not recommended to use agentlightning[verl] to install VERL and its dependencies. # though it's listed here for completeness. verl = [ "verl>=0.5.0", "vllm>=0.8.4", # Due to interface change of ExternalZeroMQDistributedExecutor ] weave = [ "weave>=0.52.22", ] # Store-related dependencies. mongo = [ "pymongo", ] [project.scripts] agl = "agentlightning.cli:main" [dependency-groups] dev = [ "flake8", "pytest", "hatch", "pytest-asyncio", "pre-commit", "pytest-rerunfailures", "black", "isort", "pyright", "mkdocs", "mkdocs-material", "mkdocstrings[python]", "mike", "mkdocs-git-revision-date-localized-plugin", "mkdocs-git-authors-plugin", "mkdocs-macros-plugin", "mkdocs-autorefs", "prometheus-client", ] experiment = [ "random-word", "gdown", ] core-legacy = [ "agentops<=0.4.18", "openai<2.0.0", ] core-stable = [ "agentops>=0.4.21", "openai>=2.0.0", ] # For PyTorch. # CPU and GPU groups. torch-cpu = [ "torch", "torchvision", ] torch-cu128 = [ "torch", "torchvision", ] # Training-heavy dependencies. torch-stable = [ {include-group = "core-stable"}, # This can work for both CPU and GPU. "torch>=2.8.0", "torchvision>=0.23.0", # https://github.com/huggingface/transformers/issues/42369 "transformers>=4.55.0,!=4.57.2", # vLLM 0.11.1 requires PyTorch 2.9.0, which is incompatible with flash-attn # https://github.com/Dao-AILab/flash-attention/issues/1967 # Similar issues with vLLM 0.11.2 and 0.12.0 "vllm>=0.10.2,!=0.11.1,!=0.11.2,!=0.12.0", # LiteLLM can then be upgraded with new vLLM "litellm[proxy]>=1.78", ] torch-legacy = [ {include-group = "core-legacy"}, # This can work for both CPU and GPU. "torch==2.7.0", "torchvision==0.22.0", "transformers==4.53.3", "tokenizers>=0.21,<0.22", "vllm==0.9.2", "litellm[proxy]==1.74.15", ] # Specific vllm versions for compatibility testing or workarounds. # Use these when you need a pinned vllm version separate from torch groups. vllm-0-10-2 = [ {include-group = "torch-stable"}, "vllm==0.10.2", ] vllm-0-11-0 = [ {include-group = "torch-stable"}, "vllm==0.11.0", ] # Flash-attention must build with CUDA toolkit. # Use this instead of --group torch-stable --group torch-gpu torch-gpu-stable = [ {include-group = "torch-stable"}, {include-group = "torch-cu128"}, "flash-attn>=2.8.3", "tensordict>=0.9.1", "verl>=0.6.0", ] # Use this instead of --group torch-legacy --group torch-gpu torch-gpu-legacy = [ {include-group = "torch-legacy"}, {include-group = "torch-cu128"}, "flash-attn==2.8.1", "verl==0.5.0", ] # For the TRL/Unsloth example. trl = [ # Only work with PyTorch 2.8.0+. {include-group = "torch-stable"}, # https://github.com/unslothai/unsloth/issues/3451 "unsloth>=2025.10.1,!=2025.10.2,!=2025.10.3,!=2025.10.4,!=2025.10.5,!=2025.10.6,!=2025.10.7,!=2025.10.8", "unsloth_zoo>=2025.10.1,!=2025.10.2,!=2025.10.3,!=2025.10.4,!=2025.10.5,!=2025.10.6,!=2025.10.7,!=2025.10.8", "bitsandbytes", "peft", "datasets", "transformers", "trl", "kernels", "vllm", ] # For Tinker integration. tinker = [ {include-group = "torch-stable"}, "tinker>=0.2.2", "tinker_cookbook>=0.1.0", "wandb", ] # For Multi-modality supports. image = [ # NOTE: It's tied to vLLM 0.10.2 but it will blow the uv.lock file if we include it. # {include-group = "vllm-0-10-2"}, "datasets", "Pillow", "pandas", "pyarrow", "qwen-vl-utils", ] # Agent-related dependencies. autogen = [ "autogen-agentchat", "autogen-ext[openai]", "mcp>=1.10.0", # UV is required now by default. # No need to include UV here. # "uv", ] openai-agents = [ "openai-agents", "openai", # Compatibility issues with the latest version of OpenAI, temporarily fixed version # Issue: https://github.com/openai/openai-agents-python/issues/2038 "mcp", # Required by AOAI FT example. "pandas", ] anthropic = [ "anthropic", ] langchain = [ "langgraph>=1.0.0", "langchain[openai]>=1.0.0", "langchain-community>=0.4.0", "langchain-text-splitters>=1.0.0", ] sql = [ "sqlparse", "nltk", ] rag = [ "fastmcp>=2.13.1", "faiss-cpu>=1.11.0", "sentence-transformers>=4.1.0", ] crewai = [ # https://github.com/crewAIInc/crewAI/issues/3959 "crewai[tools]>=1.2.0,!=1.2.1,!=1.3.0,!=1.4.0,!=1.4.1,!=1.5.0", ] swebench = [ "swebench", ] # Summarize into large installable groups. # Note: langchain is excluded from agents to avoid conflicts with torch-legacy. # Use --group langchain explicitly when needed. agents = [ {include-group = "autogen"}, {include-group = "openai-agents"}, {include-group = "sql"}, {include-group = "anthropic"}, {include-group = "crewai"}, {include-group = "swebench"}, ] [tool.uv] required-version = ">=0.9.9" conflicts = [ [ { group = "core-legacy" }, { group = "core-stable" }, ], [ { group = "torch-cpu" }, { group = "torch-cu128" }, ], [ { group = "torch-stable" }, { group = "torch-legacy" }, ], [ { group = "vllm-0-10-2" }, { group = "vllm-0-11-0" }, ], # langchain >= 1.0 requires openai >= 1.109.1 (via langchain-openai), # but torch-legacy uses vllm==0.9.2 which requires openai<=1.90.0 [ { group = "langchain" }, { group = "torch-legacy" }, ], ] environments = [ "sys_platform == 'linux'", ] dependency-metadata = [ # Patch the dependencies of instructor to unpin "openai". # This is a workaround for https://github.com/567-labs/instructor/issues/1852 { name = "instructor", version = "1.11.3", requires-dist = ["openai", "pydantic", "docstring-parser", "typer", "rich", "aiohttp", "tenacity", "pydantic-core", "jiter", "jinja2", "requests", "diskcache"] }, ] override-dependencies = [ # A conflict between the dependency of litellm[proxy] and crewai[tools] "mcp>=1.19.0", "uvicorn>=0.38.0", # Conflicts between packaging dependency of pyvers (dependency of tensordict) and agentops. "packaging>=24.0", # Conflicts between litellm and fastmcp "websockets>=15.0.1", "rich>=13.9.4", # verl's numpy<2.0.0 constraint is related to Docker images, not code incompatibility # Lock to 2.3.0 because numba relies on numpy 2.2 "numpy>=2.0.0,<2.3.0", # vllm relies on setuptools<80, but polyfile-weave depends on setuptools>=80.9.0 "setuptools>=80.9.0", ] [tool.uv.sources] torch = [ { index = "pytorch-cu128", group = "torch-cu128" }, { index = "pytorch-cpu", group = "torch-cpu" }, ] [[tool.uv.index]] name = "pypi" url = "https://pypi.org/simple" [[tool.uv.index]] name = "pytorch-cu128" url = "https://download.pytorch.org/whl/cu128" [[tool.uv.index]] name = "pytorch-cpu" url = "https://download.pytorch.org/whl/cpu" [tool.uv.extra-build-dependencies] flash-attn = [ { requirement = "torch", match-runtime = true }, ] [tool.uv.dependency-groups] tinker = {requires-python = ">=3.11"} [build-system] requires = ["hatchling"] build-backend = "hatchling.build" [tool.hatch.build.targets.wheel] packages = ["agentlightning"] include = [ "agentlightning/**/*.yaml", "agentlightning/**/*.yml", "agentlightning/**/*.poml", ] artifacts = [ "agentlightning/dashboard/**", ] [tool.hatch.build.targets.sdist] exclude = [ "/examples/**", "/tests/**", "/docs/**", "/scripts/**", "/dashboard/**", "/docker/**", "/contrib/**", "/.github/**", ] artifacts = [ "agentlightning/dashboard/**", ] [tool.pytest.ini_options] testpaths = ["tests"] markers = [ "openai: tests that require OpenAI API", "gpu: tests that require GPU", "agentops: tests that require AgentOps", "weave: tests that require Weave", "llmproxy: tests that require LiteLLM", "mongo: tests that require MongoDB", "store: tests for agentlightning.store module", "prometheus: tests that require Prometheus", "utils: tests for utility functions", "langchain: tests that require LangChain", ] [tool.black] line-length = 120 target-version = ['py312'] include = '\.pyi?$' extend-exclude = ''' /( _version\.py ) ''' [tool.isort] profile = "black" line_length = 120 known_first_party = ["agentlightning"] extend_skip_glob = [ "data/**", "_version.py", ]