2023-10-09 19:29:22 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, poetry-core
|
|
|
|
, importlib-metadata
|
|
|
|
, openai
|
|
|
|
, python-dotenv
|
|
|
|
, tiktoken
|
|
|
|
}:
|
|
|
|
let
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "0.11.1";
|
2023-10-09 19:29:22 +00:00
|
|
|
in
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "litellm";
|
|
|
|
format = "pyproject";
|
|
|
|
inherit version;
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "BerriAI";
|
|
|
|
repo = "litellm";
|
2023-10-19 13:55:26 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2023-11-16 04:20:00 +00:00
|
|
|
hash = "sha256-5Zk1lc7G0dU/AoLE5V+p30wE/gRfYRPsVS3sNgwWzCU=";
|
2023-10-09 19:29:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
rm -rf dist
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
poetry-core
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
importlib-metadata
|
|
|
|
openai
|
|
|
|
python-dotenv
|
|
|
|
tiktoken
|
|
|
|
];
|
|
|
|
|
|
|
|
# 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";
|
|
|
|
license = licenses.mit;
|
|
|
|
changelog = "https://github.com/BerriAI/litellm/releases/tag/v${version}";
|
|
|
|
maintainers = with maintainers; [ happysalada ];
|
|
|
|
};
|
|
|
|
}
|