feat(llm): testing some local models

This commit is contained in:
2025-10-16 21:20:40 +02:00
parent cd978f5eb6
commit 3d8deae6f3
7 changed files with 97 additions and 27 deletions

30
flake.lock generated
View File

@@ -212,11 +212,11 @@
"rust-analyzer-src": "rust-analyzer-src"
},
"locked": {
"lastModified": 1760510549,
"narHash": "sha256-NP+kmLMm7zSyv4Fufv+eSJXyqjLMUhUfPT6lXRlg/bU=",
"lastModified": 1760596988,
"narHash": "sha256-+h9FVfiNnsWKpk2HiaecPocq4gWD9GNn5/eVS3I9Z+8=",
"owner": "nix-community",
"repo": "fenix",
"rev": "ef7178cf086f267113b5c48fdeb6e510729c8214",
"rev": "8e99c7d8e07635dea2e1001485f9de41bb1587f2",
"type": "github"
},
"original": {
@@ -803,11 +803,11 @@
"xdph": "xdph"
},
"locked": {
"lastModified": 1760531859,
"narHash": "sha256-akjHaa54IEBlgeDNwVuuNdkttbDOStgXpDXeJ5GR2QI=",
"lastModified": 1760621586,
"narHash": "sha256-sIbe3te3RrL9PY4ASKGwv1KuJs0pyn4Zvo3xIF3jFms=",
"owner": "hyprwm",
"repo": "hyprland",
"rev": "ab11af9664a80df70fe3398810b79c4298312a33",
"rev": "8164b90bc2839d4d2a10c0d2b26c4a413ecf90b2",
"type": "github"
},
"original": {
@@ -1278,11 +1278,11 @@
]
},
"locked": {
"lastModified": 1760493063,
"narHash": "sha256-yYqrMI9jg7vTjHu4wOiER9HmqE+NvOqOjfYzuMsTo3Y=",
"lastModified": 1760579393,
"narHash": "sha256-YuXbuaJ/2EZ1FePhz1eTyo/b+kpiEmw4lj6wX0u0Q/0=",
"owner": "fufexan",
"repo": "nix-gaming",
"rev": "d7f6ab23b939e6e1247321a0e63a89cacb98c03c",
"rev": "7d002241668a738df3973a6c07ef5d79e5508b24",
"type": "github"
},
"original": {
@@ -1443,11 +1443,11 @@
},
"nixpkgs_8": {
"locked": {
"lastModified": 1760284886,
"narHash": "sha256-TK9Kr0BYBQ/1P5kAsnNQhmWWKgmZXwUQr4ZMjCzWf2c=",
"lastModified": 1760524057,
"narHash": "sha256-EVAqOteLBFmd7pKkb0+FIUyzTF61VKi7YmvP1tw4nEw=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "cf3f5c4def3c7b5f1fc012b3d839575dbe552d43",
"rev": "544961dfcce86422ba200ed9a0b00dd4b1486ec5",
"type": "github"
},
"original": {
@@ -1626,11 +1626,11 @@
"rust-analyzer-src": {
"flake": false,
"locked": {
"lastModified": 1760457219,
"narHash": "sha256-WJOUGx42hrhmvvYcGkwea+BcJuQJLcns849OnewQqX4=",
"lastModified": 1760497432,
"narHash": "sha256-ImhJMtnkBlADdrC8jzMDflhA4WMdaCRKkhsJC2pzPcM=",
"owner": "rust-lang",
"repo": "rust-analyzer",
"rev": "8747cf81540bd1bbbab9ee2702f12c33aa887b46",
"rev": "fcfff0827f64a91f5676d617f0d4dd8b58eefbd1",
"type": "github"
},
"original": {

View File

@@ -73,8 +73,8 @@
enable = false;
};
hyprland = {
enable = false;
withUWSM = false;
enable = true;
withUWSM = true;
};
inkscape = {
enable = false;
@@ -86,7 +86,7 @@
enable = true;
};
niri = {
enable = true;
enable = false;
};
pkgs = {
enable = true;

View File

@@ -73,6 +73,18 @@
category = "Services";
};
};
ollama = {
enable = true;
subdomain = "ai";
exposure = "local";
port = 8001;
homepage = {
name = "ollama";
description = "AI platform";
icon = "ollama.svg";
category = "Services";
};
};
bazarr = {
enable = true;
subdomain = "bazarr";

View File

@@ -157,6 +157,38 @@ in {
];
};
})
(lib.mkIf cfg.ollama.enable {
intel-llm = {
autoStart = true;
image = "intelanalytics/ipex-llm-inference-cpp-xpu:latest";
devices = [
"/dev/dri:/dev/dri:rwm"
];
volumes = [
"/var/lib/ollama:/models"
];
environment = {
OLLAMA_ORIGINS = "http://192.168.*";
SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS = "1";
ONEAPI_DEVICE_SELECTOR = "level_zero:0";
OLLAMA_HOST = "[::]:11434";
no_proxy = "localhost,127.0.0.1";
DEVICE = "Arc";
OLLAMA_NUM_GPU = "999";
ZES_ENABLE_SYSMAN = "1";
};
cmd = [
"/bin/sh"
"-c"
"/llm/scripts/start-ollama.sh && echo 'Startup script finished, container is now idling.' && sleep infinity"
];
extraOptions = [
"--net=host"
"--memory=32G"
"--shm-size=16g"
];
};
})
];
};
}

View File

@@ -9,6 +9,7 @@
./lidarr
./n8n
./nextcloud
./ollama
./prowlarr
./radarr
./sonarr

View File

@@ -0,0 +1,27 @@
{
config,
lib,
pkgs,
...
}: let
unit = "ollama";
cfg = config.server.services.${unit};
in {
config = lib.mkIf cfg.enable {
environment.systemPackages = with pkgs; [
intel-compute-runtime
intel-graphics-compiler
level-zero
];
services.open-webui = {
enable = true;
host = "0.0.0.0";
port = 8001;
environment = {
ANONYMIZED_TELEMETRY = "False";
BYPASS_MODEL_ACCESS_CONTROL = "True";
OLLAMA_BASE_URL = "http://localhost:11434";
};
};
};
}

View File

@@ -5,9 +5,7 @@
"aarch64-linux"
];
perSystem =
{ pkgs, ... }:
{
perSystem = {pkgs, ...}: {
packages = {
# instant repl with automatic flake loading
repl = pkgs.callPackage ./repl {};