Enable ollama web-ui

This commit is contained in:
Username404-59 2026-07-02 02:15:15 +02:00
parent 9b332d1f34
commit f7b57fb162
Signed by: Username404-59
GPG Key ID: F3A1878B14F5F0D7
5 changed files with 65 additions and 20 deletions

63
common/ollama-config.nix Normal file
View File

@ -0,0 +1,63 @@
{ pkgs, config, isLaptop, ... }:
{
services.ollama = {
enable = true;
package = pkgs.ollama-vulkan;
loadModels = [
(if isLaptop then "qwen3.5:9b" else "qwen3.6:27b")
];
};
services.open-webui = {
enable = true;
port = 6767;
openFirewall = false;
environment = {
WEBUI_AUTH = "False"; # No need for auth since it's only accessible by me
OFFLINE_MODE = "True"; # Update checks & model downloads aren't needed
SAFE_MODE = "True";
BYPASS_MODEL_ACCESS_CONTROL = "True";
ENABLE_COMPRESSION_MIDDLEWARE = "False"; # Not needed since I access it via localhost
DEFAULT_RAG_TEMPLATE = ''
### Task:
Respond to the user query using the provided context, incorporating inline citations in the format [id] **only when the <source> tag includes an explicit id attribute** (e.g., <source id="1">).
### Guidelines:
- If you don't know the answer, clearly state that.
- If uncertain, ask the user for clarification.
- Respond in the same language as the user's query.
- If the context is unreadable or of poor quality, inform the user and provide the best possible answer.
- If the answer isn't present in the context but you possess the knowledge, explain this to the user and provide the answer using your own understanding.
- **Only include inline citations using [id] (e.g., [1], [2]) when the <source> tag includes an id attribute.**
- Do not cite if the <source> tag does not contain an id attribute.
- Do not use XML tags in your response.
- Ensure citations are concise and directly related to the information provided.
### Example of Citation:
If the user asks about a specific topic and the information is found in a source with a provided id attribute, the response should include the citation like in the following example:
* "According to the study, the proposed method increases efficiency by 20% [1]."
### Output:
Provide a clear and direct response in the french Chtimi dialect to the user's query, including inline citations in the format [id] only when the <source> tag with id attribute is present in the context.
<context>
{{CONTEXT}}
</context>
'';
};
};
/* TODO: Uncomment when odysseus package supports non-flake installation (& disable open-webui)
services.odysseus = {
enable = true;
xdg.dataHome."odysseus/odysseus-env".source = ./odysseus/.env;
# https://github.com/pewdiepie-archdaemon/odysseus/blob/dev/.env.example
environmentFile = "${config.xdg.dataHome}}/odysseus/odysseus-env";
host = "127.0.0.1";
port = 6767;
};
*/
}

View File

@ -69,6 +69,8 @@ in
./modules/audio.nix
./modules/ananicy.nix
./common/ollama-config.nix
# ISO installer building stuff:
./ISO/iso.nix
];

View File

@ -92,7 +92,6 @@ in
./discord-config.nix
./firefox-config.nix
./mpv-config.nix
./ollama-config.nix
spicetify-nix.homeManagerModules.spicetify
./spicetify-config.nix
];

View File

@ -1,18 +0,0 @@
{ pkgs, config, ... }:
{
services.ollama = {
enable = false; # TODO Enable when odysseus package supports non-flake installation
package = pkgs.ollama-vulkan;
};
/*
services.odysseus = {
enable = true;
xdg.dataHome."odysseus/odysseus-env".source = ./odysseus/.env;
# https://github.com/pewdiepie-archdaemon/odysseus/blob/dev/.env.example
environmentFile = "${config.xdg.dataHome}}/odysseus/odysseus-env";
host = "127.0.0.1";
port = 8008;
};
*/
}

View File

@ -8,7 +8,6 @@
,"flake-compat":{"sn":"flake-compat-src","kd":[1,{"ft":0,"ur":"https://github.com/NixOS/flake-compat/archive/5edf11c44bc78a0d334f6334cdaf7d60d732daab.tar.gz","ms":[]}],"ha":{"al":2,"vl":"blake3-MmtcMfj5QuWGiFGGOdUMcaS0MSNzyV8dNCcsrPQq+Gk="},"fv":"5edf11c44bc78a0d334f6334cdaf7d60d732daab","ps":[]}
,"home-manager":{"sn":"home-manager-src","kd":[1,{"ft":0,"ur":"https://github.com/nix-community/home-manager/archive/d32537981c036473cf6990ae03176a5d84c43b29.tar.gz","ms":[]}],"ha":{"al":2,"vl":"blake3-PZL131S3WQvCFTGa262ywuyJi6zUXfdaTJ6/6CPD9Ns="},"fv":"d32537981c036473cf6990ae03176a5d84c43b29","ps":[]}
,"hypr-darkwindow":{"sn":"hypr-darkwindow-src","kd":[1,{"ft":0,"ur":"https://github.com/micha4w/Hypr-DarkWindow/archive/refs/tags/v0.55.4.tar.gz","ms":[]}],"ha":{"al":2,"vl":"blake3-prh51kFbHKZT0ZmWDlv3s/Mg+Mg/mYAIo3FxZ+UsVbo="},"fv":"5dcd175c540e9eef91550c97ed0798c6e0fdc31b90af9643e05cb5ba66c64f6a","ps":[]}
,"infinity-scheduler":{"sn":"infinity-scheduler-src","kd":[1,{"ft":0,"ur":"https://github.com/galpt/infinity-scheduler/archive/be1d6c778b9e0c0ee7c266ae9ee32deb2dbce1f8.tar.gz","ms":[]}],"ha":{"al":2,"vl":"blake3-GiX8axvBPbKsH7iOB/9xHfW+GeSb9V8UCQEtwYVb6y0="},"fv":"be1d6c778b9e0c0ee7c266ae9ee32deb2dbce1f8","ps":[]}
,"lact-patch":{"sn":"lact-patch-src","kd":[0,{"ft":0,"ur":"https://patch-diff.githubusercontent.com/raw/ilya-zlobintsev/LACT/pull/1080.patch","ms":[]}],"ha":{"al":2,"vl":"blake3-x+HU/32454H6ZHu2i3AkdPECt9Jj4vW0Ac2jTzjpUvk="},"fv":"W/735aa2b881ef2024d0d6fcb4d2d48dd4","ps":[]}
,"low_latency_layer-git":{"sn":"low_latency_layer-git-src","kd":[1,{"ft":0,"ur":"https://github.com/Korthos-Software/low_latency_layer/archive/3138b14ebd059cd540444771dd184fbf7ead2a12.tar.gz","ms":[]}],"ha":{"al":2,"vl":"blake3-eaek3w60syOHOmRNdCDBTQ+MZw4O9fDGbpirlyuUnoQ="},"fv":"3138b14ebd059cd540444771dd184fbf7ead2a12","ps":[]}
,"lsfg-vk-git":{"sn":"lsfg-vk-git-src","kd":[1,{"ft":0,"ur":"https://github.com/PancakeTAS/lsfg-vk/archive/8b0da2661c6f3473a7fccc8ba643880050e71642.tar.gz","ms":[]}],"ha":{"al":2,"vl":"blake3-dABuL3duPZ9m0X6DizXeGCngZdlfcDpDiiuxfeTnlOM="},"fv":"8b0da2661c6f3473a7fccc8ba643880050e71642","ps":[]}