Ollama
Configure Onyx to use Ollama
Refer to Model Configs for how to set the environment variables for your particular deployment.
Note: While we support self hosted LLMs, you will get significantly better responses with a more powerful model like GPT-4.
What is Ollama
Ollama provides an easy way to host LLMs locally and to provide a REST API for the model. Refer to the following resources to get started:
Once you start a model with a command like ollama run llama2
, you can verify that the API works with a curl request:
Set Onyx to use Ollama
On the LLM
page in the Admin Panel add a Custom LLM Provider
with the following settings:
Note: For the API Base, you should point Onyx to wherever Ollama is running. To point to a Docker container running at http://localhost:11434, use host.docker.internal instead of localhost (as shown in the screenshots).
You may also want to update some of the environment variables depending on your model choice / how you’re running Ollama (e.g. on CPU vs GPU):