1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 11:36:05 +01:00

local-ai: init module (#6718)

This commit is contained in:
Ilya Savitsky 2025-11-03 04:04:44 +00:00 committed by GitHub
parent 50a5766d51
commit 61f2cc5908
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 92 additions and 0 deletions

View file

@ -0,0 +1,6 @@
{ lib, pkgs, ... }:
lib.optionalAttrs pkgs.stdenv.hostPlatform.isLinux {
local-ai-enabled = ./enabled.nix;
local-ai-enabled-with-environment = ./enabled-with-environment.nix;
}

View file

@ -0,0 +1,20 @@
{ ... }:
{
services.local-ai = {
enable = true;
environment = {
MODELS_PATH = "/tmp/models";
PRELOAD_MODELS = "[{ \"url\": \"https://huggingface.co/TheBloke/Mistral-7B-Instruct-v0.2-GGUF/resolve/main/mistral-7b-instruct-v0.2.Q4_K_M.gguf\", \"name\": \"mistral-7b-instruct-v0.2.Q4_K_M.gguf\" }]";
};
};
nmt.script = ''
assertFileContains \
home-files/.config/systemd/user/local-ai.service \
"Environment=MODELS_PATH=/tmp/models"
assertFileContains \
home-files/.config/systemd/user/local-ai.service \
"Environment=PRELOAD_MODELS=[{ \"url\": \"https://huggingface.co/TheBloke/Mistral-7B-Instruct-v0.2-GGUF/resolve/main/mistral-7b-instruct-v0.2.Q4_K_M.gguf\", \"name\": \"mistral-7b-instruct-v0.2.Q4_K_M.gguf\" }]"
'';
}

View file

@ -0,0 +1,9 @@
{ ... }:
{
services.local-ai.enable = true;
nmt.script = ''
assertFileExists home-files/.config/systemd/user/local-ai.service
'';
}