From 3e35fea1834af314fbe464137255d7c064c18e3f Mon Sep 17 00:00:00 2001 From: Simon Gardling Date: Thu, 2 Apr 2026 17:57:51 -0400 Subject: [PATCH] pi: fix openrouter apiKey, add llama.cpp provider openrouter was broken: !cat + nix store path is not valid omp config. Use builtins.readFile to inline the key at eval time. Add self-hosted llama.cpp provider at llm.sigkill.computer with Bearer token auth. --- home-manager/progs/pi.nix | 9 +++++++-- home-manager/secrets/llama_cpp_api_key | Bin 0 -> 87 bytes 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 home-manager/secrets/llama_cpp_api_key diff --git a/home-manager/progs/pi.nix b/home-manager/progs/pi.nix index 9b529b8..045498b 100644 --- a/home-manager/progs/pi.nix +++ b/home-manager/progs/pi.nix @@ -18,11 +18,16 @@ let }; }; - # provider config — openrouter API key read from secrets at runtime + # provider config — secrets read at eval time via builtins.readFile + # (omp treats apiKey as env-var-name-or-literal, not a shell command) ompModels = { providers = { openrouter = { - apiKey = "!cat ${../secrets/openrouter_api_key}"; + apiKey = lib.strings.trim (builtins.readFile ../secrets/openrouter_api_key); + }; + "llama.cpp" = { + baseUrl = "https://llm.sigkill.computer"; + apiKey = lib.strings.trim (builtins.readFile ../secrets/llama_cpp_api_key); }; }; }; diff --git a/home-manager/secrets/llama_cpp_api_key b/home-manager/secrets/llama_cpp_api_key new file mode 100644 index 0000000000000000000000000000000000000000..7aba54fa4620261b22d9ed57183ddd26cd7fbbc9 GIT binary patch literal 87 zcmZQ@_Y83kiVO&0_$#q+bN2PRwc^zRo3Go?k13py8O(5q?_pVOKuoRA>GadV0Ya;G t%CpU7b8akr3$&MbEa5F$|1!;FWlx8<001YfB$5CC literal 0 HcmV?d00001