Ollama
The Ollama integrationIntegrations connect and integrate KS Assistant with your devices, services, and more. [Learn more] adds a conversation agent in KS Assistant powered by a local Ollama
Controlling KS Assistant is an experimental feature that provides the AI access to the Assist API of KS Assistant. You can control what devices and entities it can access from the exposed entities page. The AI is able to provide you information about your devices and control them.
This integration does not integrate with sentence triggers.
This integration requires an external Ollama server, which is available for macOS, Linux, and Windows. Follow the download instructions
Configuration
To add the Ollama service to your KS Assistant instance, use this My button:
Manual configuration steps
If the above My button doesn’t work, you can also perform the following steps manually:
-
Browse to your KS Assistant instance.
-
In the bottom right corner, select the
Add Integration button. -
From the list, select Ollama.
-
Follow the instructions on screen to complete the setup.
Options
Options for Ollama can be set via the user interface, by taking the following steps:
- Browse to your KS Assistant instance.
- Go to Settings > Devices & Services.
- If multiple instances of Ollama are configured, choose the instance you want to configure.
- Select the integration, then select Configure.
Name of the Ollama modelmistral
or llama2:13b
. Models will be automatically downloaded during setup.
Instructions for the AI on how it should respond to your requests. It is written using KS Assistant Templating.
If the model is allowed to interact with KS Assistant. It can only control or provide information about entities that are exposed to it. This feature is considered experimental and see Controlling KS Assistant below for details on model limitations.
The context window size is the number of tokens the model can take as input. KS Assistant defaults to 8k, which is larger than the default value in Ollama Server (2k), and you may adjust it based on the maximum context size of the specific model used. A larger value will better support larger homes with more entities, and smaller values may lower Ollama server RAM usage.
Maximum number of messages to keep for each conversation (0 = no limit). Limiting this value will cause older messages in a conversation to be dropped.
Controlling KS Assistant
If you want to experiment with local LLMs using KS Assistant, we currently recommend using the llama3.1:8b
model and exposing fewer than 25 entities. Note that smaller models are more likely to make mistakes than larger models.
Only models that support Tools
Smaller models may not reliably maintain a conversation
- Add the Ollama integration without enabling control of KS Assistant. You can use this conversation agent to have a conversation.
- Add an additional Ollama integration, using the same model, enabling control of KS Assistant. You can use this conversation agent to control KS Assistant.