diff --git a/pkgs/development/python-modules/llama-stack-client/default.nix b/pkgs/development/python-modules/llama-stack-client/default.nix new file mode 100644 index 000000000000..3212702eb680 --- /dev/null +++ b/pkgs/development/python-modules/llama-stack-client/default.nix @@ -0,0 +1,103 @@ +{ + lib, + aiohttp, + anyio, + buildPythonPackage, + click, + dirty-equals, + distro, + fetchPypi, + fire, + hatch-fancy-pypi-readme, + hatchling, + httpx-aiohttp, + httpx, + nest-asyncio, + pandas, + prompt-toolkit, + pyaml, + pydantic, + pytest-asyncio, + pytest-xdist, + pytestCheckHook, + requests, + respx, + rich, + sniffio, + termcolor, + tqdm, + typing-extensions, +}: + +buildPythonPackage rec { + pname = "llama-stack-client"; + version = "0.2.20"; + pyproject = true; + + src = fetchPypi { + pname = "llama_stack_client"; + inherit version; + hash = "sha256-NWJX8KS7tkIF+J4RPXFZJYU9XjTsdE5yRm2nJ5C6QVs="; + }; + + postPatch = '' + substituteInPlace pyproject.toml \ + --replace-fail "hatchling==1.26.3" "hatchling" + ''; + + build-system = [ + hatch-fancy-pypi-readme + hatchling + ]; + + dependencies = [ + anyio + click + distro + fire + httpx + pandas + prompt-toolkit + pyaml + pydantic + requests + rich + sniffio + termcolor + tqdm + typing-extensions + ]; + + optional-dependencies = { + aiohttp = [ + aiohttp + httpx-aiohttp + ]; + }; + + nativeCheckInputs = [ + dirty-equals + nest-asyncio + pytest-asyncio + pytest-xdist + pytestCheckHook + respx + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); + + pythonImportsCheck = [ "llama_stack_client" ]; + + disabledTestPaths = [ + # Tests require network access + "tests/api_resources/" + "tests/test_client.py" + ]; + + meta = { + description = "Library for the llama-stack-client API"; + homepage = "https://github.com/llamastack/llama-stack-client-python"; + changelog = "https://github.com/llamastack/llama-stack-client-python/releases/tag/v${version}"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 2b865168d263..08b1e152a554 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -8604,6 +8604,8 @@ self: super: with self; { llama-parse = callPackage ../development/python-modules/llama-parse { }; + llama-stack-client = callPackage ../development/python-modules/llama-stack-client { }; + llamaindex-py-client = callPackage ../development/python-modules/llamaindex-py-client { }; llfuse = callPackage ../development/python-modules/llfuse { inherit (pkgs) fuse; };