Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
142 lines (135 loc) · 6.2 KB
/
Copy pathpyproject.toml
File metadata and controls
142 lines (135 loc) · 6.2 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
[build-system]
requires = [
"setuptools>=69", "wheel",
"cmake>=3.27; sys_platform == 'darwin' and platform_machine == 'arm64'",
"mlx==0.32.2; sys_platform == 'darwin' and platform_machine == 'arm64'",
"nanobind==2.15.0; sys_platform == 'darwin' and platform_machine == 'arm64'",
]
build-backend = "setuptools.build_meta"
[project]
name = "mtplx"
version = "2.13.2"
description = "Native MTP speculative decoding for Qwen3-Next on Apple Silicon."
readme = "README.md"
requires-python = ">=3.11"
license = "Apache-2.0"
license-files = ["LICENSE", "NOTICE"]
authors = [{name = "Youssof Altoukhi", email = "business@youssofal.com"}]
dependencies = [
"fastapi>=0.136",
"huggingface-hub>=0.36",
# Vision is advertised on the base install (app attachments, image_url on
# the server) and mtplx.vision.processing imports PIL at module load, so
# Pillow must be a base dependency, not a [server] extra (#103).
# Exactly the major the vision gates ran on (2.13: 13.0.0 in every Inkling
# environment and the reference parity). Pillow 12.3 -> 13 changed the
# pixels of images the grid rounding enlarges (Pi's 1500x1420 screenshot:
# 5.5% of values, up to 11/255), so pip, Homebrew and the app install the
# tested major, and an app runtime on 12.x converges at its next update
# (pip upgrades only what fails the requirement), as the MLX pin does.
"pillow>=13,<14",
# 0.32.0 exactness-gated 2026-07-11: byte-identical greedy 128-tok output
# vs 0.31.3 on Optimized-Speed q4 turbo D3 (same 34 verify calls), and 103
# kernel/paged-verifier/graphbank/sustained tests green under 0.32.0.
# Floor raised to 0.32 in 2.5.2: fresh installs already resolve 0.32.0,
# but existing venvs sat on 0.31.2 forever because the app bootstrapper's
# -U uses pip's only-if-needed strategy. Raising the floor converges every
# install to the stack new installs already run (and the 2026-08-04
# long-generation runs consistently read faster on 0.32.0).
# Floor raised to 0.32.2 in 2.9.3: clean shipped-wheel A/B on M5 Max
# (2026-08-26, MEASUREMENTS 07:20) measured 0.32.0 -> 0.32.2 at +29%
# decode / +41% prefill @88.4k and +31% @16k — same wheel, same flags,
# only mlx differs. A 0.32.0 venv silently forfeits that; converge it.
# Pinned to exactly 0.32.2 (2026-09-29): 0.32.3 decodes at the same speed,
# but its output is not bit-identical to 0.32.2 on Flash-Next, and the app
# bundles 0.32.2, so pip and Homebrew now install what the app runs.
"mlx==0.32.2; sys_platform == 'darwin' and platform_machine == 'arm64'",
"mlx-lm>=0.31,<0.32; sys_platform == 'darwin' and platform_machine == 'arm64'",
# transformers 5.13.0 changed AutoTokenizer.register to require a config
# class as the key; mlx-lm 0.31.x still registers by name
# ("NewlineTokenizer") and crashes at import, killing every fresh install
# at model load (#136, #135; PR #137 by @davidtai). 5.13.1 restored
# compatibility (verified 2026-07-11: mlx-lm 0.31.3 import + real Speed-q4
# tokenizer load + chat template green on 5.13.1; 5.13.0 still crashes),
# so only the poisoned release stays excluded. 5.14 verified 2026-08-02:
# mlx-lm 0.31.3 import + real Optimized-Speed tokenizer round-trip + tool
# chat template fingerprint-identical to 5.8.0 under transformers 5.14.1
# (PR #175).
# Floor 5.10.0: GHSA path traversal in save_pretrained through chat
# template names (Dependabot alert 24, 2026-09-06); the shipped venvs run
# 5.14.1, so the floor changes nothing installed and closes the alert.
# 5.15 and 5.16 verified 2026-09-27 (PR #538): mlx-lm 0.31.3 imports, and
# the tool chat template (thinking on and off) and plain encodes give token
# ids identical to 5.14.1 on the Qwen 3.8 27B, Flash-Next, Qwen 3.6 A3B,
# Qwen 3.5 9B and LFM2.5 pack tokenizers; 5.16.1 brings tokenizers 0.23.2
# with the same ids. 5.22.2 verified 2026-11-12 (PR #684): mlx-lm 0.31.3
# imports; a 40-message agent transcript (tool calls, reasoning, image
# placeholders) through both server encode paths, at every reasoning
# effort with thinking and preserve_thinking on and off, gives token ids
# identical to 5.16.1 on 19 catalog pack tokenizers (every Flash-Next,
# Qwen 3.8 27B, Bonsai 2, Qwen 3.6, Qwen 3.5, MiMo and Gemma 4 pack on the
# test Mac: 380 of 380 cases), with the same tokenizer type for
# llguidance (tokenizers 0.23.3 both sides). 5.23 is not verified, so the
# ceiling stays below it.
"transformers>=5.10.0,!=5.13.0,<5.23; sys_platform == 'darwin' and platform_machine == 'arm64'",
"nanobind>=2; sys_platform == 'darwin' and platform_machine == 'arm64'",
"numpy>=2",
"pydantic>=2",
"rich>=14",
"safetensors>=0.6",
"uvicorn>=0.46",
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Developers",
"Operating System :: MacOS",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
]
keywords = ["mlx", "apple-silicon", "speculative-decoding", "qwen", "mtp", "local-ai"]
[project.urls]
Homepage = "https://github.com/youssofal/mtplx"
Documentation = "https://github.com/youssofal/mtplx/tree/main/docs"
Issues = "https://github.com/youssofal/mtplx/issues"
Citation = "https://github.com/youssofal/mtplx/blob/main/CITATION.cff"
[project.optional-dependencies]
competitors = [
"dflash-mlx==0.1.0",
]
server = [
"fastapi>=0.136",
"llguidance>=1.8",
"uvicorn>=0.46",
]
dev = [
"build>=1.2",
"pytest>=8",
"ruff>=0.8",
"twine>=5",
# tests/test_bundle_native_runtime_wheel.py skips without it.
"wheel>=0.45",
]
[project.scripts]
mtplx = "mtplx.cli:main"
mtplx-tune = "mtplx.cli:main_tune"
[tool.setuptools.packages.find]
include = ["mtplx*", "vllm_metal*"]
[tool.setuptools.package-data]
mtplx = ["templates/**/*.jinja", "data/*.npy", "data/deepseek-harness-lock.json"]
"mtplx.benchmarks" = ["prompts/*.jsonl", "prompts/quality/*.toml"]
"mtplx.dashboard" = ["_static/**/*"]
"vllm_metal.metal" = [
"README.md",
"*.cpp",
"kernels_v1/*.metal",
"kernels_v2/*.metal",
]
[tool.pytest.ini_options]
testpaths = ["tests"]
pythonpath = ["."]
addopts = "-q"