Live data from Hacker News

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

johnthenerd.com

181–190 of 194 posts

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

#181
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 am curious if there will be a possibility to run an LLM locally on the rpi, as my current set up is on rpi.

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

#182
post #132

Earlier quoted context omitted.

> no matter how careful your prompt engineering is, you simply can’t use tiny models to do big complicated tasks. I can and do! The progress in ≈7B models has been nothing short of astonishing. > My experience with this stuff has been mixed That's a more accurate way to describe it. I haven't figured out a way to use ≈7B models for many specific tasks. I've followed a rapidly growing number of domains where people ha…

Which domains?

Mostly ones related to text transformation (e.g. changing text style) and feedback (e.g. giving suggestions for how to improve text). A year ago, the ones I tried were useless and dumb. Right now, they work quite well.

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

#183
post #132

Earlier quoted context omitted.

> no matter how careful your prompt engineering is, you simply can’t use tiny models to do big complicated tasks. I can and do! The progress in ≈7B models has been nothing short of astonishing. > My experience with this stuff has been mixed That's a more accurate way to describe it. I haven't figured out a way to use ≈7B models for many specific tasks. I've followed a rapidly growing number of domains where people ha…

> I can and do! I’m openly skeptical. Most examples I’ve seen of this have been frankly rubbish, which has matched my experience closely. The larger models, like 70B are capable of generating reasonably good structured outputs and some of the smaller ones like codellama are also quite good. The 7b models are unreliable. Some trivial tasks (eg. Chatbot) can be done, but most complex tasks (eg. Generating code) require…

> Proof: if it was false, you could do what GPT4 does with 10 param model and a good prompt.

This is oh so very much a strawman. There is rapid progress in AI. For my domains, the first useful model (without finetuning or additional training) was GPT3, which was released in 2020, and had 175B parameters.

We've had three years of optimization on the models, as well as a lot of progress on how to use them. That means we need fewer parameters today than we did in 2020. That doesn't imply there isn't a hard lower bound somewhere. We just don't know where or what it is.

My expectation is we'll continue to do better and better until, where e.g. a 2030 1B parameter model will be competitive with a 2020 200B parameter model, and a 2030 200B parameter model will be much better than either. After some amount of progress, we'll hit it (or more accurately, asymptotically converge to it).

I don't use local LLMs for coding, but for things related to text (it is a large LANGUAGE model, after all). For that, 7B parameter models became adequate sometime in 2023. For reference, in 2020, they were complete nonsense. You'd get cycles of repeating text, or just lose coherence after a sentence or two.

With my setup, local models aren't anywhere close to fast enough for real-time use. For coding, I need real-time use. It wouldn't surprise me if that domain needed more parameters, just based on what I've seen, but I could be proven wrong. If you buy me an H100, I can experiment with it too. As a footnote, many LARGE models work horribly for coding too; OpenAI did a very good job with GPT there (and I haven't used it enough to know, but I've heard Google did too from people who've used Bard).

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

#184
post #42
post #39

Earlier quoted context omitted.

I love how burning your house down is something that deserves air quotes according to you. All I can tell you is this: LLM’s frequently misinterpret, hallucinate and “lie”. Good luck.

Preventing burning your house down belongs on the output handling side, not the instruction processing side. If there is any output from an LLM at all that will burn your house down, you already messed up.

I'd go as far as saying it should be handled on the "physics" level. Any electric apparatus in your home should be able to be left on for weeks without causing fatal consequences.

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

#185

Earlier quoted context omitted.

I do it, but I'm completely insane: - I actually stay on top of all patches, including HomeAssistant itself - I run it behind a WAF and IPS. lots of VLANs around. even if you breach a service, you'll probably trip something up in the horrific maze I created - I use 2-factor authentication, even for the limited accounts - Those limited accounts? I use undocumented HomeAssistant APIs to lock them down to specific entit…

> - Those limited accounts? I use undocumented HomeAssistant APIs to lock them down to specific entities Mind sharing your process to achieve what sounds like successful implementation of the much-requested ACL/RBAC support?

