Files
mlx-knife/pyproject.toml
T
The BROKE Team 74239c4e43 Release MLX Knife 1.1.0-beta1 - Dynamic Token Limits & Enhanced Web Client
Issues Resolved:
  • Issue #15: Token limits vs natural stop tokens race condition - FIXED
  • Issue #16: Interactive vs server token limit policies - FIXED

  Major Improvements:
  • Automatic optimal token limits - no configuration needed
  • Manual --max-tokens control still available when desired
  • Eliminates old hardcoded 500/2000 token restrictions
  • Performance gains: Up to 524x improvement for large context models
  • Enhanced web client with model capabilities display and better UX

  Additional Enhancements:
  • Enhanced /v1/models API with context_length field
  • Comprehensive test expansion: 114 → 131 tests (131/131 passing)
  • Python 3.9-3.13 compatibility verified

  Known Issues (Beta Status):
  • Server deadlock possible under extreme concurrent model loading stress
  • Workaround: Avoid simultaneous heavy model operations
2025-08-21 17:36:44 +02:00

154 lines
3.9 KiB
TOML

[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "mlx-knife"
dynamic = ["version"]
description = "ollama-style CLI for MLX models on Apple Silicon"
readme = "README.md"
requires-python = ">=3.9"
license = {text = "MIT"}
authors = [
{name = "The BROKE team", email = "broke@gmx.eu"},
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Operating System :: MacOS",
"Environment :: Console",
]
dependencies = [
"huggingface-hub>=0.34.0",
"requests>=2.32.0",
"mlx>=0.28.0",
"mlx-lm>=0.26.0",
"fastapi>=0.116.0",
"uvicorn>=0.35.0",
"pydantic>=2.11.0",
]
[project.optional-dependencies]
test = [
"pytest>=7.4.0",
"pytest-asyncio>=0.21.0",
"pytest-timeout>=2.1.0",
"psutil>=5.9.0",
"pytest-mock>=3.11.0",
"pytest-cov>=4.1.0"
]
dev = [
"ruff>=0.1.0",
"mypy>=1.7.0",
"types-requests>=2.31.0"
]
[project.urls]
Homepage = "https://github.com/mzau/mlx-knife"
Issues = "https://github.com/mzau/mlx-knife/issues"
[project.scripts]
mlxk = "mlx_knife.cli:main"
mlx-knife = "mlx_knife.cli:main"
mlx_knife = "mlx_knife.cli:main"
[tool.setuptools]
packages = ["mlx_knife"]
[tool.setuptools.dynamic]
version = {attr = "mlx_knife.__version__"}
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = "test_*.py"
python_classes = "Test*"
python_functions = "test_*"
addopts = [
"-v",
"--tb=short",
"--strict-markers",
"--disable-warnings",
"--durations=10",
"-m not server"
]
markers = [
"integration: integration tests (slower)",
"unit: unit tests (faster)",
"slow: slow running tests",
"requires_model: tests that need actual MLX models",
"network: tests that require network access",
"server: tests that require MLX Knife server with loaded models (manual setup required)"
]
timeout = 300
norecursedirs = [".git", ".tox", "dist", "build", "*.egg", "venv", "__pycache__"]
minversion = "6.0"
[tool.ruff]
target-version = "py39"
line-length = 88
extend-exclude = [
".git",
"__pycache__",
"venv*",
".venv",
"build",
"dist"
]
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
]
ignore = [
"E501", # line too long (handled by formatter)
"B008", # do not perform function calls in argument defaults
# Python 3.9 compatibility policy - keep legacy typing for maximum compatibility
"UP006", # Use list instead of List (keep typing.List for Python 3.9 compat)
"UP035", # typing.Dict is deprecated (keep typing.Dict for Python 3.9 compat)
# Temporary ignores for release - TODO: fix these in future versions
"E402", # Module level import not at top of file
"E722", # Do not use bare except
"W293", # Blank line contains whitespace
"C414", # Unnecessary list() call
"B904", # Exception handling (raise from)
]
[tool.ruff.lint.per-file-ignores]
"tests/*" = ["B011"] # assert False in tests is ok
[tool.mypy]
python_version = "3.9"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
check_untyped_defs = true
disallow_untyped_decorators = true
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_no_return = true
warn_unreachable = true
strict_equality = true
show_error_codes = true
[[tool.mypy.overrides]]
module = [
"mlx.*",
"mlx_lm.*",
"huggingface_hub.*"
]
ignore_missing_imports = true