feat(hass): switch to ollama with mistral-nemo
All checks were successful
Discord / discord commits (push) Has been skipped

This commit is contained in:
matt1432 2024-09-11 13:07:51 -04:00
parent 20cd2a0611
commit 3207e56df2
10 changed files with 74 additions and 6 deletions

View file

@ -1,5 +1,4 @@
{
pkgs,
self,
wakewords-src,
...
@ -18,7 +17,8 @@
];
customComponents = builtins.attrValues {
inherit (self.legacyPackages.${pkgs.system}.hass-components) home-llm;
# Switched to HASS Ollama integration
# inherit (self.legacyPackages.${pkgs.system}.hass-components) home-llm;
# Home-llm prompt:
/*
You are 'Homie', a helpful AI Assistant that controls the devices in a house. Complete the following task as instructed.

View file

@ -4,7 +4,6 @@
pkgs,
...
}: {
# Setup Bluetooth
hardware.bluetooth = {
enable = true;
@ -78,6 +77,11 @@
# Setup MPD
services.home-assistant.extraComponents = [
"mpd"
# BT components
"ibeacon"
"led_ble"
"kegtron"
];
services.mpd = {
enable = true;

View file

@ -14,7 +14,6 @@
"caldav"
"holiday"
"isal"
"led_ble"
"met"
"spotify"
"upnp"

View file

@ -26,7 +26,7 @@ in {
host = tailscaleIP;
port = 11434;
loadModels = ["fixt/home-3b-v3"];
loadModels = ["mistral-nemo"];
environmentVariables.OLLAMA_DEBUG = "1";
};
};

View file

@ -233,6 +233,22 @@
"type": "github"
}
},
"extended-openai-conversation-src": {
"flake": false,
"locked": {
"lastModified": 1708531177,
"narHash": "sha256-BwBroYcPQX3pv4iFR1ynmC5xQRTVAFAsOGfDGyXkES4=",
"owner": "jekalmin",
"repo": "extended_openai_conversation",
"rev": "1b20b56e81e5e5067b72a2ba2c8f51dd0a73eef1",
"type": "github"
},
"original": {
"owner": "jekalmin",
"repo": "extended_openai_conversation",
"type": "github"
}
},
"firefox-gx-src": {
"flake": false,
"locked": {
@ -1677,6 +1693,7 @@
"dracul-ha-src": "dracul-ha-src",
"dracula-plymouth-src": "dracula-plymouth-src",
"eisa-scripts-src": "eisa-scripts-src",
"extended-openai-conversation-src": "extended-openai-conversation-src",
"firefox-gx-src": "firefox-gx-src",
"flake-utils": "flake-utils",
"flakegen": "flakegen",

View file

@ -58,6 +58,12 @@
repo = "mpv-scripts";
type = "github";
};
extended-openai-conversation-src = {
flake = false;
owner = "jekalmin";
repo = "extended_openai_conversation";
type = "github";
};
firefox-gx-src = {
flake = false;
owner = "Godiesc";

View file

@ -181,6 +181,12 @@ let
owner = "acon96";
repo = "home-llm";
}
{
name = "extended-openai-conversation-src";
owner = "jekalmin";
repo = "extended_openai_conversation";
}
{
name = "wakewords-src";
owner = "fwartner";

View file

@ -4,4 +4,5 @@ pkgs.lib.makeScope pkgs.newScope (hass: let
hass.callPackage file (inputs // {});
in {
home-llm = buildHassComponent ./home-llm.nix;
extended-openai-conversation = buildHassComponent ./extended-openai-conversation.nix;
})

View file

@ -0,0 +1,33 @@
{
extended-openai-conversation-src,
buildHomeAssistantComponent,
fetchFromGitHub,
python312Packages,
...
}: let
inherit (builtins) fromJSON readFile;
manifest = fromJSON (readFile "${extended-openai-conversation-src}/custom_components/extended_openai_conversation/manifest.json");
openai = python312Packages.openai.overrideAttrs (o: rec {
version = "1.3.8";
src = fetchFromGitHub {
owner = "openai";
repo = "openai-python";
rev = "refs/tags/v${version}";
hash = "sha256-yU0XWEDYl/oBPpYNFg256H0Hn5AaJiP0vOQhbRLnAxQ=";
};
disabledTests = o.disabledTests ++ ["test_retrying_timeout_errors_doesnt_leak" "test_retrying_status_errors_doesnt_leak"];
});
in
buildHomeAssistantComponent {
owner = "jekalmin";
inherit (manifest) domain version;
src = extended-openai-conversation-src;
propagatedBuildInputs = [openai];
}

View file

@ -4,7 +4,9 @@
python3Packages,
...
}: let
manifest = builtins.fromJSON (builtins.readFile "${home-llm-src}/custom_components/llama_conversation/manifest.json");
inherit (builtins) fromJSON readFile;
manifest = fromJSON (readFile "${home-llm-src}/custom_components/llama_conversation/manifest.json");
in
buildHomeAssistantComponent {
owner = "acon96";