-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update default prompt and remove all unnecessary new lines between entities #223
base: develop
Are you sure you want to change the base?
Conversation
I actually think a prompt might be improved even more by formatting it better and adding instructions for LLMs about how to actually use everything and how to output. Current prompt heavily assumes that a native homellm model is used, which was already trained on their own dataset which, I assume, includes examples of how it should behave. However existing 3B models are not smart or flexible enough, in my experience anyway. They make mistakes, they may not understand context, and they are kinda dumb outside of controlling home. However any modern 7B+ model should handle controlling Hass home without any extra fine tuning, just with a bit of extra prompting. Context window of 8K which is supported by all modern LLMs is more than sufficient to include the prompt I have below. And if you have a lot of devices you might want to use an LLM with larger context, which, also, most modern LLMs support now. Here's an example of a prompt I use. As it is it uses up around 3500 tokens once processed by jinja, meaning - including my devices, weather, news, and other info. It is possible to trim this prompt down by, for example, removing news section, and removing intents you dont use from documentation section. It is also possible to significantly trim down the size of the docs by rewording it, ChatGPT or Claude might help with that, to compress it. This might help reduce the size of the prompt and speed up generation.
|
Thanks to this solution, all entities do not contain unnecessary empty new lines. This is the current behavior:
and now it looks like this: