perf(kyojin): Skip prefix segments that cannot fit on disk

Bead: nix-overlay-tb3
This commit is contained in:
2026-11-18 18:31:54 +03:00
parent afd0c4b84d
commit 6156a0d904
4 changed files with 163 additions and 2 deletions
+20 -1
View File
@@ -1,10 +1,26 @@
{
pkgs,
kyojin,
exllamav3,
jitCheck,
cpuCheck,
}:
let
admissionPatch = ./prefix-disk-admission.patch;
engine = exllamav3.overrideAttrs (old: {
patches = (old.patches or [ ]) ++ [ admissionPatch ];
});
# Both the upstream serve wrappers and the CPU check prepend the wheel to PYTHONPATH.
withEngine =
script:
let
updated = builtins.replaceStrings [ "${exllamav3}/" ] [ "${engine}/" ] script;
in
assert updated != script;
updated;
in
kyojin.overrideAttrs (old: {
installPhase = withEngine old.installPhase;
# Upstream installs tools directly from $src, bypassing the unpacked tree.
src = pkgs.applyPatches {
src = old.src;
@@ -19,7 +35,10 @@ kyojin.overrideAttrs (old: {
category = "AI Inference";
tests = (old.passthru.tests or { }) // {
jit = jitCheck;
cpu = cpuCheck;
cpu = cpuCheck.overrideAttrs (check: {
patches = (check.patches or [ ]) ++ [ admissionPatch ];
checkPhase = withEngine check.checkPhase;
});
};
};
postFixup = ''