1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 hatchling,
6 hatch-vcs,
7 httpx,
8 pydantic,
9 pillow,
10 pytest-asyncio,
11 pytest-httpserver,
12 pytestCheckHook,
13}:
14
15buildPythonPackage rec {
16 pname = "ollama";
17 version = "0.5.3";
18 pyproject = true;
19
20 src = fetchFromGitHub {
21 owner = "ollama";
22 repo = "ollama-python";
23 tag = "v${version}";
24 hash = "sha256-QpG8bo6tarhW4NpdD4MQ9DWR/w8KjT2zEQyirYtTjJ0=";
25 };
26
27 pythonRelaxDeps = [ "httpx" ];
28
29 build-system = [
30 hatchling
31 hatch-vcs
32 ];
33
34 dependencies = [
35 httpx
36 pydantic
37 ];
38
39 nativeCheckInputs = [
40 pillow
41 pytest-asyncio
42 pytest-httpserver
43 pytestCheckHook
44 ];
45
46 __darwinAllowLocalNetworking = true;
47
48 pythonImportsCheck = [ "ollama" ];
49
50 disabledTestPaths = [
51 # Don't test the examples
52 "examples/"
53 ];
54
55 meta = {
56 description = "Ollama Python library";
57 homepage = "https://github.com/ollama/ollama-python";
58 changelog = "https://github.com/ollama/ollama-python/releases/tag/${src.tag}";
59 license = lib.licenses.mit;
60 maintainers = with lib.maintainers; [ fab ];
61 };
62}