-
Notifications
You must be signed in to change notification settings - Fork 867
Expand file tree
/
Copy pathpyproject.toml
More file actions
429 lines (411 loc) · 11.6 KB
/
Copy pathpyproject.toml
File metadata and controls
429 lines (411 loc) · 11.6 KB
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
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
[build-system]
requires = [
"setuptools>=77,<82",
"setuptools-scm>=8",
]
build-backend = "build_backend"
backend-path = ["."]
[project]
name = "xinference"
description = "Model Serving Made Easy"
readme = "README.md"
authors = [
{ name = "Chris Qin", email = "chris.qin@xinference.co" },
]
maintainers = [
{ name = "Chris Qin", email = "chris.qin@xinference.co" },
]
license = "Apache-2.0"
license-files = ["LICENSE"]
requires-python = ">=3.10"
classifiers = [
"Operating System :: OS Independent",
"Programming Language :: Python",
"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 :: Implementation :: CPython",
"Topic :: Software Development :: Libraries",
]
dynamic = ["version"]
dependencies = [
"xoscar>=0.9.10",
"psutil>=5.9.0",
"torch",
"pillow",
"click<8.2.0",
"tqdm>=4.27",
"tabulate",
"requests",
"aiohttp",
"pydantic",
"fastapi>=0.110.3,<0.137",
"python-multipart>=0.0.18", # required by FastAPI's Form/File/UploadFile params; used to come in transitively via gradio
"orjson", # used by core.utils.json_dumps for all REST API JSON responses; used to come in transitively via gradio
"uvicorn",
"PyYAML",
"huggingface-hub>=0.19.4",
"filelock>=3.30.0", # preserve_lock_file keeps Wan MLX conversion locks stable on Windows
"typing_extensions",
"modelscope>=1.21.0",
"sse_starlette>=1.6.5", # ensure_bytes API break change: https://github.com/sysid/sse-starlette/issues/65
"openai>=1.40.0", # For typing
"anthropic>=0.25.0", # For Anthropic protocol typing & route registration
"python-jose[cryptography]",
"bcrypt>=4.0.0",
"aioprometheus[starlette]>=23.12.0",
"httpx",
"nvidia-ml-py",
"pynvml>=12",
"async-timeout",
# peft 0.17.1 and below import HybridCache at module level, which was
# removed in transformers 5.0.0. peft declares an unbounded transformers
# requirement, so pinning it low silently breaks any transformers 5.x
# install (see the sentence-transformers rerank import chain).
"peft>=0.18.0",
"timm",
"setproctitle",
"uv",
]
[project.urls]
Homepage = "https://github.com/xorbitsai/inference"
[project.scripts]
xinference = "xinference.deploy.cmdline:cli"
xinference-local = "xinference.deploy.cmdline:local"
xinference-supervisor = "xinference.deploy.cmdline:supervisor"
xinference-worker = "xinference.deploy.cmdline:worker"
xinference-router = "xinference.deploy.router:main"
xinference-router-agent = "xinference.deploy.router_agent:main"
xinference-migrate-auth = "xinference.api.oauth2.advanced.migrate:main"
xinference-reset-auth-password = "xinference.api.oauth2.advanced.reset_password:main"
[project.entry-points."vllm.general_plugins"]
xinference_navidc_ocr = "xinference.thirdparty.navidc_ocr:register"
[project.optional-dependencies]
dev = [
"cython>=0.29",
"pytest>=3.5.0",
"pytest-cov>=2.5.0",
"pytest-timeout>=1.2.0",
"pytest-forked>=1.0",
"pytest-asyncio>=0.14.0",
"pytest-mock>=3.11.1",
"ipython>=6.5.0",
"sphinx>=3.0.0",
"pydata-sphinx-theme>=0.3.0",
"sphinx-intl>=0.9.9",
"jieba>=0.42.0",
"ruff",
"black",
"openai>=1.40.0",
"anthropic",
"langchain",
"langchain-community",
"langchain-openai",
"sphinx-tabs",
"sphinx-design",
"pypdfium2", # For PDF OCR tests
"tomli; python_version < '3.11'",
]
otel = [
"opentelemetry-api>=1.20.0",
"opentelemetry-sdk>=1.20.0",
"opentelemetry-exporter-otlp-proto-http>=1.20.0",
"opentelemetry-exporter-otlp-proto-grpc>=1.20.0",
"opentelemetry-instrumentation-fastapi>=0.41b0",
"opentelemetry-instrumentation-httpx>=0.41b0",
]
router = [
"tokenizers>=0.21.0,<0.23.0",
]
all = [
"xinference[anthropic]",
"xinference[llama_cpp]",
"xinference[transformers]",
"xinference[vllm]",
"xinference[mlx]",
"xinference[embedding]",
"xinference[rerank]",
"xinference[image]",
"xinference[video]",
"xinference[audio]",
"xinference[router]",
]
intel = [
"torch==2.1.0a0",
"intel_extension_for_pytorch==2.1.10+xpu",
]
llama_cpp = [
"xllamacpp>=0.2.0",
]
transformers = [
"transformers>=4.53.3",
"torch",
"accelerate>=0.28.0",
"sentencepiece",
"transformers_stream_generator",
"bitsandbytes ; sys_platform=='linux'",
"protobuf",
"einops",
"tiktoken",
"optimum",
"attrdict", # For deepseek VL
"timm>=0.9.16", # For deepseek VL
"torchvision", # For deepseek VL
"peft",
"eva-decord", # For video in VL
"jj-pytorchvideo", # For CogVLM2-video
"qwen-vl-utils!=0.0.9", # For qwen2-vl
"qwen_omni_utils", # For qwen2.5-omni
"audioread", # Undeclared runtime dependency of qwen_omni_utils
"datamodel_code_generator", # for minicpm-4B
"jsonschema", # for minicpm-4B
"blobfile", # for moonlight-16b-a3b
]
transformers_quantization = [
"bitsandbytes ; sys_platform=='linux'",
"gptqmodel",
"autoawq!=0.2.6 ; sys_platform!='darwin'", # autoawq 0.2.6 pinned torch to 2.3
"datasets>=3.4.0", # see GH#3934
]
vllm = [
"vllm>=0.2.6 ; sys_platform=='linux'",
"xxhash",
]
sglang = [
"sglang[srt]>=0.4.2.post4 ; sys_platform=='linux'",
]
mlx = [
"mlx-lm>=0.21.5 ; sys_platform=='darwin' and platform_machine=='arm64'",
"mlx-vlm>=0.3.4 ; sys_platform=='darwin' and platform_machine=='arm64'",
"mlx-whisper ; sys_platform=='darwin' and platform_machine=='arm64'",
"f5-tts-mlx ; sys_platform=='darwin' and platform_machine=='arm64'",
"mlx-audio ; sys_platform=='darwin' and platform_machine=='arm64'",
"qwen_vl_utils!=0.0.9",
"tomli",
]
embedding = [
"sentence-transformers>=3.1.0,<6",
"FlagEmbedding",
"datasets>=3.4.0", # see GH#3934
]
rerank = [
"FlagEmbedding",
"datasets>=3.4.0", # see GH#3934
]
image = [
"diffusers>=0.32.0", # fix conflict with matcha-tts
"controlnet_aux",
"deepcache",
"verovio>=4.3.1", # For got_ocr2
"transformers>=4.53.3", # For got_ocr2
"tiktoken>=0.6.0", # For got_ocr2
"accelerate>=0.28.0", # For got_ocr2
"torch", # For got_ocr2
"torchvision", # For got_ocr2
"gguf", # For flux and sd3.5 series
"pypdfium2", # For PDF input on the OCR API
]
video = [
"diffusers>=0.32.0",
"imageio-ffmpeg",
]
audio = [
"funasr==1.2.7",
"omegaconf~=2.3.0",
"nemo_text_processing<=1.1.0; sys_platform == 'linux'", # 1.1.0 requires pynini==2.1.6.post1
"WeText",
"librosa",
"xxhash",
"torch>=2.0.0", # for CosyVoice, matcha
"torchaudio>=2.0.0",
"ChatTTS>=0.2.1",
"tiktoken", # For CosyVoice, openai-whisper
"lightning>=2.0.0", # For CosyVoice, matcha
"hydra-core>=1.3.2", # For CosyVoice, matcha
"inflect", # For CosyVoice, matcha
"conformer", # For CosyVoice, matcha
"diffusers>=0.32.0", # For CosyVoice, matcha
"gdown", # For CosyVoice, matcha
"pyarrow", # For CosyVoice, matcha
"HyperPyYAML", # For CosyVoice
"onnxruntime>=1.16.0", # For CosyVoice, use onnxruntime-gpu==1.16.0 if possible
"pyworld>=0.3.4", # For CosyVoice
"loguru", # For Fish Speech
"natsort", # For Fish Speech
"loralib", # For Fish Speech
"ormsgpack", # For Fish Speech
"cachetools", # For Fish Speech
"silero-vad", # For Fish Speech
"vector-quantize-pytorch<=1.17.3,>=1.14.24", # For Fish Speech
"torchdiffeq", # For F5-TTS
"x_transformers>=1.31.14", # For F5-TTS
"pypinyin", # For F5-TTS
"tomli", # For F5-TTS
"vocos", # For F5-TTS
"librosa", # For F5-TTS
"jieba", # For F5-TTS
"pydub", # For F5-TTS & MegaTTS3; used to come in transitively via gradio
"soundfile", # For F5-TTS & MeloTTS & Kokoro
"cached_path", # For MeloTTS
"unidic-lite", # For MeloTTS, unidic requires manually download
"cn2an", # For MeloTTS
"mecab-python3", # For MeloTTS
"num2words", # For MeloTTS
"pykakasi", # For MeloTTS
"fugashi", # For MeloTTS
"g2p_en", # For MeloTTS
"anyascii", # For MeloTTS
"gruut[de,es,fr]", # For MeloTTS
"kokoro>=0.7.15", # Kokoro, already included misaki[en]
"misaki[en,zh]>=0.7.15", # Kokoro
"langdetect", # MegaTTS3
"pyloudnorm", # MegaTTS3
"json5", # IndexTTS2
"munch", # IndexTTS2
"matplotlib", # IndexTTS2
"flatten_dict", # IndexTTS2
"julius", # IndexTTS2
"tensorboard", # IndexTTS2
"randomname", # IndexTTS2
"argbind", # IndexTTS2
"ffmpy", # IndexTTS2 (audiotools' core.ffmpeg imports this unconditionally); used to come in transitively via gradio
]
doc = [
"ipython>=6.5.0",
"sphinx>=3.0.0",
"pydata-sphinx-theme>=0.3.0",
"sphinx-intl>=0.9.9",
"sphinx-tabs",
"sphinx-design",
"prometheus_client",
"timm",
]
musa = [
"mthreads-ml-py>=2.2.8",
"torchada>=0.1.11",
]
benchmark = [
"psutil",
]
anthropic = [
"anthropic", # no-op: anthropic is now a core dependency, kept for backward compatibility
]
[tool.setuptools]
zip-safe = false
include-package-data = true
[tool.setuptools.packages.find]
# Plain packages only; namespace discovery would sweep in top-level
# directories such as doc/, frontend/ and benchmark/.
namespaces = false
include = ["xinference*"]
exclude = [
"*.conftest*",
"*.tests.*",
"*.tests",
]
[tool.setuptools_scm]
version_file = "xinference/_version.py"
# must stay a numeric three-part release: bdist_wheel fails on values
# like "0+unknown" when building without any git metadata (e.g. the
# Dockerfile's dependency-skeleton layer)
fallback_version = "0.0.0+unknown"
[tool.black]
include = '\.pyi?$'
extend-exclude = '''
/(
| ^/xinference/(_version.py)
| thirdparty
)/
'''
[tool.pytest.ini_options]
asyncio_mode = "auto"
[tool.coverage.run]
branch = true
relative_files = true
cover_pylib = false
plugins = ["Cython.Coverage"]
include = ["xinference/*"]
omit = [
"xinference/_version.py",
"*.pxd",
"*/tests/*",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"raise AssertionError",
"raise NotImplementedError",
"return NotImplemented",
]
[tool.isort]
profile = "black"
skip = ["thirdparty"]
[tool.mypy]
ignore_missing_imports = true
follow_imports = "skip"
exclude = "thirdparty"
[tool.codespell]
ignore-words-list = "hist,rcall,fpr,ser,nd,inout,ot,Ba,ba,asend,hart,coo,splitted,datas,fro,te"
skip = ".idea,.git,./build,./docs/build,node_modules,static,generated,*.po,*.ts,*.json,*.c,*.cpp,*.cfg,thirdparty"
[tool.ruff]
line-length = 100
# Mirrors the old flake8 `exclude` list from setup.cfg.
extend-exclude = [
"__init__.py",
"xinference/thirdparty",
"xinference/_version.py",
".github",
"build",
"ci",
"dist",
"docs",
]
[tool.ruff.lint]
preview = true
# Equivalent of the flake8 `select` list previously in setup.cfg.
# E901/E999 are omitted (ruff always reports syntax errors); E127 and the
# long-deprecated W601-W604 checks have no ruff counterpart.
select = [
"E101",
"E111",
"E117",
"E201",
"E202",
"E223",
"E224",
"E225",
"E231",
"E242",
"E251",
"E273",
"E274",
"E275",
"E301",
"E302",
"E303",
"E304",
"E305",
"E401",
"E703",
"E902",
"F401",
"F63",
"F7",
"F811",
"F821",
"F822",
"F823",
"F841",
"W191",
"W291",
"W292",
"W293",
"W391",
"W605",
]
[tool.ruff.lint.per-file-ignores]
# Sphinx injects the `tags` global when executing conf.py.
"doc/source/conf.py" = ["F821"]