I did the same thing, but I went the easy way and used OpenAI's API. Half way through, I got fed up with all the boilerplate, so I wrote a really simple (but very Pythonic) wrapper around function calling with Python functions: https://github.com/skorokithakis/ez-openai Then my assistant is just a bunch of Python functions and a prompt. Very very simple. I used an ESP32-Box with the excellent Willow project for the l…
> > 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.
Building a fully local LLM voice assistant to control my smart home
11–20 of 194 posts
Re: Building a fully local LLM voice assistant to control my smart home
#12Earlier quoted context omitted.
I assume the issue is about privacy in your case. I am not using Alexa, Siri, etc.
that is correct! I would much rather run everything in-house, where I know the quality won't be degraded over time (see the Google Assistant announcement from yesterday) and I am in full control of my data. using a cloud service is much easier and cheaper, but I was not comfortable with that trade-off.
Re: Building a fully local LLM voice assistant to control my smart home
#13Example: I give the LLM a range of 'verbal' instructions related to home automation to see how well they can identify the action, timing, and subject:
User: in the sentence "in 15 minutes turn off the living room light" output the subject, action, time, and location as json
Llama: { "subject": "light", "action": "turned off", "time": "15 minutes from now", "location": "living room" }
Several of the latest models are on par to the results from Gpt4 in my tests.
Re: Building a fully local LLM voice assistant to control my smart home
#14Two naive questions. First, with the 4060 Ti, are those the 16gb models? (I'm idly comparing pricing in Australia, as I've started toying with LM-Studio and lack of VRAM is, as you say, awful.)
Semi-related, the actual quantisation choice you made wasn't specified. I'm guessing 4 or 5 bit? - at which point my question is around what ones you experimented with, after setting up your prompts / json handling, and whether you found much difference in accuracy between them? (I've been using mistral7b at q5, but running from RAM requires some patience.)
I'd expect a lower quantisation to still be pretty accurate for this use case, with a promise of much faster response times, given you are VRAM-constrained, yeah?
Re: Building a fully local LLM voice assistant to control my smart home
#15Re: Building a fully local LLM voice assistant to control my smart home
#16Re: Building a fully local LLM voice assistant to control my smart home
#17Really great write-up, thank you John. Two naive questions. First, with the 4060 Ti, are those the 16gb models? (I'm idly comparing pricing in Australia, as I've started toying with LM-Studio and lack of VRAM is, as you say, awful.) Semi-related, the actual quantisation choice you made wasn't specified. I'm guessing 4 or 5 bit? - at which point my question is around what ones you experimented with, after setting up y…
I use 4-bit GPTQ quants. I use tensor parallelism (vLLM supports it natively) to split the model across two GPUs, leaving me with exactly zero free VRAM. there are many reasons behind this decision (some of which are explained in the blog):
- TheBloke's GPTQ quants only support 4-bit and 3-bit. since the quality difference between 3-bit and 4-bit tends to be large, I went with 4-bit. I did not test, but I wanted high accuracy for non-assistant tasks too, so I simply went with 4-bit.
- vLLM only supports GPTQ, AWQ, and SqueezeLM for quantization. vLLM was needed to serve multiple clients at a time and it's very fast (I want to use the same engine for multiple tasks, this smart assistant is only one use case). I get about 17 tokens/second, which isn't great, but very functional for my needs.
- I chose GPTQ over AWQ for reasons I discussed in the post, and don't know anything about SqueezeLM.
Re: Building a fully local LLM voice assistant to control my smart home
#18Really great write-up, thank you John. Two naive questions. First, with the 4060 Ti, are those the 16gb models? (I'm idly comparing pricing in Australia, as I've started toying with LM-Studio and lack of VRAM is, as you say, awful.) Semi-related, the actual quantisation choice you made wasn't specified. I'm guessing 4 or 5 bit? - at which point my question is around what ones you experimented with, after setting up y…
Re: Building a fully local LLM voice assistant to control my smart home
#19Re: Building a fully local LLM voice assistant to control my smart home
#20I did the same thing, but I went the easy way and used OpenAI's API. Half way through, I got fed up with all the boilerplate, so I wrote a really simple (but very Pythonic) wrapper around function calling with Python functions: https://github.com/skorokithakis/ez-openai Then my assistant is just a bunch of Python functions and a prompt. Very very simple. I used an ESP32-Box with the excellent Willow project for the l…