2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
pythonOlder,
|
|
|
|
bentoml,
|
|
|
|
hatch-fancy-pypi-readme,
|
|
|
|
hatch-vcs,
|
|
|
|
hatchling,
|
|
|
|
anyio,
|
|
|
|
distro,
|
|
|
|
httpx,
|
|
|
|
httpx-auth,
|
|
|
|
openllm-core,
|
|
|
|
soundfile,
|
|
|
|
transformers,
|
2023-10-09 19:29:22 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
inherit (openllm-core) src version;
|
|
|
|
pname = "openllm-client";
|
2023-11-16 04:20:00 +00:00
|
|
|
pyproject = true;
|
2023-10-09 19:29:22 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.8";
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
sourceRoot = "${src.name}/openllm-client";
|
2023-10-09 19:29:22 +00:00
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace-fail "hatchling==1.18.0" "hatchling" \
|
2024-04-21 15:54:59 +00:00
|
|
|
--replace-fail "hatch-vcs==0.3.0" "hatch-vcs" \
|
|
|
|
--replace-fail "hatch-fancy-pypi-readme==23.1.0" "hatch-fancy-pypi-readme"
|
2024-02-29 20:09:43 +00:00
|
|
|
'';
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
build-system = [
|
2023-10-09 19:29:22 +00:00
|
|
|
hatch-fancy-pypi-readme
|
|
|
|
hatch-vcs
|
|
|
|
hatchling
|
|
|
|
];
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
dependencies = [
|
2024-01-02 11:29:13 +00:00
|
|
|
anyio
|
|
|
|
distro
|
2023-10-09 19:29:22 +00:00
|
|
|
httpx
|
2024-01-02 11:29:13 +00:00
|
|
|
openllm-core
|
2023-10-09 19:29:22 +00:00
|
|
|
];
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
optional-dependencies = {
|
2024-06-05 15:53:02 +00:00
|
|
|
grpc = [ bentoml ] ++ bentoml.optional-dependencies.grpc;
|
|
|
|
auth = [ httpx-auth ];
|
2023-10-09 19:29:22 +00:00
|
|
|
agents = [
|
|
|
|
transformers
|
|
|
|
# diffusers
|
|
|
|
soundfile
|
2024-01-25 14:12:00 +00:00
|
|
|
] ++ transformers.optional-dependencies.agents;
|
2024-04-21 15:54:59 +00:00
|
|
|
full = optional-dependencies.grpc ++ optional-dependencies.agents;
|
2023-10-09 19:29:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# there is no tests
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "openllm_client" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Interacting with OpenLLM HTTP/gRPC server, or any BentoML server";
|
|
|
|
homepage = "https://github.com/bentoml/OpenLLM/tree/main/openllm-client";
|
|
|
|
changelog = "https://github.com/bentoml/OpenLLM/blob/${src.rev}/CHANGELOG.md";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ natsukium ];
|
|
|
|
};
|
|
|
|
}
|