> ## Documentation Index
> Fetch the complete documentation index at: https://docs.typingmind.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Ollama (Local)

[Ollama](https://ollama.com/) is an open-source project that allows you to run many LLM models locally on your device.

You can easily config Typing Mind to run with Ollama, below is the full guide:

> [!NOTE]
>
> This instruction is for the TypingMind Web version ([https://www.typingmind.com](https://www.typingmind.com)). For the macOS version and Setapp version, due to Apple's security policy, requests to `http` protocol are blocked. If you want to connect to the macOS app, you can still follow the instructions here, but with one additional step: you need to set up HTTPS for Ollama. This can be done using various techniques (e.g., using a local HTTPS proxy). For more details on how to run Ollama on HTTPS, please reach out to the [Ollama project](https://github.com/ollama/ollama) for support.

[YouTube video player](https://www.youtube.com/embed/YUJjWq7K4xA)

## Download Ollama

Go to [https://ollama.com/](https://ollama.com/) and download Ollama to your device.

![Untitled](https://mintcdn.com/typingmind/pm53BB_D69NXvWmb/images/Untitled.webp?fit=max\&auto=format\&n=pm53BB_D69NXvWmb\&q=85\&s=c6626084ed0255df779d45f22b05ddab)

## Set up Ollama environment variables for CORS

Run the following commands so that Ollama allows connection from Typing Mind.

```bash theme={null}
launchctl setenv OLLAMA_HOST "0.0.0.0:11434"
launchctl setenv OLLAMA_ORIGINS "*"
```

**Important:** After running the commands, **completely kill the Ollama app and reopen/restart it** for the changes to take effect — **not just close and reopen it**.

Once the set up is done, run the following command to start a model (in this example: `phimini-4` )

```bash theme={null}
ollama run phi4-mini

# Output:
>>> 
>>> Send a message (/? for help)
```

## Add Ollama models to Typing Mind

Open Typing Mind and open the Model Setting button, then click “Add Custom Model” on the top right corner. Enter the details as following: (in this example, we use phi4-mini)

* Model Name: Phi 4 Mini
* Model ID: phi4-mini
* Endpoint: [http://localhost:11434/v1/chat/completions](http://localhost:11434/v1/chat/completions)
* Click Test & Save so the app can automatically check the model's capabilities.
* Click Confirm & Proceed to add model.

![Ollama Local 1](https://mintcdn.com/typingmind/v2T_9VTsRBvwDNYs/images/ollama-local-1.webp?fit=max\&auto=format\&n=v2T_9VTsRBvwDNYs\&q=85\&s=297e5f10cee5f591a9e7a43970db6996)

## Chat with Ollama

Once the model is tested and added successfully, you can enable the model in model list. Then select the custom model and chat with it normally.

![Enable Models](https://mintcdn.com/typingmind/v2T_9VTsRBvwDNYs/images/enable-models.webp?fit=max\&auto=format\&n=v2T_9VTsRBvwDNYs\&q=85\&s=9b7944256d71e67588f1635ab5a0e6dd)

![Chat Ollama](https://mintcdn.com/typingmind/v2T_9VTsRBvwDNYs/images/chat-ollama.webp?fit=max\&auto=format\&n=v2T_9VTsRBvwDNYs\&q=85\&s=10b177b277093511383e50b5b198b3dc)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.