feat(hass): use LLM as voice assistant
All checks were successful
Discord / discord commits (push) Has been skipped
All checks were successful
Discord / discord commits (push) Has been skipped
This commit is contained in:
parent
fe75a68081
commit
761e0487ee
9 changed files with 57 additions and 0 deletions
|
@ -1,4 +1,5 @@
|
|||
{
|
||||
pkgs,
|
||||
self,
|
||||
wakewords-src,
|
||||
...
|
||||
|
@ -13,12 +14,17 @@
|
|||
"esphome"
|
||||
"holiday"
|
||||
"met"
|
||||
"ollama"
|
||||
"spotify"
|
||||
"upnp"
|
||||
"wyoming"
|
||||
"yamaha_musiccast"
|
||||
];
|
||||
|
||||
customComponents = builtins.attrValues {
|
||||
inherit (self.legacyPackages.${pkgs.system}.hass-addons) home-llm;
|
||||
};
|
||||
|
||||
config = {
|
||||
http = {
|
||||
server_host = "0.0.0.0";
|
||||
|
|
|
@ -14,6 +14,7 @@ in {
|
|||
./modules/docker
|
||||
./modules/jellyfin
|
||||
./modules/mergerfs.nix
|
||||
./modules/ollama.nix
|
||||
./modules/qbittorrent
|
||||
./modules/snapraid.nix
|
||||
./modules/subtitles
|
||||
|
|
11
devices/nos/modules/ollama.nix
Normal file
11
devices/nos/modules/ollama.nix
Normal file
|
@ -0,0 +1,11 @@
|
|||
{...}: {
|
||||
services.ollama = {
|
||||
enable = true;
|
||||
acceleration = "cuda";
|
||||
|
||||
host = "100.64.0.4";
|
||||
port = 11434;
|
||||
|
||||
loadModels = ["fixt/home-3b-v3"];
|
||||
};
|
||||
}
|
BIN
flake.lock
BIN
flake.lock
Binary file not shown.
BIN
flake.nix
BIN
flake.nix
Binary file not shown.
|
@ -177,6 +177,10 @@ let
|
|||
|
||||
srcs = [
|
||||
# Home-assistant
|
||||
{
|
||||
owner = "acon96";
|
||||
repo = "home-llm";
|
||||
}
|
||||
{
|
||||
name = "wakewords-src";
|
||||
owner = "fwartner";
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
(pkgs.callPackage file ({inherit mkVersion;} // inputs));
|
||||
in {
|
||||
dracula = mkScope ./dracula;
|
||||
hass-addons = mkScope ./hass-addons;
|
||||
firefoxAddons = mkScope ./firefox-addons;
|
||||
mpvScripts = mkScope ./mpv-scripts;
|
||||
}
|
||||
|
|
7
legacyPackages/hass-addons/default.nix
Normal file
7
legacyPackages/hass-addons/default.nix
Normal file
|
@ -0,0 +1,7 @@
|
|||
{pkgs, ...} @ inputs:
|
||||
pkgs.lib.makeScope pkgs.newScope (hass: let
|
||||
buildHassAddon = file:
|
||||
hass.callPackage file (inputs // {});
|
||||
in {
|
||||
home-llm = buildHassAddon ./home-llm.nix;
|
||||
})
|
27
legacyPackages/hass-addons/home-llm.nix
Normal file
27
legacyPackages/hass-addons/home-llm.nix
Normal file
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
buildHomeAssistantComponent,
|
||||
home-llm-src,
|
||||
python3Packages,
|
||||
...
|
||||
}: let
|
||||
manifest = builtins.fromJSON (builtins.readFile "${home-llm-src}/custom_components/llama_conversation/manifest.json");
|
||||
in
|
||||
buildHomeAssistantComponent {
|
||||
owner = "acon96";
|
||||
|
||||
inherit (manifest) domain version;
|
||||
|
||||
src = home-llm-src;
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace ./custom_components/llama_conversation/manifest.json \
|
||||
--replace-warn "huggingface-hub==0.23.0" "huggingface-hub>=0.23.0" \
|
||||
--replace-warn "webcolors<=1.13" "webcolors>=1.13"
|
||||
'';
|
||||
|
||||
propagatedBuildInputs = with python3Packages; [
|
||||
huggingface-hub
|
||||
requests
|
||||
webcolors
|
||||
];
|
||||
}
|
Loading…
Reference in a new issue