Skip to content

Commit 6a0200c

Browse files
codelionclaude
andauthored
Cap transformers <5.13 to keep mlx-lm importable (macOS), bump to 0.3.19 (#316)
transformers 5.13.0 tightened AutoModel/AutoTokenizer.register() to require a class (it does key.__module__). mlx-lm 0.31.3 registers a custom tokenizer by string name (tokenizer_utils.py: AutoTokenizer.register("NewlineTokenizer", ...)), so `import mlx_lm` — and therefore `import optillm` — crashes with "AttributeError: 'str' object has no attribute '__module__'". This only affects Apple silicon, where optillm installs mlx-lm (platform_machine=="arm64" and sys_platform=="darwin"); Linux CI never installs mlx-lm so it was unaffected. The transformers 5.13.0 HF path itself is fine (dhara loads and generates); the incompatibility is purely mlx-lm's. Pin transformers>=5.0.0,<5.13.0 (resolves to 5.12.1) until mlx-lm ships a transformers-5.13-compatible release, then lift the cap. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent beca974 commit 6a0200c

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

optillm/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Version information
2-
__version__ = "0.3.18"
2+
__version__ = "0.3.19"
33

44
import os as _os
55

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "optillm"
7-
version = "0.3.18"
7+
version = "0.3.19"
88
description = "An optimizing inference proxy for LLMs."
99
readme = "README.md"
1010
license = "Apache-2.0"

requirements.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ z3-solver<=4.15.4.0
55
aiohttp
66
flask
77
torch
8-
transformers>=5.0.0
8+
# Cap below 5.13: transformers 5.13.0 tightened AutoTokenizer.register() to require
9+
# a class, which breaks mlx-lm (it registers a tokenizer by string name). Lift the
10+
# cap once mlx-lm ships a transformers-5.13-compatible release. See mlx_lm
11+
# tokenizer_utils.register("NewlineTokenizer", ...).
12+
transformers>=5.0.0,<5.13.0
913
azure.identity
1014
tiktoken
1115
scikit-learn

0 commit comments

Comments
 (0)