forked from bentoml/OpenLLM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
412 lines (400 loc) · 12.2 KB
/
pyproject.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
# 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 = "[email protected]" }]
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 = "<!-- towncrier release notes start -->\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"]
known-third-party = ["transformers", "click", "huggingface_hub"]
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_no_return = false
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.*",
"orjson.*",
"git.*",
"httpx.*",
"cloudpickle.*",
"circus.*",
"grpc_health.*",
"transformers.*",
]
[[tool.mypy.overrides]]
ignore_errors = true
module = ["openllm.models.*", "openllm._types", "openllm.playground.*"]