> For the complete documentation index, see [llms.txt](https://www.techwithtyler.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.techwithtyler.dev/ai/running-llms-locally/ollama.md).

# Ollama

## Installation

{% code overflow="wrap" %}

```bash
brew install ollama
```

{% endcode %}

## Uninstallation

{% hint style="danger" %}
Uninstalling ollama does not remove downloaded models!&#x20;
{% endhint %}

{% code overflow="wrap" %}

```zsh
brew uninstall ollama
```

{% endcode %}

{% code overflow="wrap" %}

```zsh
rm -rf ~/.ollama
```

{% endcode %}

***

## Running Ollama Server

* Once up and running, we can download and run models.&#x20;

{% code overflow="wrap" %}

```bash
ollama serve
```

{% endcode %}

* Stop the server by hitting `CTRL + C` or by closing the Terminal session&#x20;

***

## Discovering and Downloading Models

* Models are [viewable here](https://ollama.com/search)
* Models are downloaded here `~/.ollama/models/manifests/registry.ollama.ai/library/`

***

## Command Cheat Sheet

### List downloaded models

{% code overflow="wrap" %}

```bash
ollama list
```

{% endcode %}

### View running models

{% code overflow="wrap" %}

```bash
ollama ps 
```

{% endcode %}

### Running models

If the model isn't installed already, it will be downloaded

{% code overflow="wrap" %}

```bash
ollama run gemma3:27b
```

{% endcode %}

***

## Integrating with VS Code

{% hint style="warning" %}
Ollama must be running for this to work — `ollama serve`
{% endhint %}

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

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

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

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