python3Packages.llm-templates-fabric: init at 0.2

This commit is contained in:
Philip Taron
2025-05-31 20:22:53 -07:00
parent d5a30a5a48
commit 56df419440
4 changed files with 68 additions and 0 deletions
+3
View File
@@ -14,6 +14,7 @@
enable-llm-ollama ? false,
enable-llm-openai-plugin ? false,
enable-llm-openrouter ? false,
enable-llm-templates-fabric ? false,
enable-llm-templates-github ? false,
enable-llm-venice ? false,
enable-llm-video-frames ? false,
@@ -36,6 +37,7 @@ let
llm-ollama
llm-openai-plugin
llm-openrouter
llm-templates-fabric
llm-templates-github
llm-venice
llm-video-frames
@@ -59,6 +61,7 @@ toPythonApplication (
++ lib.optionals enable-llm-ollama [ llm-ollama ]
++ lib.optionals enable-llm-openai-plugin [ llm-openai-plugin ]
++ lib.optionals enable-llm-openrouter [ llm-openrouter ]
++ lib.optionals enable-llm-templates-fabric [ llm-templates-fabric ]
++ lib.optionals enable-llm-templates-github [ llm-templates-github ]
++ lib.optionals enable-llm-venice [ llm-venice ]
++ lib.optionals enable-llm-video-frames [ llm-video-frames ];
@@ -0,0 +1,41 @@
{
lib,
callPackage,
buildPythonPackage,
fetchFromGitHub,
setuptools,
llm,
}:
buildPythonPackage rec {
pname = "llm-templates-fabric";
version = "0.2";
pyproject = true;
src = fetchFromGitHub {
owner = "simonw";
repo = "llm-templates-fabric";
tag = version;
hash = "sha256-tfkSjeT9WstUsNCtVr3fMzqELFCtfYphqf3xFGvHaV0=";
};
build-system = [
setuptools
llm
];
dependencies = [ ];
pythonImportsCheck = [ "llm_templates_fabric" ];
passthru.tests = {
llm-plugin = callPackage ./tests/llm-plugin.nix { };
};
meta = {
description = "Load LLM templates from Fabric";
homepage = "https://github.com/simonw/llm-templates-fabric";
changelog = "https://github.com/simonw/llm-templates-fabric/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-templates-fabric
]);
in
runCommand "llm-templates-fabric-test-llm-plugin"
{
nativeBuildInputs = [
venv
yq
];
}
''
llm plugins | yq --exit-status 'any(.name == "llm-templates-fabric")'
touch "$out"
''
+2
View File
@@ -8320,6 +8320,8 @@ self: super: with self; {
llm-openrouter = callPackage ../development/python-modules/llm-openrouter { };
llm-templates-fabric = callPackage ../development/python-modules/llm-templates-fabric { };
llm-templates-github = callPackage ../development/python-modules/llm-templates-github { };
llm-venice = callPackage ../development/python-modules/llm-venice { };