1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 cachetools,
6 numpy,
7 pythonOlder,
8 redis,
9 redis-om,
10 requests,
11}:
12
13buildPythonPackage rec {
14 pname = "gptcache";
15 version = "0.1.44";
16 format = "setuptools";
17
18 disabled = pythonOlder "3.8.1";
19
20 src = fetchFromGitHub {
21 owner = "zilliztech";
22 repo = "GPTCache";
23 tag = version;
24 hash = "sha256-FRqngDyGO0ReTRtm9617TFLHVXWY9/NQlZHlBP8ukg0=";
25 };
26
27 propagatedBuildInputs = [
28 cachetools
29 numpy
30 redis
31 redis-om
32 requests
33 ];
34
35 # many tests require network access and complicated dependencies
36 doCheck = false;
37
38 pythonImportsCheck = [ "gptcache" ];
39
40 meta = with lib; {
41 description = "Semantic cache for LLMs and fully integrated with LangChain and llama_index";
42 mainProgram = "gptcache_server";
43 homepage = "https://github.com/zilliztech/GPTCache";
44 changelog = "https://github.com/zilliztech/GPTCache/releases/tag/${version}";
45 license = licenses.mit;
46 maintainers = with maintainers; [ natsukium ];
47 };
48}