summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/gptcache/default.nix
blob: 7b79d8d9d261087272af34cdbabdecdc66b3319f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  cachetools,
  numpy,
  pythonOlder,
  redis,
  redis-om,
  requests,
}:

buildPythonPackage rec {
  pname = "gptcache";
  version = "0.1.44";
  format = "setuptools";

  disabled = pythonOlder "3.8.1";

  src = fetchFromGitHub {
    owner = "zilliztech";
    repo = "GPTCache";
    tag = version;
    hash = "sha256-FRqngDyGO0ReTRtm9617TFLHVXWY9/NQlZHlBP8ukg0=";
  };

  propagatedBuildInputs = [
    cachetools
    numpy
    redis
    redis-om
    requests
  ];

  # many tests require network access and complicated dependencies
  doCheck = false;

  pythonImportsCheck = [ "gptcache" ];

  meta = {
    description = "Semantic cache for LLMs and fully integrated with LangChain and llama_index";
    mainProgram = "gptcache_server";
    homepage = "https://github.com/zilliztech/GPTCache";
    changelog = "https://github.com/zilliztech/GPTCache/releases/tag/${version}";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ natsukium ];
  };
}