Something went wrong. Try again.
lol
Something went wrong. Try again.
2.9 kB · 162 lines
Nix
at master
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163{ lib, aiohttp, apscheduler, azure-identity, azure-keyvault-secrets, azure-storage-blob, backoff, boto3, buildPythonPackage, click, cryptography, fastapi, fastapi-sso, fastuuid, fetchFromGitHub, google-cloud-iam, google-cloud-kms, gunicorn, httpx, importlib-metadata, jinja2, jsonschema, mcp, openai, orjson, poetry-core, polars, prisma, pydantic, pyjwt, pynacl, python, python-dotenv, python-multipart, pyyaml, requests, resend, rich, rq, soundfile, tiktoken, tokenizers, uvloop, uvicorn, websockets, nixosTests, nix-update-script,}:
buildPythonPackage rec { pname = "litellm"; version = "1.83.7"; pyproject = true;
src = fetchFromGitHub { owner = "BerriAI"; repo = "litellm"; tag = "v${version}-stable"; hash = "sha256-oVQ0FHZmXDY7HU4AMEQ9xcl10mIbqja9/j2mdunTWI4="; };
build-system = [ poetry-core ];
dependencies = [ aiohttp click fastuuid httpx importlib-metadata jinja2 jsonschema openai pydantic python-dotenv requests tiktoken tokenizers ];
optional-dependencies = { proxy = [ apscheduler azure-identity azure-storage-blob backoff boto3 cryptography fastapi fastapi-sso gunicorn # FIXME package litellm-enterprise # FIXME package litellm-proxy-extras mcp orjson polars pyjwt pynacl python-multipart pyyaml rich rq soundfile uvloop uvicorn websockets ];
extra_proxy = [ azure-identity azure-keyvault-secrets google-cloud-iam google-cloud-kms prisma # FIXME package redisvl resend ]; };
pythonImportsCheck = [ "litellm" "litellm_enterprise" ];
pythonRelaxDeps = [ "aiohttp" "click" "importlib-metadata" "jsonschema" "openai" "python-dotenv" ];
# access network doCheck = false;
postFixup = '' # Symlink litellm_enterprise to make it discoverable pushd $out/lib/python${python.pythonVersion}/site-packages ln -s enterprise/litellm_enterprise litellm_enterprise popd '';
passthru = { tests = { inherit (nixosTests) litellm; }; updateScript = nix-update-script { extraArgs = [ "--version-regex" "v([0-9]+\\.[0-9]+\\.[0-9]+)-stable" ]; }; };
meta = { 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)"; mainProgram = "litellm"; homepage = "https://github.com/BerriAI/litellm"; changelog = "https://github.com/BerriAI/litellm/releases/tag/${src.tag}"; license = lib.licenses.mit; maintainers = with lib.maintainers; [ happysalada ]; };}