mirror of
https://github.com/daylinmorgan/oizys.git
synced 2024-12-22 06:00:45 -06:00
add llm package + plugins
This commit is contained in:
parent
8aade59df9
commit
1f1cf3a6be
6 changed files with 95 additions and 5 deletions
|
@ -22,6 +22,7 @@
|
|||
"tex"
|
||||
"zig"
|
||||
];
|
||||
llm = enabled;
|
||||
};
|
||||
|
||||
services.restic.backups.gdrive = {
|
||||
|
|
|
@ -1,8 +1,4 @@
|
|||
{
|
||||
pkgs,
|
||||
enabled,
|
||||
...
|
||||
}:
|
||||
{ pkgs, enabled, ... }:
|
||||
{
|
||||
networking.networkmanager = enabled;
|
||||
services.fwupd = enabled;
|
||||
|
|
24
modules/llm/default.nix
Normal file
24
modules/llm/default.nix
Normal file
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
enabled,
|
||||
mkOizysModule,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
inherit (pkgs) python3Packages;
|
||||
llm-ollama = python3Packages.callPackage ../../pkgs/llm-plugins/llm-ollama { };
|
||||
llm-claude3 = python3Packages.callPackage ../../pkgs/llm-plugins/llm-claude-3 { };
|
||||
llm = (
|
||||
pkgs.llm.withPlugins [
|
||||
llm-ollama
|
||||
llm-claude3
|
||||
]
|
||||
);
|
||||
in
|
||||
|
||||
mkOizysModule config "llm" {
|
||||
services.ollama = enabled;
|
||||
environment.systemPackages = [ llm ];
|
||||
}
|
|
@ -38,6 +38,8 @@ in
|
|||
|
||||
nix-ld
|
||||
restic
|
||||
|
||||
llm
|
||||
];
|
||||
|
||||
options.oizys = {
|
||||
|
|
34
pkgs/llm-plugins/llm-claude-3/default.nix
Normal file
34
pkgs/llm-plugins/llm-claude-3/default.nix
Normal file
|
@ -0,0 +1,34 @@
|
|||
{
|
||||
buildPythonPackage,
|
||||
fetchFromGitHub,
|
||||
|
||||
# build-system
|
||||
setuptools,
|
||||
wheel,
|
||||
|
||||
# deps
|
||||
anthropic,
|
||||
...
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "llm-claude-3";
|
||||
version = "0.4";
|
||||
pyproject = true;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "simonw";
|
||||
repo = "llm-claude-3";
|
||||
rev = version;
|
||||
hash = "sha256-5qF5BK319PNzB4XsLdYvtyq/SxBDdHJ9IoKWEnvNRp4=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
setuptools
|
||||
wheel
|
||||
];
|
||||
|
||||
dependencies = [ anthropic ];
|
||||
|
||||
dontCheckRuntimeDeps = true;
|
||||
}
|
33
pkgs/llm-plugins/llm-ollama/default.nix
Normal file
33
pkgs/llm-plugins/llm-ollama/default.nix
Normal file
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
buildPythonPackage,
|
||||
fetchPypi,
|
||||
|
||||
# build-system
|
||||
setuptools,
|
||||
|
||||
# deps
|
||||
ollama,
|
||||
pydantic,
|
||||
|
||||
...
|
||||
}:
|
||||
buildPythonPackage rec {
|
||||
pname = "llm-ollama";
|
||||
version = "0.5.0";
|
||||
pyproject = true;
|
||||
src = fetchPypi {
|
||||
inherit version;
|
||||
pname = "llm_ollama";
|
||||
hash = "sha256-M3FF9fAZ2rr+toKoz/rLRPZxB7LIHqmZQXJBdKR4fVk=";
|
||||
};
|
||||
|
||||
dependencies = [
|
||||
ollama
|
||||
pydantic
|
||||
];
|
||||
|
||||
build-system = [ setuptools ];
|
||||
|
||||
# will only be used in environment with llm installed
|
||||
dontCheckRuntimeDeps = true;
|
||||
}
|
Loading…
Reference in a new issue