Merge pull request #307098 from r-ryantm/auto-update/cilium-cli
[NixPkgs.git] / pkgs / development / python-modules / litellm / default.nix
bloba4cb72860af8266bb8e80cdcf7b46c310db0cc6c
1 { lib
2 , aiohttp
3 , apscheduler
4 , azure-identity
5 , azure-keyvault-secrets
6 , backoff
7 , buildPythonPackage
8 , click
9 , fastapi
10 , fastapi-sso
11 , fetchFromGitHub
12 , google-cloud-kms
13 , gunicorn
14 , importlib-metadata
15 , jinja2
16 , openai
17 , orjson
18 , poetry-core
19 , prisma
20 , pyjwt
21 , python-dotenv
22 , python-multipart
23 , pythonOlder
24 , pyyaml
25 , requests
26 , resend
27 , rq
28 , streamlit
29 , tiktoken
30 , tokenizers
31 , uvicorn
34 buildPythonPackage rec {
35   pname = "litellm";
36   version = "1.35.26";
37   pyproject = true;
39   disabled = pythonOlder "3.8";
41   src = fetchFromGitHub {
42     owner = "BerriAI";
43     repo = "litellm";
44     rev = "refs/tags/v${version}";
45     hash = "sha256-GJ7Gnt9LyKgiD0VvRP2wKeF3sOzDimVVIz2BRIKuAqg=";
46   };
48   postPatch = ''
49     rm -rf dist
50   '';
52   build-system = [
53     poetry-core
54   ];
56   dependencies = [
57     aiohttp
58     click
59     importlib-metadata
60     jinja2
61     openai
62     requests
63     python-dotenv
64     tiktoken
65     tokenizers
66   ];
68   passthru.optional-dependencies = {
69     proxy = [
70       apscheduler
71       backoff
72       fastapi
73       fastapi-sso
74       gunicorn
75       orjson
76       pyjwt
77       python-multipart
78       pyyaml
79       rq
80       uvicorn
81     ];
82     extra_proxy = [
83       azure-identity
84       azure-keyvault-secrets
85       google-cloud-kms
86       prisma
87       resend
88       streamlit
89     ];
90   };
92   # the import check phase fails trying to do a network request to openai
93   # pythonImportsCheck = [ "litellm" ];
95   # no tests
96   doCheck = false;
98   meta = with lib; {
99     description = "Use any LLM as a drop in replacement for gpt-3.5-turbo. Use Azure, OpenAI, Cohere, Anthropic, Ollama, VLLM, Sagemaker, HuggingFace, Replicate (100+ LLMs)";
100     mainProgram = "litellm";
101     homepage = "https://github.com/BerriAI/litellm";
102     changelog = "https://github.com/BerriAI/litellm/releases/tag/v${version}";
103     license = licenses.mit;
104     maintainers = with maintainers; [ happysalada ];
105   };