# How to move Ollama and LM Studio models to an external drive

Guide · Updated 21 November 2026. By Mohit Nippanikar, who makes SiftMac.

## The short answer

- **Ollama:** in the app’s Settings, set **Model location** to a folder on the drive. Or set the `OLLAMA_MODELS` environment variable, which Ollama’s FAQ says to set with `launchctl setenv` for the Mac app. Then restart Ollama.
- **LM Studio:** change the models folder in **My Models**, as LM Studio’s docs describe, and keep its publisher and model folder layout.
- **Move them, don’t download them again:** copy the models you have to the drive, point the app at them, check they load, then delete the old copy. Plug the drive in before you start the app.

## 1. Before you start

See how much there is to move. `ollama list` shows each Ollama model with its size, and this totals the default folders:

```
du -sh ~/.ollama/models ~/.lmstudio/models ~/.cache/lm-studio/models 2>/dev/null
```

- **Use an SSD.** A model is read from disk every time it loads, so a slow drive mostly means slower loading. An external SSD keeps that short; a spinning hard drive is much slower.
- **Format it for Mac** if only Macs use it: APFS, in Disk Utility. Erasing a drive deletes everything on it, so copy off what’s there first.
- **Give it a short name without spaces**, so paths are easy to type. The examples below use a drive called `AIDrive`, which macOS shows at `/Volumes/AIDrive`.
- **Quit the apps.** Quit Ollama from its menu bar icon and LM Studio with **⌘Q**. If you started `ollama serve` in Terminal, stop it with Control-C.

## 2. Move Ollama’s models

On a Mac, Ollama keeps models in `~/.ollama/models`: a `blobs` folder with the model data, and a `manifests` folder that names each model. Move the whole folder, so the two stay together.

### 1. Copy the models to the drive

`ditto` copies what’s inside `models` into a new folder on the drive:

```
ditto ~/.ollama/models /Volumes/AIDrive/ollama-models
```

### 2. Point Ollama at the new folder

**In the Ollama app:** open its **Settings**, and under **Model location** choose `/Volumes/AIDrive/ollama-models`. Recent versions of the app have this setting, and pass the folder to Ollama’s server as `OLLAMA_MODELS` when it starts. Where the app has it, it takes precedence over the environment variable.

**Or with the environment variable**, the way Ollama’s FAQ describes for the Mac app. Run this, then quit and reopen Ollama:

```
launchctl setenv OLLAMA_MODELS /Volumes/AIDrive/ollama-models
```

A value set with `launchctl setenv` doesn’t survive a restart of the Mac, so run it again afterwards, or use the app’s setting, which the app remembers. If you run `ollama serve` yourself, put the variable in front of it instead: `OLLAMA_MODELS=/Volumes/AIDrive/ollama-models ollama serve`.

### 3. Check, then remove the old copy

Run `ollama list`: the same models should be there, and one should start with `ollama run`. Then clear the old folder, in Finder (⇧⌘G, `~/.ollama/models`, move what’s inside to the Trash) or in Terminal:

```
rm -rf ~/.ollama/models/*
```

Leave the rest of `~/.ollama` where it is: Ollama keeps its configuration and logs there. From now on, `ollama pull` saves new models to the drive.

## 3. Move LM Studio’s models

LM Studio keeps downloaded models in `~/.lmstudio/models`, or `~/.cache/lm-studio/models` in older versions: a folder for each publisher, a folder for each model inside it, and the model files inside that. Its docs show this layout, and LM Studio expects it in the new place too. Copy the whole folder:

```
ditto ~/.lmstudio/models /Volumes/AIDrive/lmstudio-models
```

1. Open LM Studio and go to **My Models**. LM Studio’s docs say that’s where you change the models directory; choose `/Volumes/AIDrive/lmstudio-models`.
2. Check that your models are listed and that one loads.
3. In Finder, move what’s inside the old `models` folder to the Trash, then empty it.

A GGUF file you downloaded outside LM Studio can be added with `lms import <path/to/model.gguf>`, which its docs describe as experimental.

## 4. Hugging Face, and one model in two apps

Python tools that download from Hugging Face keep models in `~/.cache/huggingface/hub`. Hugging Face’s docs name the variables that move it: `HF_HOME` for everything it stores (by default `~/.cache/huggingface`), or `HF_HUB_CACHE` for just the downloaded models. They’re read when a tool starts, so set one in your shell profile, such as `~/.zshrc`, and open a new Terminal window:

```
export HF_HOME=/Volumes/AIDrive/huggingface
```