"successful" is a very optimistic way of looking at it. it has several downsides but largely works for my needs:

- read access is mostly available for sensors, even if access wasn't granted.

- some integrations (especially custom integrations) don't care about authorization. my fork mentioned in the blog does, because I explicitly added logic to authorize requests. the HomeAssistant authorization documentation is outdated and no longer works. I looked through the codebase to find extensions that implement it for an example. maybe I should submit a PR that fixes the doc...

- each entity needs to be explicitly allowed. this results in a massive JSON file.

- it needs a custom group added to the .storage/auth file. this is very much not officially supported. however, it has survived every update I have received so far (and I always update HomeAssistant)

I will share what I did in detail when I get some time on my hands

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

#186

Earlier quoted context omitted.

> - Those limited accounts? I use undocumented HomeAssistant APIs to lock them down to specific entities Mind sharing your process to achieve what sounds like successful implementation of the much-requested ACL/RBAC support?

"successful" is a very optimistic way of looking at it. it has several downsides but largely works for my needs: - read access is mostly available for sensors, even if access wasn't granted. - some integrations (especially custom integrations) don't care about authorization. my fork mentioned in the blog does, because I explicitly added logic to authorize requests. the HomeAssistant authorization documentation is out…

Much appreciated. Sounds as if you're way out of spec. Still; should be interesting to go through your methods.

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

#187

> 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 adversar…

I think you have a valid point, but the risk of this feels exaggerated.

I already had a few entities I didn't really need it using (not for security reasons, but to shorten the system prompt). I simply excluded them within the Jinja template itself. I can see this being a problem with people who have their ovens or thermostats on HA, but I don't necessarily think it's an unsolvable issue if we implement sensible sanity checks on the output.

hilariously, the model I'm using doesn't even have any RLHF. but I am also not very concerned if GlaDOS decides to turn on the coffee machine. maybe I would be slightly more concerned if I had a smart lock, but I think primitive methods such as "throw big rock at window" would be far easier for a bad person.

when it comes to jailbreak prompts, you need to be able to call the assistant in the first place. if you are authorized to call the HomeAssistant API, why would you bother with the LLM? just call the respective API directly and do whatever evil thing you had in mind. I took an unreasonable number of measures to try to stop this from happening, but I admit that's a risk. however, I don't think that's a risk caused by the LLM, but rather the existence of IoT devices.

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

#188
post #84

Earlier quoted context omitted.

> > Building a fully local LLM voice assistant > I did the same thing, but I went the easy way and used OpenAI's API. This is a cool project, but it's not really the same thing. The #1 requirement that OP had was to not talk to any cloud services ("no exceptions"), and that's the primary reason why I clicked on this thread. I'd love to replace my Google Home, but not if OpenAI just gets to hoover up the data instead.

I might get downvoted for this but OpenAI's API pretty clearly says that the data isn't used in training

I'd imagine their ToS which they can update whenever they want links to a privacy policy which they can update whenever they want, which is where this restriction is actually codified. The ToS probably also has another part saying they'll use your data "for business reasons including [innocuous use-cases]", and yet another part elsewhere which defines "business reasons" as "whatever we want including selling it".

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

#189
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…

```Creating a prompt to write JSON is possible but need quite an elaborate prompt and even then the LLM can make errors.```

I'll come back after I get my training dataset finished.

I really want to standardize a 7b model that you prompt with HTML with details and get pure Json responses.

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

#190
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…

> Founder of Home Assistant here

I cannot pass this opportunity to thank you very, very much for HA. It is a wonderful product that evolved from "cross your nerd fingers and hope for the best" to "my family uses it".

The community around the forum is very good too (with some actors being fantastic) and the documentation is not too bad either :) (I contributed to some changes and am planning to write a "so you want to start with HA" kind of page to summarize what new users will be faced with).

Again THANK YOU - this literally chnages some people's lives.

Post reply on HN