Skip to content

Commit

Permalink
add urlPrefix for infinity nixos module
Browse files Browse the repository at this point in the history
  • Loading branch information
jpetrucciani committed Jan 2, 2025
1 parent 0e23017 commit 503b862
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion hosts/modules/servers/infinity.nix
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ in
];
description = "the list of embeddings models to load";
};
urlPrefix = mkOption {
type = str;
default = "/v2";
description = "a prefix for each endpoint to have";
};
extraFlags = mkOption {
type = str;
description = "any extra flags to pass to infinity";
Expand Down Expand Up @@ -86,7 +91,7 @@ in
map (model: "--model-id '${lib.replaceStrings ["'"] [""] model}'") cfg.models
);
serve = pkgs.writers.writeBash "infinity-serve" ''
${lib.getExe' cfg.package "infinity_emb"} v2 --host '${cfg.address}' --port '${toString cfg.port}' ${models} ${cfg.extraFlags}
${lib.getExe' cfg.package "infinity_emb"} v2 --url-prefix "${cfg.urlPrefix}" --host '${cfg.address}' --port '${toString cfg.port}' ${models} ${cfg.extraFlags}
'';
in
{
Expand Down

0 comments on commit 503b862

Please sign in to comment.