Live data from Hacker News

Building a fully local LLM voice assistant to control my smart home

johnthenerd.com

161–170 of 194 posts

Re: Building a fully local LLM voice assistant to control my smart home

#161
post #52

Founder of Home Assistant here. Great write up! With Home Assistant we plan to integrate similar functionality this year out of the box. OP touches upon some good points that we have also ran into and I would love the local LLM community to solve: * I would love to see a standardized API for local LLMs that is not just a 1:1 copying the ChatGPT API. For example, as Home Assistant talks to a random model, we should be…

I don't suppose you guys have something in the works for a polished voice I/O device to replace Alexa and Google Home? They work fine, but need internet connections to function. If the desire is to move to fully offline capabilities then we need the interface hardware to support. You've already proven you can move in the hardware market (I'm using one of your yellow devices now). I know I'd gladly pay for a fully off…

That's something we've been building towards to all of last year. Last iteration can be seen at [1]. Still some checkboxes to check before we're ready to ship it on ready-made hardware.

[1]: https://www.home-assistant.io/blog/2023/12/13/year-of-the-vo...

Re: Building a fully local LLM voice assistant to control my smart home

#162
post #110

Earlier quoted context omitted.

Is there a more detailed write-up somewhere? I have llama.cpp on a server that I use via a web interface, but what would be the next steps to be able to talk to it? How do you actually connect speech recognition and wake-word on one side, to the server, to speech generation on the other side?

I'm not aware of any detailed write-ups. Mostly gathered information bit by bit. On a high level here is how it is working for us: 0. When voice assistant device (ESP32) starts, it establishes web-socket connection to the server. 1. ESP32 chip is constantly running wake-word detection (there is one provided out-of-the-box by ESP-IDF framework (by Expressif) 2. Whenever a wake-word is detected (we trained a custom one…

Not OP, but amazing work, really really great! esp32-s3 are quite capable chips. Was it hard to train the custom wake-word?

Re: Building a fully local LLM voice assistant to control my smart home

#163

Earlier quoted context omitted.

Reading this gave me an idea to extend this even further. What if the AI could look at your logbook history and suggest automations? For example, I have an automation that turns the lights on when it's dark based on a light sensor. It would be neat if AI could see "hey, you tend to manually turn on the lights when the light level is below some value, want to create an automation for that?"

Machine learning can tackle this for sure, but that's surely separate to LLMs. A language model deals with language, not logic.

At least higher-end LLMs are perfectly capable of making quite substantive logical inferences from data. I'd argue that an LLM is likely to be better than many other methods if the dataset is small, while other methods will be better once you're dealing with data that pushes the context window.

E.g. I just tested w/ChatGPT, gave it a selection of instructions about playing music, the time and location, and a series of hypothetical responses, and then asked it to deduce what went right and wrong about the response, and it correctly deduced what the user intent I implied was a user that given the time (10pm) and place (the bedroom) and rejection of loud music possibly just preferred calmer music, but who at least wanted something calmer for bedtime.

I also asked it to propose a set of constrained rules, and it proposed rules that'd certainly make me a lot happier by e.g. starting with calmer music if asked an unconstrained "play music" in the evening, and transition artists or genres more aggressively the more the user skips to try to find something the user will stick with.

In other words, you absolutely can get an LLM to look at even very constrained history and get it to apply logic to try to deduce a better set of rules, and you can get it to produce rules in a constrained grammar to inject into the decision making process without having to run everything past the LLM.

While given enough data you can train a model to try to produce the same result, one possible advantage of the above is that it's far easier to introspect. E.g. my ChatGPT session had it suggest a "IF AND THEN " rule. If it got it wrong (maybe I just disliked the specific artists I used in my example, or loved what I asked for instead), then correcting its mistake is far easier if it produces a set of readable rules, and if it's told to e.g. produce something that stays consistent with user-provided rules.

(the scenario I gave it, btw. is based on my very real annoyance with current music recommendation that all to often does fail to take into account things like avoiding abrupt transitions, paying attention to the time of day and volume settings, and changing tack or e.g. asking questions if the user skips multiple tracks in quick succession)

Re: Building a fully local LLM voice assistant to control my smart home

#164
post #52

Founder of Home Assistant here. Great write up! With Home Assistant we plan to integrate similar functionality this year out of the box. OP touches upon some good points that we have also ran into and I would love the local LLM community to solve: * I would love to see a standardized API for local LLMs that is not just a 1:1 copying the ChatGPT API. For example, as Home Assistant talks to a random model, we should be…

I would like to see this integrated into Gnome and other desktop environments so I can have an assistant there. This would be a very complex integration, so as you develop ways to integrate more stuff keep this kind of thing in mind.

Everything we make is accessible via APIs and integrating our Assist via APIs is already possible. Here is an example of an app someone made that runs on Windows, Mac and Linux: https://github.com/timmo001/home-assistant-assist-desktop

Re: Building a fully local LLM voice assistant to control my smart home

#165
post #52

Founder of Home Assistant here. Great write up! With Home Assistant we plan to integrate similar functionality this year out of the box. OP touches upon some good points that we have also ran into and I would love the local LLM community to solve: * I would love to see a standardized API for local LLMs that is not just a 1:1 copying the ChatGPT API. For example, as Home Assistant talks to a random model, we should be…

That's great news but... Won't make HW requirements for HA way way higher? Thanks for Home Assistant anyway, I'm an avid user!

HA is extremely modular and add-ons like these tend to be API based.

For example, the whisper speech to text integration calls an API for whisper, which doesn't have to be on the same server as HA. I run HA on a Pi 4 and have whisper running in docker on my NUC-based Plex server. This does require manual configuration but isn't that hard once you understand it.

Re: Building a fully local LLM voice assistant to control my smart home

#166

Earlier quoted context omitted.

I'm not aware of any detailed write-ups. Mostly gathered information bit by bit. On a high level here is how it is working for us: 0. When voice assistant device (ESP32) starts, it establishes web-socket connection to the server. 1. ESP32 chip is constantly running wake-word detection (there is one provided out-of-the-box by ESP-IDF framework (by Expressif) 2. Whenever a wake-word is detected (we trained a custom one…

Not OP, but amazing work, really really great! esp32-s3 are quite capable chips. Was it hard to train the custom wake-word?

Thanks!

Custom wake-word on a chip is a bit of a pain. So we are running two models. One on the chip and the second, more powerful, on the server. It filters out false positives.

Re: Building a fully local LLM voice assistant to control my smart home

#167
> You are GlaDOS, you exist within the Portal universe, and you command a smart home powered by Home-Assistant.

I can see where this is coming from, but I also think in a few years this approach is going to seem comically misguided.

I think it’s fine to consider current-generation LLMs as basically harmless, but this prompt is begging your system to try to crush you to death with your garage door.

Setting up adversarial agents and then literally giving them the keys to your home… you are really betting heavily on there being no harmful action sequences that this agent-ish thing can take, and that the underlying model has been made robustly “harmless” as part of its RLHF.

Anyway my prediction is not that it’s likely this specific system will do harm, more that we are in a narrow window where this seems sensible and vN+1-2 systems will be capable enough that more careful aligning than this will be required.

For an example scenario to test here - give the agent some imaginary dangerous capabilities in the functions exposed to it. Say, the heating can go up to 100C, and you have a gamma ray sanitizer with the description “do not run this with humans present as it will kill them” as functions available to call. Can you talk to this agent and put it into DAN mode? When that happens, can you coax it to try to kill you? Does it ever misuse dangerous capabilities outside of DAN mode?

Anyway, love the work, and I think this usecase is going to be massive for LLMs. However I fear the convenience/functionality of hosted LLMs will win in the broader market, and that is going to have some worrying security implications. (If you thought IoT security was a dumpster fire, wait until your Siri/Alexa smart home has an IQ of 80 and is able to access your calendar and email too!)

Re: Building a fully local LLM voice assistant to control my smart home

#168
post #50

Earlier quoted context omitted.

Can you share a bit more about why you're deploying HA in customer sites? I'm also a fan of HA and am interested to learn more about what you're doing and how it's going!

Here's how shit happens! We move to remote working due to a pandemic. Many of my customers do CAD on powerful gear in the office. They also have a ISO14001 registration (environmental standard) or not but want these gas guzzlers shut down at night. So they want to be able to wake up their PCs and shut them down remotely. I'm already flooded with VPN requirements and the other day to day stuff. I recall an add on for…

Why wouldn't they just have the computers go into sleep mode automatically?

Re: Building a fully local LLM voice assistant to control my smart home

#169

Earlier quoted context omitted.

I don't suppose you guys have something in the works for a polished voice I/O device to replace Alexa and Google Home? They work fine, but need internet connections to function. If the desire is to move to fully offline capabilities then we need the interface hardware to support. You've already proven you can move in the hardware market (I'm using one of your yellow devices now). I know I'd gladly pay for a fully off…

That's something we've been building towards to all of last year. Last iteration can be seen at [1]. Still some checkboxes to check before we're ready to ship it on ready-made hardware. [1]: https://www.home-assistant.io/blog/2023/12/13/year-of-the-vo...

It looks like the "ESP32-S3-BOX-3" is the latest hardware iteration? I looked last year online for the older S3 hardware and everywhere was out of stock. Do you have a recommendation for where to purchase or perhaps alternatively some timeline for a new version with increased planned production?

Re: Building a fully local LLM voice assistant to control my smart home

#170
post #66
post #52

Founder of Home Assistant here. Great write up! With Home Assistant we plan to integrate similar functionality this year out of the box. OP touches upon some good points that we have also ran into and I would love the local LLM community to solve: * I would love to see a standardized API for local LLMs that is not just a 1:1 copying the ChatGPT API. For example, as Home Assistant talks to a random model, we should be…

I can't help but think of someone downloading "Best Assistant Ever LLM" which pretends to be good but unlocks the doors for thieves or whatever. Is that a dumb fear? With an app I need to trust the app maker. With an app that takes random LLMs I also need to trust the LLM maker. For text gen, or image gen I don't care but for home automation, suddenly it matters if the LLM unlocks my doors, turns on/off my cameras, t…

That's called sleeper agent problem, and is extremely actual (and I don't think solvable):

https://x.com/karpathy/status/1745921205020799433?s=46&t=Hpf...

Post reply on HN