acon96 / home-llm

A Home Assistant integration & Model to control your smart home using a Local LLM
490 stars 56 forks source link

version 0.2.12 says "homeassistant" with every response #110

Closed cryptk closed 2 months ago

cryptk commented 2 months ago

Describe the bug
With the new version of the integration, it appears that the integration is including the beginning of the service call portion by default. This is with a brand new configuration of the integration, and I noticed that the service call regex is a bit different now.

Here is the text that is returned from the integration for a request to turn off a light:

deactivating Office Ceiling Fan Light as requested ```homeassistant ```

It appears that the new service call regex is not matching the word homeassistant or the backticks. The service call regex is set to ({[\S \t]*?}), which is the value that was set by default on a brand-new added configuration.

Expected behavior
Only the intended textual response should be sent to text-to-speech

Logs
If applicable, please upload any error or debug logs output by Home Assistant.

Paste logs here
cryptk commented 2 months ago

It looks like this is because within my LocalAI install, I had the model named home, so the integration defaulted to a more generic set of settings. From looking through the code, I renamed my model to home-3b-v3 and added a new configuration and things seem to be working better.

This should be documented somewhere that the integration is opinionated on how you name your model configurations, I could foresee many people, who don't realize that it matters, naming their model configurations things like home or homeassistant, and then not getting the configuration that is best suited for the underlying gguf they are using.

acon96 commented 2 months ago

This should be documented somewhere that the integration is opinionated on how you name your model configurations, I could foresee many people, who don't realize that it matters, naming their model configurations things like home or homeassistant, and then not getting the configuration that is best suited for the underlying gguf they are using.

Yeah I can make this much clearer during the setup flow. The idea is to make it as easy as possible for newer users to pick a model and get correct settings applied automatically.

cryptk commented 2 months ago

Once I looked at the code and realized what was going on, it was easy to fix, just rename the model and then I get all of the fine-tuned defaults automatically, which was nice.

Maybe some kind of a "getting started checklist" which can be linked to from the initial configuration dialog that can point out this functionality to let people know that if they are using one of your fine-tuned models to make sure to name the model config in their AI system to match so that they get the proper defaults.

acon96 commented 2 months ago

I've gone ahead and added clearer messaging during the setup flow that calls out that defaults are being selected for you based on the filename or model name you select.