nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 setuptools-scm,
6 setuptools,
7 pydantic,
8 openai,
9 tiktoken,
10 diskcache,
11 cohere,
12 google-auth,
13 typer,
14 pyyaml,
15 transformers,
16 fastapi,
17 uvicorn,
18 accelerate,
19}:
20
21buildPythonPackage rec {
22 pname = "llmx";
23 version = "0.0.21a0";
24 pyproject = true;
25
26 src = fetchPypi {
27 inherit pname version;
28 hash = "sha256-OEo6wIaDTktzAsP0rOmhxjFSHygTR/EpcRI6AXsu+6M=";
29 };
30
31 build-system = [
32 setuptools
33 setuptools-scm
34 ];
35
36 dependencies = [
37 pydantic
38 openai
39 tiktoken
40 diskcache
41 cohere
42 google-auth
43 typer
44 pyyaml
45 ];
46
47 optional-dependencies = {
48 web = [
49 fastapi
50 uvicorn
51 ];
52 transformers = [
53 accelerate
54 transformers
55 ]
56 ++ transformers.optional-dependencies.torch;
57 };
58
59 # Tests of llmx try to access openai, google, etc.
60 doCheck = false;
61
62 pythonImportsCheck = [ "llmx" ];
63
64 meta = {
65 description = "Library for LLM Text Generation";
66 homepage = "https://github.com/victordibia/llmx";
67 mainProgram = "llmx";
68 license = lib.licenses.mit;
69 maintainers = with lib.maintainers; [ moraxyc ];
70 };
71}