Each app keeps models in its own format: Ollama’s blobs, LM Studio’s GGUF files, Hugging Face’s cache. So the same model downloaded in two apps takes its space twice. Pick one app per model, and [remove the copies you don’t use](https://siftmac.com/guides/ai-files-on-mac) with each app’s own command.

## 5. If something goes wrong

- **Ollama shows no models.** If `ollama list` comes back empty, the drive wasn’t connected when Ollama started, or the path has a typo. When the app can’t reach its Model location, it starts with the default folder in your home folder instead. Connect the drive, then quit and reopen Ollama. `launchctl getenv OLLAMA_MODELS` shows what the variable is set to.
- **A download landed on the internal disk.** Same cause: Ollama was using the default folder at the time. Check with `du -sh ~/.ollama/models`. Once Ollama is using the drive again, that folder isn’t in use, and you can empty it as above.
- **A setting doesn’t seem to apply.** In app versions with Model location, set the folder there, since it wins over the variable. An `export` line in `~/.zshrc` only reaches an Ollama you start from Terminal, not the app.
- **Ollama’s log** says what it’s doing: `tail -n 50 ~/.ollama/logs/server.log`.
- **To undo it,** clear the Model location or run `launchctl unsetenv OLLAMA_MODELS`, copy the models back into `~/.ollama/models`, and restart Ollama.
- **Ejecting the drive:** quit Ollama and LM Studio first. macOS won’t eject a drive a program is still using.

## Questions

### Can Ollama and LM Studio share one models folder?

No. Ollama stores models as blobs named by their checksum, with manifests that name them; LM Studio expects model files in publisher and model folders. Give each app its own folder; both can sit on the same drive.

### Do models run slower from an external drive?

Mostly when a model loads, since that’s when it’s read from the drive. Once loaded, it runs from memory as before. A fast SSD keeps the wait short.

### Will new downloads go to the drive?

Yes. Once Ollama’s server is using the new folder, `ollama pull` saves there, and LM Studio downloads into the models directory you chose.

### What happens if I unplug the drive?

The models aren’t there until you plug it back in. Quit the apps before ejecting, and connect the drive before starting them; otherwise Ollama starts with an empty default folder and can download models to your internal disk again.

## How SiftMac handles it

Its AI files category lists Ollama, LM Studio and Hugging Face models in their default folders in your home folder, each with its size. Ollama’s are sized by the layers no other model shares, and removed with `ollama rm`. None is picked for you, and a model you remove is deleted straight away rather than kept on the Undo Shelf, since you can download it again. Models you’ve moved to an external drive are outside its scan, and off your Mac’s own disk.

Download: https://siftmac.com/SiftMac.dmg (scanning is free, and so is the first 2 GB of cleaning).

## Sources

- [Ollama FAQ: where models are stored, and setting OLLAMA_MODELS on a Mac](https://docs.ollama.com/faq)
- [Ollama docs: macOS (file locations and logs)](https://docs.ollama.com/macos)
- [Ollama on GitHub: the app’s Model location setting](https://github.com/ollama/ollama/blob/main/app/ui/app/src/components/Settings.tsx)
- [Ollama on GitHub: how the app passes Model location to its server](https://github.com/ollama/ollama/blob/main/app/server/server.go)
- [LM Studio docs: Download a model (changing the models directory)](https://lmstudio.ai/docs/app/basics/download-model)
- [LM Studio docs: Import models (folder layout and lms import)](https://lmstudio.ai/docs/app/advanced/import-model)
- [Hugging Face: environment variables (HF_HOME, HF_HUB_CACHE)](https://huggingface.co/docs/huggingface_hub/package_reference/environment_variables)

## Related

- [Is it safe to delete Ollama models in ~/.ollama/models?](https://siftmac.com/safe-to-delete/ollama-models)
- [Is it safe to delete LM Studio’s models folder?](https://siftmac.com/safe-to-delete/lm-studio-models)
- [Is it safe to delete ~/.cache/huggingface?](https://siftmac.com/safe-to-delete/hugging-face-cache)
- [What Claude Code, Cursor, Ollama and Hugging Face leave on your Mac](https://siftmac.com/guides/ai-files-on-mac)
- [What fills a Mac that runs local models and AI coding tools](https://siftmac.com/for/ai-developers)
- [AI files: old chats, caches, updates and downloaded models](https://siftmac.com/features/ai-files)

Canonical: https://siftmac.com/guides/move-ollama-models-to-external-drive
