feat(pi): add vision model support

Extract a shared hasType helper for model filtering and add
vision (text + image) input capability to compatible models.
Also tag two llama-swap models with the vision type.
This commit is contained in:
2026-05-01 15:03:26 -04:00
parent ab63211a75
commit 1812d2ea03
2 changed files with 20 additions and 5 deletions

View File

@@ -13,9 +13,9 @@ in
toPiModels = toPiModels =
llamaSwapConfig: llamaSwapConfig:
let let
textGenModels = filterAttrs (name: model: any (t: t == "coding") (model.metadata.type or [ ])) ( hasType = type: model: any (t: t == type) (model.metadata.type or [ ]);
llamaSwapConfig.models or { }
); codingModels = filterAttrs (_name: model: hasType "coding" model) (llamaSwapConfig.models or { });
localModels = mapAttrs localModels = mapAttrs
( (
@@ -32,8 +32,19 @@ in
else else
{ } { }
) )
// (
if hasType "vision" model then
{
input = [
"text"
"image"
];
}
else
{ }
) )
textGenModels; )
codingModels;
peerModels = listToAttrs ( peerModels = listToAttrs (
flatten ( flatten (

View File

@@ -335,7 +335,10 @@ in
-dev CUDA1 -dev CUDA1
''; '';
metadata = { metadata = {
type = [ "text-generation" ]; type = [
"text-generation"
"vision"
];
}; };
}; };
@@ -612,6 +615,7 @@ in
type = [ type = [
"text-generation" "text-generation"
"coding" "coding"
"vision"
]; ];
}; };
}; };