e7ec2969af
GitOrigin-RevId: 9b19f5e77dd906cb52dade0b7bd280339d2a1f3d
66 lines
1.3 KiB
Nix
66 lines
1.3 KiB
Nix
{ lib
|
|
, buildPythonPackage
|
|
, fetchFromGitHub
|
|
, poetry-core
|
|
, importlib-metadata
|
|
, openai
|
|
, python-dotenv
|
|
, tiktoken
|
|
, tokenizers
|
|
, click
|
|
, jinja2
|
|
, certifi
|
|
, appdirs
|
|
, aiohttp
|
|
, httpx
|
|
}:
|
|
let
|
|
version = "1.17.0";
|
|
in
|
|
buildPythonPackage rec {
|
|
pname = "litellm";
|
|
format = "pyproject";
|
|
inherit version;
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "BerriAI";
|
|
repo = "litellm";
|
|
rev = "refs/tags/v${version}";
|
|
hash = "sha256-lH0J5QFjSHOkHZWZQaH5ig6d9vWm7Mj02ssVc6lE4Uo=";
|
|
};
|
|
|
|
postPatch = ''
|
|
rm -rf dist
|
|
'';
|
|
|
|
nativeBuildInputs = [
|
|
poetry-core
|
|
];
|
|
|
|
propagatedBuildInputs = [
|
|
openai
|
|
python-dotenv
|
|
tiktoken
|
|
importlib-metadata
|
|
tokenizers
|
|
click
|
|
jinja2
|
|
certifi
|
|
appdirs
|
|
aiohttp
|
|
];
|
|
|
|
# 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 ];
|
|
};
|
|
}
|