Skip to content

How-ToOS

How to Use Ollama With Obsidian for Private, Local AI Notes

Use the Copilot for Obsidian plugin with Ollama to chat with and search your notes locally. Pull a chat and embedding model, set OLLAMA_ORIGINS to app://obsidian.md*, add the model with the ollama provider and raise the context window.

By , Systems & Technical Editor

3 min read

How to Use Ollama With Obsidian for Private, Local AI Notes

Obsidian is a popular notes app that stores everything as Markdown files on your own drive. With the community plugin Copilot for Obsidian, you can chat with an AI model about your notes, and if that model runs in Ollama on your PC, nothing has to leave your machine. This guide follows the plugin's local setup guide and Ollama's FAQ, on Windows.

What you need

Step 1: Install Copilot for Obsidian

The plugin's README says to install Copilot from Obsidian's Community Plugins. Find Copilot in Obsidian's community plugins browser, install it and enable it.

Step 2: Download a model

Open PowerShell and pull a chat model and an embedding model. The plugin's guide uses Mistral 7B and nomic-embed-text as examples:

ollama pull mistral
ollama pull nomic-embed-text

Any chat model your PC can run will work; smaller models answer faster on modest hardware.

Step 3: Let Obsidian talk to Ollama

Ollama's FAQ says it allows cross-origin requests from 127.0.0.1 and 0.0.0.0 by default, and explains that you can allow more with the OLLAMA_ORIGINS environment variable. The Copilot guide says Obsidian needs app://obsidian.md*. For a quick test, close the Ollama app first to free its port, then run this in PowerShell:

$env:OLLAMA_ORIGINS="app://obsidian.md*"; ollama serve

To make it permanent, Ollama's FAQ says Ollama on Windows inherits your user and system environment variables: quit Ollama from the taskbar, search Settings for environment variables, choose Edit environment variables for your account, add OLLAMA_ORIGINS with the value app://obsidian.md* to your user account, then start Ollama again from the Start menu.

Step 4: Add the model in Copilot

In Copilot's settings, choose Add Custom Model, type the model name exactly as you pulled it (for example, mistral), select ollama as the provider and add it. It will then appear in the plugin's model picker.

Step 5: Set the context window

The Copilot guide warns that you must set a context window for Ollama models, or long prompts can silently fail. Its suggested method is to run the model with ollama run mistral, enter /set parameter num_ctx 32768 and then save the model with /save. Use a value that suits your model and memory. Our guide to setting Ollama's context length explains the other ways to do it and what larger contexts cost in memory.

Step 6: Search your vault with local embeddings

For questions about your whole vault, the plugin uses embeddings. Its guide says to add nomic-embed-text with the ollama provider as the embedding model in Copilot's QA settings. With both chat and embedding models in Ollama, the guide says you get a completely offline QA experience. It also suggests mxbai-embed-large as an alternative embedding model. Our embedding models in Ollama guide explains how embeddings work.

Troubleshooting

  • Connection or CORS errors: check that OLLAMA_ORIGINS is set and that you restarted Ollama afterwards.

  • Port already in use: close the Ollama app before running ollama serve yourself.

  • Using Ollama on another PC: see our guide to sharing Ollama on your local network.

Our verdict

Copilot for Obsidian plus Ollama gives you an AI assistant for your notes that runs entirely on your PC. The two steps people miss are setting OLLAMA_ORIGINS to app://obsidian.md* and raising the model's context window; get those right and the rest is a few clicks in the plugin's settings.

The bottom line

Copilot for Obsidian plus Ollama gives you an AI assistant for your notes that runs entirely on your PC. The two steps people miss are setting OLLAMA_ORIGINS to `app://obsidian.md*` and raising the model's context window; get those right and the rest is a few clicks in the plugin's settings.

Sources

  1. 01Copilot for Obsidian, Local Copilot setup guide
  2. 02Copilot for Obsidian, GitHub repository README
  3. 03Ollama, FAQ

About the author

Marcus Thorne

Systems & Technical Editor

Marcus writes Forge PC's step-by-step build, troubleshooting and system optimisation guides. His background spans Windows kernel and power-state diagnostics, UEFI/BIOS configuration, NVMe storage arrays, ATX 3.1 power delivery and running local AI and LLM workloads on consumer graphics cards.

More from Marcus Thorne

Read next

How to Run a Local LLM on an AMD Ryzen AI NPU With FastFlowLM

How-To

How to Run a Local LLM on an AMD Ryzen AI NPU With FastFlowLM

FastFlowLM runs language models on the XDNA 2 NPU in Ryzen AI chips. Update the NPU driver to 32.0.203.311 or later, install flm-setup.msi, test with flm run llama3.2:1b and use flm serve for an OpenAI-compatible local API.

Marcus Thorne3 min

How to Connect a PS5 DualSense Controller to Your PC

How-To

How to Connect a PS5 DualSense Controller to Your PC

A PS5 DualSense connects to a Windows PC by USB-C or Bluetooth. PlayStation says haptics and the headset jack need a cable on PC; to pair wirelessly, hold Create and PS until the light bar blinks, then add it in Windows.

Marcus Thorne3 min

How to Use Ollama With n8n for Local AI Workflows

How-To

How to Use Ollama With n8n for Local AI Workflows

Run n8n in Docker, make Ollama listen on 0.0.0.0, and set the n8n Ollama credential's Base URL to http://host.docker.internal:11434. A Chat Trigger, Basic LLM Chain and Ollama Chat Model then make a first local AI workflow.

Marcus Thorne4 min