> ## 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.
</Note>

<iframe src="https://www.youtube.com/embed/YUJjWq7K4xA" title="YouTube video player" frameborder="0" className="w-full aspect-video rounded-xl" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen />

## Download Ollama

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

<Frame>
  <img src="https://mintlify.s3.us-west-1.amazonaws.com/typingmind/images/Untitled.png" alt="Untitled" />
</Frame>

## 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.

<Frame>
  <img src="https://mintcdn.com/typingmind/v2T_9VTsRBvwDNYs/images/ollama-local-1.webp?fit=max&auto=format&n=v2T_9VTsRBvwDNYs&q=85&s=297e5f10cee5f591a9e7a43970db6996" alt="Ollama Local 1" width="2034" height="1460" data-path="images/ollama-local-1.webp" />
</Frame>

## 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.

<img src="https://mintcdn.com/typingmind/v2T_9VTsRBvwDNYs/images/enable-models.webp?fit=max&auto=format&n=v2T_9VTsRBvwDNYs&q=85&s=9b7944256d71e67588f1635ab5a0e6dd" alt="Enable Models" width="3030" height="1552" data-path="images/enable-models.webp" />

<img src="https://mintcdn.com/typingmind/v2T_9VTsRBvwDNYs/images/chat-ollama.webp?fit=max&auto=format&n=v2T_9VTsRBvwDNYs&q=85&s=10b177b277093511383e50b5b198b3dc" alt="Chat Ollama" width="1808" height="1524" data-path="images/chat-ollama.webp" />


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