> For the complete documentation index, see [llms.txt](https://docs.mindmac.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mindmac.app/how-to.../add-ollama-endpoint.md).

# Add Ollama endpoint

## Prerequisite

* Ollama version: 0.1.19 or later
* Running at least one model under Ollama

## Add endpoint

Go to **MindMac** -> **Settings...** -> **Account** or press <mark style="color:purple;">**⌘**</mark> + <mark style="color:purple;">**,**</mark> to open Account Setting.

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

* Select **Ollama** as provider
* Enter a name
* If you don't change any Ollama configuration, just use <http://localhost:11434/api/chat> as URL
* Enter a random text in API Key text area
* Click **Save** to finish

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

***

## Customize Context Length (Optional)

Currently Ollama does not provide exact context length for each model, so if you want to control **max tokens** (or context length) parameter,  you might need to enter that value manually for every Ollama model. Follow below steps to do so.

Go to **MindMac** -> **Settings...** -> **Account** or press <mark style="color:purple;">**⌘**</mark> + <mark style="color:purple;">**,**</mark> to open Account Setting.

Click on the brain icon to show Ollama model list.

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

Click on the edit button.

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

Enter max tokens value for that model and click **Save** to finish.

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

To get max tokens value for each model, you can find in configuration file (**config.json** for example) of that model on Hugging Face. For instance, with the model [Mixtral-8x7B-Instruct-v0.1](https://huggingface.co/mistralai/Mixtral-8x7B-Instruct-v0.1) , you can go to <https://huggingface.co/mistralai/Mixtral-8x7B-Instruct-v0.1/blob/main/config.json> and grab the value **max\_position\_embeddings** as its context length. Kindly be aware that there is no standard specifying which key determines the context length of a model in the model configuration file.

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


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.mindmac.app/how-to.../add-ollama-endpoint.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
