From 1812d2ea03e28b3175ab20fdc71ff3cddf8e78a0 Mon Sep 17 00:00:00 2001 From: Evan Reichard Date: Fri, 1 May 2026 15:03:26 -0400 Subject: [PATCH] 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. --- modules/home/programs/terminal/pi/lib.nix | 19 +++++++++++++++---- modules/nixos/services/llama-swap/config.nix | 6 +++++- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/modules/home/programs/terminal/pi/lib.nix b/modules/home/programs/terminal/pi/lib.nix index d478e76..c955195 100644 --- a/modules/home/programs/terminal/pi/lib.nix +++ b/modules/home/programs/terminal/pi/lib.nix @@ -13,9 +13,9 @@ in toPiModels = llamaSwapConfig: let - textGenModels = filterAttrs (name: model: any (t: t == "coding") (model.metadata.type or [ ])) ( - llamaSwapConfig.models or { } - ); + hasType = type: model: any (t: t == type) (model.metadata.type or [ ]); + + codingModels = filterAttrs (_name: model: hasType "coding" model) (llamaSwapConfig.models or { }); localModels = mapAttrs ( @@ -32,8 +32,19 @@ in else { } ) + // ( + if hasType "vision" model then + { + input = [ + "text" + "image" + ]; + } + else + { } + ) ) - textGenModels; + codingModels; peerModels = listToAttrs ( flatten ( diff --git a/modules/nixos/services/llama-swap/config.nix b/modules/nixos/services/llama-swap/config.nix index a73633b..e472530 100644 --- a/modules/nixos/services/llama-swap/config.nix +++ b/modules/nixos/services/llama-swap/config.nix @@ -335,7 +335,10 @@ in -dev CUDA1 ''; metadata = { - type = [ "text-generation" ]; + type = [ + "text-generation" + "vision" + ]; }; }; @@ -612,6 +615,7 @@ in type = [ "text-generation" "coding" + "vision" ]; }; };