# NOTE: The following are managed by ./tools/dependencies.py # project.classifiers, project.dependencies, project.optional-dependencies, project.urls [build-system] build-backend = "hatchling.build" requires = ["hatchling", "hatch-vcs", "hatch-fancy-pypi-readme"] [project] authors = [{ name = "Aaron Pham", email = "aarnphm@bentoml.com" }] classifiers = [ "Development Status :: 5 - Production/Stable", "Environment :: GPU :: NVIDIA CUDA", "Environment :: GPU :: NVIDIA CUDA :: 12", "Environment :: GPU :: NVIDIA CUDA :: 11.8", "Environment :: GPU :: NVIDIA CUDA :: 11.7", "License :: OSI Approved :: Apache Software License", "Topic :: Scientific/Engineering :: Artificial Intelligence", "Topic :: Software Development :: Libraries", "Operating System :: OS Independent", "Intended Audience :: Developers", "Intended Audience :: Science/Research", "Intended Audience :: System Administrators", "Typing :: Typed", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", ] dependencies = [ "bentoml[grpc,io]>=1.0.25", "transformers[torch,tokenizers,accelerate]>=4.29.0", "safetensors", "optimum", "attrs>=23.1.0", "cattrs>=23.1.0", "orjson", "inflection", "tabulate[widechars]>=0.9.0", "httpx", "click>=8.1.6", "typing_extensions", "GitPython", "cuda-python;platform_system!=\"Darwin\"", "bitsandbytes<0.42", ] description = 'OpenLLM: Operating LLMs in production' dynamic = ["version", "readme"] keywords = [ "MLOps", "AI", "BentoML", "Model Serving", "Model Deployment", "LLMOps", "Large Language Model", "Generative AI", "StableLM", "Alpaca", "PyTorch", "Transformers", ] license = "Apache-2.0" name = "openllm" requires-python = ">=3.8" [project.scripts] openllm = "openllm.cli.entrypoint:cli" openllm-build-base-container = "openllm.cli.ext.build_base_container:cli" openllm-dive-bentos = "openllm.cli.ext.dive_bentos:cli" openllm-get-containerfile = "openllm.cli.ext.get_containerfile:cli" openllm-get-prompt = "openllm.cli.ext.get_prompt:cli" openllm-list-bentos = "openllm.cli.ext.list_bentos:cli" openllm-list-models = "openllm.cli.ext.list_models:cli" [project.urls] Blog = "https://modelserving.com" Chat = "https://discord.gg/openllm" Documentation = "https://github.com/bentoml/openllm#readme" GitHub = "https://github.com/bentoml/openllm" History = "https://github.com/bentoml/openllm/blob/main/CHANGELOG.md" Homepage = "https://bentoml.com" Tracker = "https://github.com/bentoml/openllm/issues" Twitter = "https://twitter.com/bentomlai" [project.optional-dependencies] agents = ["transformers[agents]>=4.30", "diffusers", "soundfile"] all = [ "openllm[agents]", "openllm[baichuan]", "openllm[chatglm]", "openllm[falcon]", "openllm[fine-tune]", "openllm[flan-t5]", "openllm[ggml]", "openllm[gptq]", "openllm[llama]", "openllm[mpt]", "openllm[openai]", "openllm[opt]", "openllm[playground]", "openllm[starcoder]", "openllm[vllm]", ] baichuan = ["cpm-kernels", "sentencepiece"] chatglm = ["cpm-kernels", "sentencepiece"] falcon = ["einops", "xformers"] fine-tune = ["peft>=0.4.0", "bitsandbytes", "datasets", "accelerate", "trl"] flan-t5 = ["flax", "jax", "jaxlib", "tensorflow", "keras"] ggml = ["ctransformers"] gptq = ["auto-gptq[triton]"] llama = ["fairscale", "sentencepiece"] mpt = ["triton", "einops"] openai = ["openai", "tiktoken"] opt = ["flax", "jax", "jaxlib", "tensorflow", "keras"] playground = ["jupyter", "notebook", "ipython", "jupytext", "nbformat"] starcoder = ["bitsandbytes"] vllm = ["vllm", "ray"] [tool.towncrier] directory = "changelog.d" filename = "CHANGELOG.md" issue_format = "[#{issue}](https://github.com/bentoml/openllm/issues/{issue})" name = "openllm" start_string = "\n" template = "changelog.d/template.md.jinja" title_format = "" underlines = ["", "", ""] [[tool.towncrier.section]] path = "" [[tool.towncrier.type]] directory = "breaking" name = "Backwards-incompatible Changes" showcontent = true [[tool.towncrier.type]] directory = "deprecation" name = "Deprecations" showcontent = true [[tool.towncrier.type]] directory = "change" name = "Changes" showcontent = true [[tool.towncrier.type]] directory = "feature" name = "Features" showcontent = true [[tool.towncrier.type]] directory = "fix" name = "Bug fix" showcontent = true [tool.interrogate] fail-under = 100 verbose = 2 whitelist-regex = ["test_.*"] [tool.pytest.ini_options] addopts = ["-rfEX", "-pno:warnings", "--snapshot-warn-unused"] python_files = ["test_*.py", "*_test.py"] testpaths = ["tests"] [tool.ruff] extend-exclude = [ "tools", "src/openllm/playground", "src/openllm/models", "src/openllm/_types.py", "src/openllm/_version.py", ] extend-include = ["*.ipynb"] extend-select = [ "B", # flake8-bugbear "I", # isort "G", # flake8-logging-format "D", # pydocstyle "W", # pycodestyle "Q", # flake8-quotes "FA", # flake8-future-annotations "S", # flake8-bandit "TCH", # flake8-type-checking "PLW", # pylint-warning "PLR", # pylint-refactor "PT", # flake8-pytest-style "PYI", # flake8-pyi "PERF", # perflint "FLY", # flynt "RUF", # Ruff-specific rules "YTT", # flake8-2020 ] fix = true ignore = [ "B027", # Allow non-abstract empty methods in abstract base classes "FBT003", # Allow boolean positional values in function calls, like `dict.get(... True)` "S105", # Ignore checks for possible passwords "S106", "S107", "S603", # ignore subprocess.call "PLR0911", "PLR0912", "PLR0913", "PLR0915", "PLR2004", # magic value to use constant "E501", # ignore line length violation "E702", "PYI021", # ignore docstring in stubs, as pyright will include docstring in stubs. "D103", # Just missing docstring for magic methods. "D102", "D101", "D100", "TCH004", # don't move runtime import out, just warn about it "RUF012", # mutable attributes to be used with ClassVar "B905", # zip warning about strict, only applicable for 3.10+ "D105", # magic docstring "E701", # multiple statement on single line ] line-length = 119 target-version = "py312" unfixable = [ "F401", # Don't touch unused imports, just warn about it. "TCH004", # Don't touch import outside of TYPE_CHECKING block "RUF100", # unused noqa, just warn about it ] [tool.ruff.flake8-type-checking] exempt-modules = ["typing", "typing_extensions", "."] runtime-evaluated-base-classes = [ "pydantic.BaseModel", "openllm._configuration.LLMConfig", "openllm._configuration.GenerationConfig", "openllm._configuration.ModelSettings", ] runtime-evaluated-decorators = ["attrs.define", "attrs.frozen"] [tool.ruff.pydocstyle] convention = "google" [tool.ruff.pycodestyle] ignore-overlong-task-comments = true [tool.ruff.isort] force-single-line = true known-first-party = ["openllm", "bentoml", 'transformers'] lines-after-imports = 1 no-lines-before = ["future", "standard-library"] relative-imports-order = "closest-to-furthest" [tool.ruff.flake8-quotes] avoid-escape = false [tool.ruff.extend-per-file-ignores] # Tests can use magic values, assertions, and relative imports "__init__.py" = ["E402", "F401", "F403", "F811"] "examples/**/*" = ["D"] "src/openllm/_service.py" = ["I001", "E401"] "src/openllm/cli/entrypoint.py" = ["D301"] "src/openllm/utils/dummy_*" = ["D107"] "src/openllm/utils/import_utils.py" = ["PLW0603"] "src/openllm_client/runtimes/*" = ["D107"] "tests/**/*" = [ "S101", "TID252", "D", # No docstring in tests "PT011", # ignore too broad raises, as it can be use pytest.raises().match() "S307", # Ignore eval(compile) as it is a known script execution ] "typings/**/*" = ["D", "F", "E", "PYI002"] [tool.yapf] ALIGN_CLOSING_BRACKET_WITH_VISUAL_INDENT = true ALLOW_MULTILINE_DICTIONARY_KEYS = false ALLOW_MULTILINE_LAMBDAS = false ALLOW_SPLIT_BEFORE_DEFAULT_OR_NAMED_ASSIGNS = false ALLOW_SPLIT_BEFORE_DICT_VALUE = false ARITHMETIC_PRECEDENCE_INDICATION = true BLANK_LINES_AROUND_TOP_LEVEL_DEFINITION = 1 BLANK_LINES_BETWEEN_TOP_LEVEL_IMPORTS_AND_VARIABLES = 1 BLANK_LINE_BEFORE_CLASS_DOCSTRING = false BLANK_LINE_BEFORE_MODULE_DOCSTRING = false BLANK_LINE_BEFORE_NESTED_CLASS_OR_DEF = false COALESCE_BRACKETS = true COLUMN_LIMIT = 384 CONTINUATION_ALIGN_STYLE = "VALIGN-RIGHT" DEDENT_CLOSING_BRACKETS = true DISABLE_ENDING_COMMA_HEURISTIC = true EACH_DICT_ENTRY_ON_SEPARATE_LINE = false INDENT_BLANK_LINES = false INDENT_CLOSING_BRACKETS = false INDENT_WIDTH = 2 JOIN_MULTIPLE_LINES = true NO_SPACES_AROUND_SELECTED_BINARY_OPERATORS = true SPACES_AROUND_SUBSCRIPT_COLON = false SPACE_BETWEEN_ENDING_COMMA_AND_CLOSING_BRACKET = false SPACE_INSIDE_BRACKETS = false SPLIT_ALL_COMMA_SEPARATED_VALUES = false SPLIT_ALL_TOP_LEVEL_COMMA_SEPARATED_VALUES = false SPLIT_ARGUMENTS_WHEN_COMMA_TERMINATED = false SPLIT_BEFORE_BITWISE_OPERATOR = false SPLIT_BEFORE_CLOSING_BRACKET = false SPLIT_BEFORE_DICT_SET_GENERATOR = false SPLIT_BEFORE_DOT = false SPLIT_BEFORE_EXPRESSION_AFTER_OPENING_PAREN = false SPLIT_BEFORE_FIRST_ARGUMENT = false SPLIT_BEFORE_LOGICAL_OPERATOR = false SPLIT_BEFORE_NAMED_ASSIGNS = false SPLIT_COMPLEX_COMPREHENSION = false SPLIT_PENALTY_AFTER_OPENING_BRACKET = 10000 SPLIT_PENALTY_BEFORE_IF_EXPR = 10000 SPLIT_PENALTY_COMPREHENSION = 3000 SPLIT_PENALTY_FOR_ADDED_LINE_SPLIT = 8000 [tool.coverage.paths] openllm = ["src/openllm", "*/openllm/src/openllm"] [tool.coverage.run] branch = true omit = [ "__pypackages__/*", "src/openllm/_version.py", "src/openllm/playground/", "src/openllm/__init__.py", "src/openllm/__main__.py", "src/openllm/utils/dummy_*.py", ] source_pkgs = ["openllm"] [tool.coverage.report] exclude_lines = [ "no cov", "pragma: no cover", "if __name__ == .__main__.:", "if t.TYPE_CHECKING:", 'if TYPE_CHECKING:', 'if typing.TYPE_CHECKING:', 'if t.TYPE_CHECKING and not MYPY:', 'if DEBUG:', 'if utils.DEBUG', 'if openllm.utils.DEBUG', '@_overload', '@overload', '@t.overload', '@typing.overload', 'raise NotImplementedError', 'raise NotImplemented', 'except MissingDependencyError:', ] omit = [ "__pypackages__/*", "src/openllm/_version.py", "src/openllm/playground/", "src/openllm/__init__.py", "src/openllm/__main__.py", "src/openllm/utils/dummy_*.py", ] precision = 2 show_missing = true [tool.pyright] analysis.useLibraryCodeForTypes = true exclude = [ "__pypackages__/*", "src/openllm/playground/", "src/openllm/__init__.py", "src/openllm/__main__.py", "src/openllm/utils/dummy_*.py", "src/openllm/models", "tools", "examples", "tests", ] include = ["src/openllm", "src/openllm_client"] pythonVersion = "3.12" reportMissingImports = "warning" reportMissingTypeStubs = false reportPrivateUsage = "warning" reportUnknownArgumentType = "warning" reportUnknownMemberType = "warning" reportUnknownVariableType = "warning" typeCheckingMode = "strict" [tool.mypy] # TODO: Enable model for strict type checking exclude = ["src/openllm/playground/", "src/openllm/utils/dummy_*.py", "src/openllm/models"] files = ["src/openllm", "src/openllm_client"] local_partial_types = true mypy_path = "typings" pretty = true python_version = "3.11" show_error_codes = true strict = true warn_return_any = false warn_unreachable = true warn_unused_ignores = true [[tool.mypy.overrides]] ignore_missing_imports = true module = [ "IPython.*", "numpy.*", "tensorflow.*", "torch.*", "optimum.*", "inflection.*", "huggingface_hub.*", "peft.*", "auto_gptq.*", "vllm.*", "orjson.*", "git.*", "httpx.*", "cloudpickle.*", "circus.*", "grpc_health.*", "transformers.*", ] [[tool.mypy.overrides]] ignore_errors = true module = ["openllm.models.*", "openllm._types", "openllm.playground.*"]