feat(self/ollama): Mistral 7b setup with ollama
This commit is contained in:
parent
8634895181
commit
210816195b
5 changed files with 41 additions and 1 deletions
|
|
@ -50,7 +50,7 @@
|
||||||
nixpkgs.config.allowUnfree = true;
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
|
||||||
nix.settings = {
|
nix.settings = {
|
||||||
download-buffer-size = 16777216;
|
download-buffer-size = 1048576;
|
||||||
experimental-features = [
|
experimental-features = [
|
||||||
"nix-command"
|
"nix-command"
|
||||||
"flakes"
|
"flakes"
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@
|
||||||
service = {
|
service = {
|
||||||
selfhost = {
|
selfhost = {
|
||||||
htop = true;
|
htop = true;
|
||||||
|
ollama = true;
|
||||||
monitor = true;
|
monitor = true;
|
||||||
nextcloud = true;
|
nextcloud = true;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,9 @@ let
|
||||||
monitor = import ./self_host/monitor.nix {
|
monitor = import ./self_host/monitor.nix {
|
||||||
inherit inputs config pkgs lib;
|
inherit inputs config pkgs lib;
|
||||||
};
|
};
|
||||||
|
ollama = import ./self_host/ollama.nix {
|
||||||
|
inherit inputs config pkgs lib;
|
||||||
|
};
|
||||||
nextcloud = import ./self_host/nextcloud.nix {
|
nextcloud = import ./self_host/nextcloud.nix {
|
||||||
inherit inputs config pkgs lib;
|
inherit inputs config pkgs lib;
|
||||||
};
|
};
|
||||||
|
|
@ -16,6 +19,7 @@ in
|
||||||
imports = [
|
imports = [
|
||||||
nextcloud
|
nextcloud
|
||||||
htop
|
htop
|
||||||
|
ollama
|
||||||
monitor
|
monitor
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
@ -30,6 +34,11 @@ in
|
||||||
default = false;
|
default = false;
|
||||||
description = "Enable the htop";
|
description = "Enable the htop";
|
||||||
};
|
};
|
||||||
|
ollama = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "Enable the ollama";
|
||||||
|
};
|
||||||
monitor = lib.mkOption {
|
monitor = lib.mkOption {
|
||||||
type = lib.types.bool;
|
type = lib.types.bool;
|
||||||
default = false;
|
default = false;
|
||||||
|
|
|
||||||
|
|
@ -95,6 +95,7 @@ in
|
||||||
"https://nextcloud.enium.eu"
|
"https://nextcloud.enium.eu"
|
||||||
"https://htop.enium.eu"
|
"https://htop.enium.eu"
|
||||||
"https://monitor.enium.eu"
|
"https://monitor.enium.eu"
|
||||||
|
"https://ollama.enium.eu"
|
||||||
"http://relance-pas-stp.me:4242"
|
"http://relance-pas-stp.me:4242"
|
||||||
];
|
];
|
||||||
}];
|
}];
|
||||||
|
|
|
||||||
29
services/self_host/ollama.nix
Normal file
29
services/self_host/ollama.nix
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.service.selfhost.ollama;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
services = {
|
||||||
|
ollama = {
|
||||||
|
enable = true;
|
||||||
|
loadModels = [
|
||||||
|
"mistral:7b"
|
||||||
|
];
|
||||||
|
acceleration = "cuda";
|
||||||
|
};
|
||||||
|
|
||||||
|
open-webui = {
|
||||||
|
enable = true;
|
||||||
|
port = 13007;
|
||||||
|
};
|
||||||
|
nginx.virtualHosts."ollama.enium.eu" = {
|
||||||
|
enableACME = true;
|
||||||
|
forceSSL = true;
|
||||||
|
locations."/" = {
|
||||||
|
proxyPass = "http://127.0.0.1:13007";
|
||||||
|
proxyWebsockets = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue