Files
nixpkgs/pkgs/development/python-modules/mlx-vlm/default.nix
2026-05-10 20:02:34 +07:00

101 lines
1.9 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
# build-system
setuptools,
# dependencies
datasets,
fastapi,
miniaudio,
mlx,
mlx-lm,
numpy,
opencv-python,
pillow,
requests,
tqdm,
transformers,
uvicorn,
# tests
psutil,
pytestCheckHook,
rich,
sentencepiece,
}:
buildPythonPackage (finalAttrs: {
pname = "mlx-vlm";
version = "0.4.4";
pyproject = true;
src = fetchFromGitHub {
owner = "Blaizzy";
repo = "mlx-vlm";
tag = "v${finalAttrs.version}";
hash = "sha256-08cSwN8IkERxUaXyT9qAg9vmLw7FvU5qDygAkDsOxpU=";
};
build-system = [
setuptools
];
dependencies = [
datasets
fastapi
miniaudio
mlx
mlx-lm
numpy
opencv-python
pillow
requests
tqdm
transformers
uvicorn
];
pythonImportsCheck = [ "mlx_vlm" ];
nativeCheckInputs = [
psutil
pytestCheckHook
rich
sentencepiece
];
disabledTests = [
# Fatal Python error: Aborted
# mlx_vlm/models/multi_modality/vision.py", line 174 in __call__
"test_multi_modality"
# RuntimeError: [metal_kernel] No GPU back-end
"test_glm4v"
"test_glm4v_moe"
"test_kimi_vl"
# flaky: statistical bias tolerance occasionally exceeded
"test_turboquant_prod_is_nearly_unbiased_across_seeds"
];
disabledTestPaths = [
# ImportError: cannot import name 'get_class_predicate' from 'mlx_vlm.utils'
# This function is indeed not exposed by `mlx_vlm.utils`
"mlx_vlm/tests/test_utils.py"
# fixture 'model_path' not found
"mlx_vlm/tests/test_smoke.py"
];
meta = {
description = "Inference and fine-tuning of Vision Language Models (VLMs) on your Mac using MLX";
homepage = "https://github.com/Blaizzy/mlx-vlm";
changelog = "https://github.com/Blaizzy/mlx-vlm/releases/tag/${finalAttrs.src.tag}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ GaetanLepage ];
};
})