Allen Porter e0989d65e6
Add instructions for using ollama experimental home control (#34465)
* Add instructions for using ollama experimental home control

* Update source/_integrations/ollama.markdown

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Update source/_integrations/ollama.markdown

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com>
2024-08-28 14:26:45 +02:00

3.7 KiB

title, description, ha_category, ha_release, ha_iot_class, ha_config_flow, ha_codeowners, ha_domain, ha_integration_type, related, ha_platforms
title description ha_category ha_release ha_iot_class ha_config_flow ha_codeowners ha_domain ha_integration_type related ha_platforms
Ollama Instructions on how to integrate Ollama
Voice
2024.4 Local Polling true
@synesthesiam
ollama service
docs title
/docs/configuration/templating/ Home Assistant Templating
docs title
/voice_control/voice_remote_expose_devices/ Exposing entities to Assist
docs title
/docs/automation/trigger/#sentence-trigger Sentence trigger
conversation

The Ollama {% term integration %} adds a conversation agent in Home Assistant powered by a local Ollama server.

Controlling Home Assistant is an experimental feature that provides the AI access to the Assist API of Home Assistant. You can control what devices and entities it can access from the {% my voice_assistants title="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 to install the server. Once installed, configure Ollama to be accessible over the network.

{% include integrations/config_flow.md %}

{% include integrations/option_flow.md %} {% configuration_basic %} URL: description: The URL of the external Ollama server, such as http://localhost:11434.

Model: description: Name of the Ollama model to use, such as mistral or llama2:13b. Models will be automatically downloaded during setup.

Instructions: description: Instructions for the AI on how it should respond to your requests. It is written using Home Assistant Templating.

Control Home Assistant: description: If the model is allowed to interact with Home Assistant. It can only control or provide information about entities that are exposed to it. This feature is considered experimental and see Controlling Home Assistant below for details on model limitations.

Max history messages: description: 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.

Keep alive: description: Duration in seconds for the Ollama host to keep the model in memory after receiving a message (-1 = no limit, 0 = no retention). Default value is -1.

{% endconfiguration_basic %}

Controlling Home Assistant

If you want to experiment with local LLMs using Home 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 may control Home Assistant.

Smaller models may not reliably maintain a conversation when controlling Home Assistant is enabled. However, you may use multiple Ollama configurations that share the same model, but use different prompts:

  • Add the Ollama integration without enabling control of Home Assistant. You can use this conversation agent to have a conversation.
  • Add an additional Ollama integration, using the same model, enabling control of Home Assistant. You can use this conversation agent to control Home Assistant.