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.