From e771e3f40c40b5d64dc92c047ca4c9aa002cb481 Mon Sep 17 00:00:00 2001 From: mana-byte Date: Wed, 4 Feb 2026 21:11:19 +0100 Subject: [PATCH] [python3Packages.]mistral-inference: init at 1.6.0 --- pkgs/by-name/mi/mistral-inference/package.nix | 1 + .../mistral-inference/default.nix | 90 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 3 files changed, 93 insertions(+) create mode 100644 pkgs/by-name/mi/mistral-inference/package.nix create mode 100644 pkgs/development/python-modules/mistral-inference/default.nix diff --git a/pkgs/by-name/mi/mistral-inference/package.nix b/pkgs/by-name/mi/mistral-inference/package.nix new file mode 100644 index 000000000000..5169738be0b0 --- /dev/null +++ b/pkgs/by-name/mi/mistral-inference/package.nix @@ -0,0 +1 @@ +{ python3Packages }: with python3Packages; toPythonApplication mistral-inference diff --git a/pkgs/development/python-modules/mistral-inference/default.nix b/pkgs/development/python-modules/mistral-inference/default.nix new file mode 100644 index 000000000000..e3476a900c47 --- /dev/null +++ b/pkgs/development/python-modules/mistral-inference/default.nix @@ -0,0 +1,90 @@ +{ + lib, + config, + buildPythonPackage, + fetchFromGitHub, + pythonAtLeast, + + # build-system + poetry-core, + + # dependencies + fire, + mistral-common, + pillow, + safetensors, + simple-parsing, + xformers, + + # tests + mamba-ssm, + pycountry, + pytestCheckHook, + writableTmpDirAsHomeHook, + + # passthu + mistral-inference, +}: + +buildPythonPackage (finalAttrs: { + pname = "mistral-inference"; + version = "1.6.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "mistralai"; + repo = "mistral-inference"; + tag = "v${finalAttrs.version}"; + hash = "sha256-dcBlZWrgQn7eiNsjTS8882X9quHbgTfXxTK7HLpbLM8="; + }; + + build-system = [ + poetry-core + ]; + + dependencies = [ + fire + mistral-common + pillow + pycountry + safetensors + simple-parsing + xformers + ]; + + nativeCheckInputs = [ + mamba-ssm + pytestCheckHook + writableTmpDirAsHomeHook + ]; + + # Tests require GPU access in the sandbox + doCheck = false; + + disabledTests = lib.optionals (pythonAtLeast "3.14") [ + # AttributeError("module 'ast' has no attribute 'Num'") + "test_generation_mamba" + ]; + + passthru.gpuCheck = mistral-inference.overridePythonAttrs { + requiredSystemFeatures = [ "cuda" ]; + doCheck = true; + }; + + pythonImportsCheck = [ "mistral_inference" ]; + + meta = { + description = "High-performance library for running Mistral AI models on local hardware"; + homepage = "https://github.com/mistralai/mistral-inference"; + changelog = "https://github.com/mistralai/mistral-inference/releases/tag/${finalAttrs.src.tag}"; + license = lib.licenses.asl20; + platforms = lib.platforms.linux; + maintainers = with lib.maintainers; [ + GaetanLepage + mana-byte + ]; + mainProgram = "mistral-chat"; + # Explicitly requires an NVIDIA GPU to work + broken = !config.cudaSupport; + }; +}) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 2af888ba5d1d..26d942f5cb8f 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -9764,6 +9764,8 @@ self: super: with self; { mistral-common = callPackage ../development/python-modules/mistral-common { }; + mistral-inference = callPackage ../development/python-modules/mistral-inference { }; + mistralai = callPackage ../development/python-modules/mistralai { }; mistune = callPackage ../development/python-modules/mistune { };