2023-10-09 19:29:22 +00:00
|
|
|
{ lib
|
2024-02-29 20:09:43 +00:00
|
|
|
, aiohttp
|
|
|
|
, apscheduler
|
|
|
|
, azure-identity
|
|
|
|
, azure-keyvault-secrets
|
|
|
|
, backoff
|
2023-10-09 19:29:22 +00:00
|
|
|
, buildPythonPackage
|
2024-02-29 20:09:43 +00:00
|
|
|
, click
|
|
|
|
, fastapi
|
|
|
|
, fastapi-sso
|
2023-10-09 19:29:22 +00:00
|
|
|
, fetchFromGitHub
|
2024-02-29 20:09:43 +00:00
|
|
|
, google-cloud-kms
|
|
|
|
, gunicorn
|
2023-10-09 19:29:22 +00:00
|
|
|
, importlib-metadata
|
2024-02-29 20:09:43 +00:00
|
|
|
, jinja2
|
2023-10-09 19:29:22 +00:00
|
|
|
, openai
|
2024-02-29 20:09:43 +00:00
|
|
|
, orjson
|
|
|
|
, poetry-core
|
|
|
|
, prisma
|
|
|
|
, pyjwt
|
2023-10-09 19:29:22 +00:00
|
|
|
, python-dotenv
|
2024-02-29 20:09:43 +00:00
|
|
|
, python-multipart
|
|
|
|
, pythonOlder
|
|
|
|
, pyyaml
|
|
|
|
, requests
|
|
|
|
, resend
|
|
|
|
, rq
|
|
|
|
, streamlit
|
2023-10-09 19:29:22 +00:00
|
|
|
, tiktoken
|
2024-01-02 11:29:13 +00:00
|
|
|
, tokenizers
|
2024-02-29 20:09:43 +00:00
|
|
|
, uvicorn
|
2023-10-09 19:29:22 +00:00
|
|
|
}:
|
2024-02-29 20:09:43 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2023-10-09 19:29:22 +00:00
|
|
|
pname = "litellm";
|
2024-02-29 20:09:43 +00:00
|
|
|
version = "1.28.0";
|
2024-02-07 01:22:34 +00:00
|
|
|
pyproject = true;
|
2023-10-09 19:29:22 +00:00
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
disabled = pythonOlder "3.8";
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "BerriAI";
|
|
|
|
repo = "litellm";
|
2023-10-19 13:55:26 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-02-29 20:09:43 +00:00
|
|
|
hash = "sha256-rmgKitWY2YFa+L9vpjXCsx5rCS2UrrobyKoleP5taG0=";
|
2023-10-09 19:29:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
rm -rf dist
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
poetry-core
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
2024-02-29 20:09:43 +00:00
|
|
|
aiohttp
|
|
|
|
click
|
|
|
|
importlib-metadata
|
|
|
|
jinja2
|
2023-10-09 19:29:22 +00:00
|
|
|
openai
|
2024-02-29 20:09:43 +00:00
|
|
|
requests
|
2023-10-09 19:29:22 +00:00
|
|
|
python-dotenv
|
|
|
|
tiktoken
|
2024-01-02 11:29:13 +00:00
|
|
|
tokenizers
|
2023-10-09 19:29:22 +00:00
|
|
|
];
|
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
passthru.optional-dependencies = {
|
|
|
|
proxy = [
|
|
|
|
apscheduler
|
|
|
|
backoff
|
|
|
|
fastapi
|
|
|
|
fastapi-sso
|
|
|
|
gunicorn
|
|
|
|
orjson
|
|
|
|
pyjwt
|
|
|
|
python-multipart
|
|
|
|
pyyaml
|
|
|
|
rq
|
|
|
|
uvicorn
|
|
|
|
];
|
|
|
|
extra_proxy = [
|
|
|
|
azure-identity
|
|
|
|
azure-keyvault-secrets
|
|
|
|
google-cloud-kms
|
|
|
|
prisma
|
|
|
|
resend
|
|
|
|
streamlit
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
# the import check phase fails trying to do a network request to openai
|
|
|
|
# pythonImportsCheck = [ "litellm" ];
|
|
|
|
|
|
|
|
# no tests
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
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)";
|
|
|
|
homepage = "https://github.com/BerriAI/litellm";
|
|
|
|
changelog = "https://github.com/BerriAI/litellm/releases/tag/v${version}";
|
2024-02-29 20:09:43 +00:00
|
|
|
license = licenses.mit;
|
2023-10-09 19:29:22 +00:00
|
|
|
maintainers = with maintainers; [ happysalada ];
|
|
|
|
};
|
|
|
|
}
|