python3Packages.llm-command-r: init at 0.3.1

This commit is contained in:
Philip Taron
2025-05-31 20:22:52 -07:00
parent 31c73863a7
commit 12bcd7aa10
4 changed files with 79 additions and 0 deletions
+3
View File
@@ -3,6 +3,7 @@
python3Packages,
enable-llm-anthropic ? false,
enable-llm-cmd ? false,
enable-llm-command-r ? false,
enable-llm-gemini ? false,
enable-llm-gguf ? false,
enable-llm-jq ? false,
@@ -17,6 +18,7 @@ let
llm
llm-anthropic
llm-cmd
llm-command-r
llm-gemini
llm-gguf
llm-jq
@@ -32,6 +34,7 @@ toPythonApplication (
(finalAttrs.propagatedBuildInputs or [ ])
++ lib.optionals enable-llm-anthropic [ llm-anthropic ]
++ lib.optionals enable-llm-cmd [ llm-cmd ]
++ lib.optionals enable-llm-cmd [ llm-command-r ]
++ lib.optionals enable-llm-gemini [ llm-gemini ]
++ lib.optionals enable-llm-gguf [ llm-gguf ]
++ lib.optionals enable-llm-jq [ llm-jq ]
@@ -0,0 +1,52 @@
{
lib,
callPackage,
buildPythonPackage,
fetchFromGitHub,
setuptools,
llm,
cohere,
pytestCheckHook,
pytest-recording,
writableTmpDirAsHomeHook,
}:
buildPythonPackage rec {
pname = "llm-command-r";
version = "0.3.1";
pyproject = true;
src = fetchFromGitHub {
owner = "simonw";
repo = "llm-command-r";
tag = version;
hash = "sha256-PxICRds9NJQP64HwoL7Oxd39yaIrMdAyQEbhaumJCgo=";
};
build-system = [
setuptools
llm
];
dependencies = [ cohere ];
nativeCheckInputs = [
pytestCheckHook
pytest-recording
writableTmpDirAsHomeHook
];
pythonImportsCheck = [ "llm_command_r" ];
passthru.tests = {
llm-plugin = callPackage ./tests/llm-plugin.nix { };
};
meta = {
description = "Access the Cohere Command R family of models";
homepage = "https://github.com/simonw/llm-command-r";
changelog = "https://github.com/simonw/llm-command-r/releases/tag/${version}/CHANGELOG.md";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ philiptaron ];
};
}
@@ -0,0 +1,22 @@
{
runCommand,
python,
yq,
}:
let
venv = python.withPackages (ps: [
ps.llm
ps.llm-anthropic
]);
in
runCommand "llm-anthropic-test-llm-plugin"
{
nativeBuildInputs = [
venv
yq
];
}
''
llm plugins | yq --exit-status 'any(.name == "llm-anthropic")'
touch "$out"
''
+2
View File
@@ -8298,6 +8298,8 @@ self: super: with self; {
llm-cmd = callPackage ../development/python-modules/llm-cmd { };
llm-command-r = callPackage ../development/python-modules/llm-command-r { };
llm-gemini = callPackage ../development/python-modules/llm-gemini { };
llm-gguf = callPackage ../development/python-modules/llm-gguf { };