Gaetan Lepage
2026-01-17 14:40:07 +00:00
parent 0181e56767
commit 45e07196d2
+32 -34
View File
@@ -1,49 +1,40 @@
{
lib,
stdenv,
fetchFromGitHub,
python3,
python3Packages,
versionCheckHook,
writableTmpDirAsHomeHook,
}:
let
python = python3.override {
self = python;
packageOverrides = _: super: {
cattrs = super.cattrs.overridePythonAttrs (oldAttrs: rec {
version = "23.1.2";
build-system = [ super.poetry-core ];
src = oldAttrs.src.override {
tag = "v${version}";
hash = "sha256-YO4Clbo5fmXbysxwwM2qCHJwO5KwDC05VctRVFruJcw=";
};
});
};
};
in
python.pkgs.buildPythonApplication rec {
python3Packages.buildPythonApplication (finalAttrs: {
pname = "openllm";
version = "0.6.10";
version = "0.6.30";
pyproject = true;
src = fetchFromGitHub {
owner = "bentoml";
repo = "openllm";
tag = "v${version}";
hash = "sha256-4KIpe6KjbBDDUj0IjzSccxjgZyBoaUVIQJYk1+W01Vo=";
tag = "v${finalAttrs.version}";
hash = "sha256-uFisSbWF7Gec7Fthts45kvFnA4aGkzYppt4t8o12Fak=";
};
pythonRemoveDeps = [
"pathlib"
"pip-requirements-parser"
];
postPatch = ''
substituteInPlace pyproject.toml \
--replace-fail "hatchling==1.27.0" "hatchling" \
--replace-fail "hatch-vcs==0.4.0" "hatch-vcs"
'';
pythonRelaxDeps = [ "openai" ];
build-system = with python.pkgs; [
build-system = with python3Packages; [
hatch-vcs
hatchling
];
dependencies = with python.pkgs; [
pythonRelaxDeps = [
"bentoml"
"openai"
];
dependencies = with python3Packages; [
accelerate
bentoml
dulwich
@@ -57,15 +48,22 @@ python.pkgs.buildPythonApplication rec {
uv
];
# no tests
doCheck = false;
pythonImportsCheck = [ "openllm" ];
# No python tests
nativeCheckInputs = [
versionCheckHook
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
# PermissionError: [Errno 1] Operation not permitted: '/var/empty/.openllm'
writableTmpDirAsHomeHook
];
versionCheckKeepEnvironment = lib.optionals stdenv.hostPlatform.isDarwin [ "HOME" ];
meta = {
description = "Run any open-source LLMs, such as Llama 3.1, Gemma, as OpenAI compatible API endpoint in the cloud";
homepage = "https://github.com/bentoml/OpenLLM";
changelog = "https://github.com/bentoml/OpenLLM/releases/tag/v${version}";
changelog = "https://github.com/bentoml/OpenLLM/releases/tag/${finalAttrs.src.tag}";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [
happysalada
@@ -73,4 +71,4 @@ python.pkgs.buildPythonApplication rec {
];
mainProgram = "openllm";
};
}
})