Install llm via dream2nix

master
Yorick van Pelt 2024-03-15 10:01:03 +01:00
parent 6cb0ee6eec
commit 1f40b30d87
Signed by: yorick
GPG Key ID: D8D3CC6D951384DE
6 changed files with 483 additions and 2 deletions

View File

@ -127,6 +127,28 @@
}
},
"dream2nix": {
"inputs": {
"nixpkgs": [
"nixpkgs"
],
"purescript-overlay": "purescript-overlay",
"pyproject-nix": "pyproject-nix"
},
"locked": {
"lastModified": 1710443161,
"narHash": "sha256-vjZhR1hcjWrmEH++N71tYL9S4Cu4s0z6kKFO1j5xvWs=",
"owner": "nix-community",
"repo": "dream2nix",
"rev": "5c2548faf14f05319b317369d0c9678ce63100a8",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "dream2nix",
"type": "github"
}
},
"dream2nix_2": {
"inputs": {
"devshell": "devshell",
"flake-compat": "flake-compat_2",
@ -350,7 +372,7 @@
},
"fooocus": {
"inputs": {
"dream2nix": "dream2nix",
"dream2nix": "dream2nix_2",
"nixpkgs": [
"fooocus",
"dream2nix",
@ -794,10 +816,50 @@
"type": "github"
}
},
"purescript-overlay": {
"inputs": {
"nixpkgs": [
"dream2nix",
"nixpkgs"
],
"slimlock": "slimlock"
},
"locked": {
"lastModified": 1696022621,
"narHash": "sha256-eMjFmsj2G1E0Q5XiibUNgFjTiSz0GxIeSSzzVdoN730=",
"owner": "thomashoneyman",
"repo": "purescript-overlay",
"rev": "047c7933abd6da8aa239904422e22d190ce55ead",
"type": "github"
},
"original": {
"owner": "thomashoneyman",
"repo": "purescript-overlay",
"type": "github"
}
},
"pyproject-nix": {
"flake": false,
"locked": {
"lastModified": 1702448246,
"narHash": "sha256-hFg5s/hoJFv7tDpiGvEvXP0UfFvFEDgTdyHIjDVHu1I=",
"owner": "davhau",
"repo": "pyproject.nix",
"rev": "5a06a2697b228c04dd2f35659b4b659ca74f7aeb",
"type": "github"
},
"original": {
"owner": "davhau",
"ref": "dream2nix",
"repo": "pyproject.nix",
"type": "github"
}
},
"root": {
"inputs": {
"agenix": "agenix",
"attic": "attic",
"dream2nix": "dream2nix",
"emacs-overlay": "emacs-overlay",
"flake-utils": "flake-utils_2",
"fooocus": "fooocus",
@ -812,6 +874,28 @@
"timesync": "timesync"
}
},
"slimlock": {
"inputs": {
"nixpkgs": [
"dream2nix",
"purescript-overlay",
"nixpkgs"
]
},
"locked": {
"lastModified": 1688610262,
"narHash": "sha256-Wg0ViDotFWGWqKIQzyYCgayeH8s4U1OZcTiWTQYdAp4=",
"owner": "thomashoneyman",
"repo": "slimlock",
"rev": "b5c6cdcaf636ebbebd0a1f32520929394493f1a6",
"type": "github"
},
"original": {
"owner": "thomashoneyman",
"repo": "slimlock",
"type": "github"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,

View File

@ -29,11 +29,13 @@
inputs.nixpkgs.follows = "nixpkgs";
};
fooocus.url = "path:./pkgs/fooocus";
dream2nix.url = "github:nix-community/dream2nix";
dream2nix.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = inputs@{ nixpkgs, home-manager, nixpkgs-mozilla, emacs-overlay
, nixpkgs-wayland, nixos-hardware, agenix, flake-utils
, nix-index-database, nix-npm-buildpackage, timesync
, attic
, attic, dream2nix
, self
, ... }:
(flake-utils.lib.eachSystem [ "x86_64-linux" ] (system:

View File

@ -289,6 +289,7 @@ in {
r8-cog
mutagen
zoom-us
llm
# admin
nsc

View File

@ -96,4 +96,5 @@
nativeBuildInputs = [ self.pkg-config ];
buildInputs = [ self.openssl.dev ];
};
llm = super.callPackage ./llm.nix {};
})

28
pkgs/llm.nix Normal file
View File

@ -0,0 +1,28 @@
{ flake-inputs, pkgs, python3, runCommand }:
let
dream2nix = flake-inputs.dream2nix;
module = { dream2nix, config, lib, ... }: {
imports = [ dream2nix.modules.dream2nix.pip ];
name = "llm-env";
deps.python = python3;
version = "0.13.1";
pip.requirementsList = [
"llm==0.13.1"
"llm-claude-3==0.3"
];
pip.flattenDependencies = true;
public = config.pip.env;
paths.projectRoot = ./..;
paths.package = "pkgs/llm";
};
packages = dream2nix.lib.evalModules {
packageSets.nixpkgs = pkgs;
modules = [ module ];
};
pyEnv = packages.config.public.pyEnv;
in
runCommand "llm" {} ''
mkdir -p $out/bin
cp ${pyEnv}/bin/llm $_
''

365
pkgs/llm/lock.json Normal file
View File

@ -0,0 +1,365 @@
{
"fetchPipMetadata": {
"sources": {
"annotated-types": {
"sha256": "0641064de18ba7a25dee8f96403ebc39113d0cb953a01429249d5c7564666a43",
"type": "url",
"url": "https://files.pythonhosted.org/packages/28/78/d31230046e58c207284c6b2c4e8d96e6d3cb4e52354721b944d3e1ee4aa5/annotated_types-0.6.0-py3-none-any.whl",
"version": "0.6.0"
},
"anthropic": {
"sha256": "754fe24596efbe1d7a49d3d59818a2a25d2bf29539e036eafd8a43427cd58134",
"type": "url",
"url": "https://files.pythonhosted.org/packages/13/f9/d91e4d404ef094cb5c60287ee05d553eec16e673b94ff1d6792fdc251f7c/anthropic-0.20.0-py3-none-any.whl",
"version": "0.20.0"
},
"anyio": {
"sha256": "048e05d0f6caeed70d731f3db756d35dcc1f35747c8c403364a8332c630441b8",
"type": "url",
"url": "https://files.pythonhosted.org/packages/14/fd/2f20c40b45e4fb4324834aea24bd4afdf1143390242c0b33774da0e2e34f/anyio-4.3.0-py3-none-any.whl",
"version": "4.3.0"
},
"certifi": {
"sha256": "dc383c07b76109f368f6106eee2b593b04a011ea4d55f652c6ca24a754d1cdd1",
"type": "url",
"url": "https://files.pythonhosted.org/packages/ba/06/a07f096c664aeb9f01624f858c3add0a4e913d6c96257acb4fce61e7de14/certifi-2024.2.2-py3-none-any.whl",
"version": "2024.2.2"
},
"charset-normalizer": {
"sha256": "753f10e867343b4511128c6ed8c82f7bec3bd026875576dfd88483c5c73b2fd8",
"type": "url",
"url": "https://files.pythonhosted.org/packages/40/26/f35951c45070edc957ba40a5b1db3cf60a9dbb1b350c2d5bef03e01e61de/charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"version": "3.3.2"
},
"click": {
"sha256": "ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28",
"type": "url",
"url": "https://files.pythonhosted.org/packages/00/2e/d53fa4befbf2cfa713304affc7ca780ce4fc1fd8710527771b58311a3229/click-8.1.7-py3-none-any.whl",
"version": "8.1.7"
},
"click-default-group": {
"sha256": "9b60486923720e7fc61731bdb32b617039aba820e22e1c88766b1125592eaa5f",
"type": "url",
"url": "https://files.pythonhosted.org/packages/2c/1a/aff8bb287a4b1400f69e09a53bd65de96aa5cee5691925b38731c67fc695/click_default_group-1.2.4-py2.py3-none-any.whl",
"version": "1.2.4"
},
"distro": {
"sha256": "7bffd925d65168f85027d8da9af6bddab658135b840670a223589bc0c8ef02b2",
"type": "url",
"url": "https://files.pythonhosted.org/packages/12/b3/231ffd4ab1fc9d679809f356cebee130ac7daa00d6d6f3206dd4fd137e9e/distro-1.9.0-py3-none-any.whl",
"version": "1.9.0"
},
"filelock": {
"sha256": "57dbda9b35157b05fb3e58ee91448612eb674172fab98ee235ccb0b5bee19a1c",
"type": "url",
"url": "https://files.pythonhosted.org/packages/81/54/84d42a0bee35edba99dee7b59a8d4970eccdd44b99fe728ed912106fc781/filelock-3.13.1-py3-none-any.whl",
"version": "3.13.1"
},
"fsspec": {
"sha256": "817f969556fa5916bc682e02ca2045f96ff7f586d45110fcb76022063ad2c7d8",
"type": "url",
"url": "https://files.pythonhosted.org/packages/ad/30/2281c062222dc39328843bd1ddd30ff3005ef8e30b2fd09c4d2792766061/fsspec-2024.2.0-py3-none-any.whl",
"version": "2024.2.0"
},
"h11": {
"sha256": "e3fe4ac4b851c468cc8363d500db52c2ead036020723024a109d37346efaa761",
"type": "url",
"url": "https://files.pythonhosted.org/packages/95/04/ff642e65ad6b90db43e668d70ffb6736436c7ce41fcc549f4e9472234127/h11-0.14.0-py3-none-any.whl",
"version": "0.14.0"
},
"httpcore": {
"sha256": "ac418c1db41bade2ad53ae2f3834a3a0f5ae76b56cf5aa497d2d033384fc7d73",
"type": "url",
"url": "https://files.pythonhosted.org/packages/2c/93/13f25f2f78646bab97aee7680821e30bd85b2ff0fc45d5fdf5393b79716d/httpcore-1.0.4-py3-none-any.whl",
"version": "1.0.4"
},
"httpx": {
"sha256": "71d5465162c13681bff01ad59b2cc68dd838ea1f10e51574bac27103f00c91a5",
"type": "url",
"url": "https://files.pythonhosted.org/packages/41/7b/ddacf6dcebb42466abd03f368782142baa82e08fc0c1f8eaa05b4bae87d5/httpx-0.27.0-py3-none-any.whl",
"version": "0.27.0"
},
"huggingface-hub": {
"sha256": "df37c2c37fc6c82163cdd8a67ede261687d80d1e262526d6c0ce73b6b3630a7b",
"type": "url",
"url": "https://files.pythonhosted.org/packages/ab/28/d4b691840d73126d4c9845f8a22dad033ac872509b6d3a0d93b456eef424/huggingface_hub-0.21.4-py3-none-any.whl",
"version": "0.21.4"
},
"idna": {
"sha256": "c05567e9c24a6b9faaa835c4821bad0590fbb9d5779e7caa6e1cc4978e7eb24f",
"type": "url",
"url": "https://files.pythonhosted.org/packages/c2/e7/a82b05cf63a603df6e68d59ae6a68bf5064484a0718ea5033660af4b54a9/idna-3.6-py3-none-any.whl",
"version": "3.6"
},
"llm": {
"sha256": "05e468e3723097a07dba9d2b87d05f2359e7e436e8b8bd6743074021f4d8169c",
"type": "url",
"url": "https://files.pythonhosted.org/packages/b1/c5/0576fc2698a78c0e47550a1ac19899dee504b74986447fcdb1f8cd00b817/llm-0.13.1-py3-none-any.whl",
"version": "0.13.1"
},
"llm-claude": {
"sha256": "66780648bef588aff6d15aa37596d80ab427879a84272889f45b574c83bcef36",
"type": "url",
"url": "https://files.pythonhosted.org/packages/75/3d/be9dac40df5c4c4ea40188252f6dfa541cd86d3591c28ba04ae2c3fd64a6/llm_claude-0.4.0-py3-none-any.whl",
"version": "0.4.0"
},
"llm-claude-3": {
"sha256": "c7bd1ca94f012137a1c002dff84f34735028b02123003a68ad1ebcc1cf5ab8a5",
"type": "url",
"url": "https://files.pythonhosted.org/packages/bb/7b/c32053b853c2fc6dad705064a942a6b81566ca867bd0e5ac4c28d1093ce6/llm_claude_3-0.3-py3-none-any.whl",
"version": "0.3"
},
"openai": {
"sha256": "5c9fd3a59f5cbdb4020733ddf79a22f6b7a36d561968cb3f3dd255cdd263d9fe",
"type": "url",
"url": "https://files.pythonhosted.org/packages/75/d1/06a969e3b15429873d52cb2ca8ad9b2c3b28bcf977ba6796dbaef13f5b95/openai-1.14.0-py3-none-any.whl",
"version": "1.14.0"
},
"packaging": {
"sha256": "2ddfb553fdf02fb784c234c7ba6ccc288296ceabec964ad2eae3777778130bc5",
"type": "url",
"url": "https://files.pythonhosted.org/packages/49/df/1fceb2f8900f8639e278b056416d49134fb8d84c5942ffaa01ad34782422/packaging-24.0-py3-none-any.whl",
"version": "24.0"
},
"pip": {
"sha256": "ba0d021a166865d2265246961bec0152ff124de910c5cc39f1156ce3fa7c69dc",
"type": "url",
"url": "https://files.pythonhosted.org/packages/8a/6a/19e9fe04fca059ccf770861c7d5721ab4c2aebc539889e97c7977528a53b/pip-24.0-py3-none-any.whl",
"version": "24.0"
},
"pluggy": {
"sha256": "7db9f7b503d67d1c5b95f59773ebb58a8c1c288129a88665838012cfb07b8981",
"type": "url",
"url": "https://files.pythonhosted.org/packages/a5/5b/0cc789b59e8cc1bf288b38111d002d8c5917123194d45b29dcdac64723cc/pluggy-1.4.0-py3-none-any.whl",
"version": "1.4.0"
},
"pydantic": {
"sha256": "cc46fce86607580867bdc3361ad462bab9c222ef042d3da86f2fb333e1d916c5",
"type": "url",
"url": "https://files.pythonhosted.org/packages/e5/f3/8296f550276194a58c5500d55b19a27ae0a5a3a51ffef66710c58544b32d/pydantic-2.6.4-py3-none-any.whl",
"version": "2.6.4"
},
"pydantic-core": {
"sha256": "a6b1bb0827f56654b4437955555dc3aeeebeddc47c2d7ed575477f082622c49e",
"type": "url",
"url": "https://files.pythonhosted.org/packages/18/0e/1e39cfbffa57e92ab9f1f0869b32ead8a48ab11e4a373421d625f25fcb26/pydantic_core-2.16.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"version": "2.16.3"
},
"python-dateutil": {
"sha256": "a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427",
"type": "url",
"url": "https://files.pythonhosted.org/packages/ec/57/56b9bcc3c9c6a792fcbaf139543cee77261f3651ca9da0c93f5c1221264b/python_dateutil-2.9.0.post0-py2.py3-none-any.whl",
"version": "2.9.0.post0"
},
"python-ulid": {
"sha256": "ec2e69292c0b7c338a07df5e15b05270be6823675c103383e74d1d531945eab5",
"type": "url",
"url": "https://files.pythonhosted.org/packages/25/ae/f820dd4c18d7698f4ea411b1ff066ff135ca87a203d5301bd4d54f8355fb/python_ulid-2.2.0-py3-none-any.whl",
"version": "2.2.0"
},
"pyyaml": {
"sha256": "d2b04aac4d386b172d5b9692e2d2da8de7bfb6c387fa4f801fbf6fb2e6ba4673",
"type": "url",
"url": "https://files.pythonhosted.org/packages/7b/5e/efd033ab7199a0b2044dab3b9f7a4f6670e6a52c089de572e928d2873b06/PyYAML-6.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"version": "6.0.1"
},
"requests": {
"sha256": "58cd2187c01e70e6e26505bca751777aa9f2ee0b7f4300988b709f44e013003f",
"type": "url",
"url": "https://files.pythonhosted.org/packages/70/8e/0e2d847013cb52cd35b38c009bb167a1a26b2ce6cd6965bf26b47bc0bf44/requests-2.31.0-py3-none-any.whl",
"version": "2.31.0"
},
"setuptools": {
"sha256": "c21c49fb1042386df081cb5d86759792ab89efca84cf114889191cd09aacc80c",
"type": "url",
"url": "https://files.pythonhosted.org/packages/92/e1/1c8bb3420105e70bdf357d57dd5567202b4ef8d27f810e98bb962d950834/setuptools-69.2.0-py3-none-any.whl",
"version": "69.2.0"
},
"six": {
"sha256": "8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254",
"type": "url",
"url": "https://files.pythonhosted.org/packages/d9/5a/e7c31adbe875f2abbb91bd84cf2dc52d792b5a01506781dbcf25c91daf11/six-1.16.0-py2.py3-none-any.whl",
"version": "1.16.0"
},
"sniffio": {
"sha256": "2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2",
"type": "url",
"url": "https://files.pythonhosted.org/packages/e9/44/75a9c9421471a6c4805dbf2356f7c181a29c1879239abab1ea2cc8f38b40/sniffio-1.3.1-py3-none-any.whl",
"version": "1.3.1"
},
"sqlite-fts4": {
"sha256": "0359edd8dea6fd73c848989e1e2b1f31a50fe5f9d7272299ff0e8dbaa62d035f",
"type": "url",
"url": "https://files.pythonhosted.org/packages/51/29/0096e8b1811aaa78cfb296996f621f41120c21c2f5cd448ae1d54979d9fc/sqlite_fts4-1.0.3-py3-none-any.whl",
"version": "1.0.3"
},
"sqlite-migrate": {
"sha256": "a4125e35e1de3dc56b6b6ec60e9833ce0ce20192b929ddcb2d4246c5098859c6",
"type": "url",
"url": "https://files.pythonhosted.org/packages/df/92/994545b912e6d6feb40323047f02ca039321e690aa2c27afcd5c4105e37b/sqlite_migrate-0.1b0-py3-none-any.whl",
"version": "0.1b0"
},
"sqlite-utils": {
"sha256": "b71e829755c2efbdcd6931a31968dee4e8bd71b3c14f0fe648b22377027c5bec",
"type": "url",
"url": "https://files.pythonhosted.org/packages/3a/70/c1917860d717d50c9cbb3c616afbf5c124e90a1609dccde4540375da3a2d/sqlite_utils-3.36-py3-none-any.whl",
"version": "3.36"
},
"tabulate": {
"sha256": "024ca478df22e9340661486f85298cff5f6dcdba14f3813e8830015b9ed1948f",
"type": "url",
"url": "https://files.pythonhosted.org/packages/40/44/4a5f08c96eb108af5cb50b41f76142f0afa346dfa99d5296fe7202a11854/tabulate-0.9.0-py3-none-any.whl",
"version": "0.9.0"
},
"tokenizers": {
"sha256": "ccd73a82751c523b3fc31ff8194702e4af4db21dc20e55b30ecc2079c5d43cb7",
"type": "url",
"url": "https://files.pythonhosted.org/packages/15/0b/c09b2c0dc688c82adadaa0d5080983de3ce920f4a5cbadb7eaa5302ad251/tokenizers-0.15.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"version": "0.15.2"
},
"tqdm": {
"sha256": "1ee4f8a893eb9bef51c6e35730cebf234d5d0b6bd112b0271e10ed7c24a02bd9",
"type": "url",
"url": "https://files.pythonhosted.org/packages/2a/14/e75e52d521442e2fcc9f1df3c5e456aead034203d4797867980de558ab34/tqdm-4.66.2-py3-none-any.whl",
"version": "4.66.2"
},
"typing-extensions": {
"sha256": "69b1a937c3a517342112fb4c6df7e72fc39a38e7891a5730ed4985b5214b5475",
"type": "url",
"url": "https://files.pythonhosted.org/packages/f9/de/dc04a3ea60b22624b51c703a84bbe0184abcd1d0b9bc8074b5d6b7ab90bb/typing_extensions-4.10.0-py3-none-any.whl",
"version": "4.10.0"
},
"urllib3": {
"sha256": "450b20ec296a467077128bff42b73080516e71b56ff59a60a02bef2232c4fa9d",
"type": "url",
"url": "https://files.pythonhosted.org/packages/a2/73/a68704750a7679d0b6d3ad7aa8d4da8e14e151ae82e6fee774e6e0d05ec8/urllib3-2.2.1-py3-none-any.whl",
"version": "2.2.1"
}
},
"targets": {
"default": {
"annotated-types": [],
"anthropic": [
"anyio",
"distro",
"httpx",
"pydantic",
"sniffio",
"tokenizers",
"typing-extensions"
],
"anyio": [
"idna",
"sniffio"
],
"certifi": [],
"charset-normalizer": [],
"click": [],
"click-default-group": [
"click"
],
"distro": [],
"filelock": [],
"fsspec": [],
"h11": [],
"httpcore": [
"certifi",
"h11"
],
"httpx": [
"anyio",
"certifi",
"httpcore",
"idna",
"sniffio"
],
"huggingface-hub": [
"filelock",
"fsspec",
"packaging",
"pyyaml",
"requests",
"tqdm",
"typing-extensions"
],
"idna": [],
"llm": [
"click",
"click-default-group",
"openai",
"pip",
"pluggy",
"pydantic",
"python-ulid",
"pyyaml",
"setuptools",
"sqlite-migrate",
"sqlite-utils"
],
"llm-claude": [
"anthropic",
"llm"
],
"llm-claude-3": [
"anthropic",
"llm",
"llm-claude"
],
"openai": [
"anyio",
"distro",
"httpx",
"pydantic",
"sniffio",
"tqdm",
"typing-extensions"
],
"packaging": [],
"pip": [],
"pluggy": [],
"pydantic": [
"annotated-types",
"pydantic-core",
"typing-extensions"
],
"pydantic-core": [
"typing-extensions"
],
"python-dateutil": [
"six"
],
"python-ulid": [],
"pyyaml": [],
"requests": [
"certifi",
"charset-normalizer",
"idna",
"urllib3"
],
"setuptools": [],
"six": [],
"sniffio": [],
"sqlite-fts4": [],
"sqlite-migrate": [
"sqlite-utils"
],
"sqlite-utils": [
"click",
"click-default-group",
"pluggy",
"python-dateutil",
"sqlite-fts4",
"tabulate"
],
"tabulate": [],
"tokenizers": [
"huggingface-hub"
],
"tqdm": [],
"typing-extensions": [],
"urllib3": []
}
}
},
"invalidationHash": "10ee897b09a24c5b758c2e46b88e227aff135f6956fa10e65e8b10dcd01a992d"
}