From c49e6cec34dcdc2324a82e0225177ec898d29450 Mon Sep 17 00:00:00 2001 From: "nekomimi.pet" Date: Fri, 16 Oct 2026 22:47:00 -0400 Subject: [PATCH] valefar: delete the Open WebUI module Nothing has imported it since 315b425, and the Khoj trial that took over its port is gone too (stopped with docker compose down; not in the flake). --- hosts/valefar/open-webui.nix | 69 ------------------------------------ 1 file changed, 69 deletions(-) delete mode 100644 hosts/valefar/open-webui.nix diff --git a/hosts/valefar/open-webui.nix b/hosts/valefar/open-webui.nix deleted file mode 100644 index baedba5..0000000 --- a/hosts/valefar/open-webui.nix +++ /dev/null @@ -1,69 +0,0 @@ -# Open WebUI, to try bonsai2 from a browser. It talks to llama-server's OpenAI API on loopback (ollama off) -# and, like the API, is reachable from the LAN and tailnet only through the socket proxy below. The first -# account created on it becomes the admin. -{ config, pkgs, ... }: -let - port = 8090; - # provider llama.cpp makes Open WebUI send each turn's reasoning back as reasoning_content, which bonsai's - # template keeps in history: the model sees its earlier thinking and follow-ups reuse the whole cached turn - openaiConfigs = builtins.toJSON { - "0" = { - enable = true; - provider = "llama.cpp"; - }; - }; - # Open WebUI reads the env value only into a fresh database; this writes it over whatever the UI saved - pinConfig = pkgs.writers.writePython3 "open-webui-pin-config" { } '' - import os - import sqlite3 - import time - - db = os.path.join(os.environ["STATE_DIRECTORY"], "data", "webui.db") - if os.path.exists(db): - con = sqlite3.connect(db) - found = con.execute( - "select 1 from sqlite_master where name = 'config'" - ).fetchone() - if found: - con.execute( - "insert into config (key, value, updated_at) values (?, ?, ?) " - "on conflict(key) do update set value = excluded.value, " - "updated_at = excluded.updated_at", - ("openai.api_configs", os.environ["OPENAI_API_CONFIGS"], - int(time.time())), - ) - con.commit() - ''; -in -{ - services.open-webui = { - enable = true; - host = "127.0.0.1"; - inherit port; - environment = { - OPENAI_API_BASE_URL = "http://127.0.0.1:8899/v1"; - OPENAI_API_KEY = "none"; - ENABLE_OLLAMA_API = "False"; - ANONYMIZED_TELEMETRY = "False"; - DO_NOT_TRACK = "True"; - SCARF_NO_ANALYTICS = "True"; - OPENAI_API_CONFIGS = openaiConfigs; - }; - }; - systemd.services.open-webui.serviceConfig.ExecStartPre = [ "${pinConfig}" ]; - - systemd.sockets.open-webui-lan = { - wantedBy = [ "sockets.target" ]; - listenStreams = [ - "10.0.0.30:${toString port}" - "100.64.0.11:${toString port}" - ]; - socketConfig.FreeBind = true; - }; - systemd.services.open-webui-lan = { - description = "Open WebUI proxy for the LAN and tailnet"; - requires = [ "open-webui.service" ]; - after = [ "open-webui.service" ]; - serviceConfig.ExecStart = "${config.systemd.package}/lib/systemd/systemd-socket-proxyd 127.0.0.1:${toString port}"; - }; -} -- 2.54.0