> For the complete documentation index, see [llms.txt](https://docs.aichatone.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.aichatone.com/product-guides/custom-chatbots/local-llm-models/ollama.md).

# Ollama

[Ollama](https://github.com/ollama/ollama) allows you to run open-source large language models, such as Llama 2, LLaVA, Mistral, Orca etc locally.

## Preparation[​](https://doc.chathub.gg/custom-chatbots/openai#preparation) <a href="#preparation" id="preparation"></a>

Install Ollama and download models.

## Configuration <a href="#configuration" id="configuration"></a>

<figure><img src="/files/jJpAYbldS7hgUSApSzbt" alt=""><figcaption></figcaption></figure>

We're using the `gemma:2b` model in this example.

API Key is required but ignored, so you can input any string.

## Set up environment variables for CORS

Run the following commands so that Ollama allows connection from AIChatOne

```
launchctl setenv OLLAMA_HOST "0.0.0.0"
launchctl setenv OLLAMA_ORIGINS "*"
```

After that, you need to restart Ollama for the changes to take effect.

{% hint style="info" %}
For more details: <https://medium.com/dcoderai/how-to-handle-cors-settings-in-ollama-a-comprehensive-guide-ee2a5a1beef0>
{% endhint %}
