Connect Obsidian to Ollama: 100% Local AI Notes
Learn how to connect Obsidian to Ollama for private, offline AI notes. Tested with Smart Connections and Text Generator on a local vault.

Why I Ditched Cloud APIs for a 100% Local Obsidian Vault
Related: Fix Open WebUI Docker Connection Refused to Ollama →
Pasting raw journal entries, client call logs, and unannounced software architecture diagrams into cloud-hosted LLM endpoints was a continuous security risk. Cloud models offer speed, but they turn your private knowledge base into remote data points.
I set out to build an air-gapped, zero-outbound-traffic personal assistant inside Obsidian. The objective was clear: maintain semantic search, inline text generation, and dynamic note summaries without a single byte crossing my network interface.
To test this local LLM Obsidian setup, I used two hardware configurations:
- A MacBook Pro with an M2 Pro chip and 32GB of unified memory.
- A Linux workstation equipped with an AMD Ryzen 9 5900X, 64GB RAM, and an Nvidia RTX 3080 with 10GB VRAM.
I subjected both machines to strict network monitoring using Little Snitch on macOS and iftop on Linux. I configured two specific community plugins: Smart Connections for vector-based vault retrieval and Text Generator for direct inline drafting.
When you connect Obsidian to Ollama, you convert your static markdown files into an interactive graph database that runs entirely on your local silicon.
Setting Up Ollama as Your Local Inference Engine
Related: Top 5 Free Cursor AI Alternatives for Open-Source Coding (2026, Tested) →
Before touching Obsidian, you need an inference engine that serves models via a clean, local HTTP API. Ollama handles model quantization, GPU offloading, and memory management automatically.
Download and install Ollama for your operating system. Once installed, launch your terminal and pull two distinct models: an inference model for text generation and a dedicated embedding model for vector search.
# Pull the generation model (7B parameter model works best for 10GB-16GB VRAM)
ollama pull qwen2.5:7bPull the vector embedding model
ollama pull nomic-embed-text
The most common point of failure occurs right here: network CORS policies. Obsidian runs as an Electron application (app://obsidian.md). By default, Ollama rejects requests from origins other than standard browser sessions or direct localhost terminal commands. If you skip this configuration, Obsidian plugins will throw generic "Failed to fetch" or "Network Error" warnings.
Fixing the CORS Policy
To allow Obsidian to speak to Ollama, you must set the OLLAMA_ORIGINS environment variable to explicitly allow Electron origins or all origins.
On macOS
Open your terminal and set the environment variable globally, or edit your shell configuration (.zshrc or .bash_profile):
export OLLAMA_ORIGINS="*"If Ollama runs as a macOS menu bar app, quit it completely and launch it from the terminal where the variable is exported:
OLLAMA_ORIGINS="*" ollama serveOn Linux (systemd service)
If Ollama runs as a background service, edit the systemd override configuration:
sudo systemctl edit ollama.serviceAdd the following lines under the service block:
[Service]
Environment="OLLAMA_ORIGINS=*"Save the file, reload systemd, and restart the service:
sudo systemctl daemon-reload
sudo systemctl restart ollamaVerify your local server is responding by running curl http://localhost:11434/api/tags. If it returns a JSON payload listing qwen2.5:7b and nomic-embed-text, your backend setup is ready for Obsidian.
Plugin 1: Semantic Vault Search with Obsidian Smart Connections
Related: Best AI Tools for Freelancers in 2026: 17 Tools That Actually Save Billable Time →
The Smart Connections plugin brings Retrieval-Augmented Generation (RAG) into Obsidian. It scans your markdown files, breaks them down into chunks, generates vector embeddings, and stores those vectors locally. When you ask a question, it retrieves the most relevant notes and passes them to Ollama to generate an answer backed by your actual documents.
Step-by-Step Configuration
- Open Obsidian Settings > Community Plugins > search for Smart Connections and click Install, then Enable.
- Open the Smart Connections plugin settings.
- Locate the Embedding Model dropdown and select Ollama.
- Set the Server URL to
http://localhost:11434. - Set the Model Name to
nomic-embed-text. - Scroll down to the Smart Chat settings section.
- Set the Chat Model Provider to Ollama.
- Set the Server URL to
http://localhost:11434. - Set the Model Name to
qwen2.5:7b(orllama3.2:3bif you are constrained by hardware).
Building the Vector Index
Once configured, trigger the indexing process by opening the Smart Connections view in the right sidebar and clicking Force Refresh Embeddings.
During my test on a vault containing 2,400 notes (roughly 12,000 pages of text), the initial indexing process took 14 minutes on the M2 Pro Mac. Memory usage peaked at 3.1 GB of RAM during vector computation. Because nomic-embed-text runs locally, zero data left the device.
The resulting vector database is stored locally inside your vault under .obsidian/plugins/smart-connections/embeddings/.
Real-World Query Performance
I asked Smart Connections: "What were my conclusions regarding Kubernetes storage options from my 2023 infrastructure logs?"
Smart Connections executed a cosine similarity search across the local vector database, retrieved four matching note chunks, and formatted them into a context prompt.
The initial context generation took 350 milliseconds. qwen2.5:7b began streaming tokens 1.2 seconds later at a rate of 42 tokens per second on Apple Silicon. The response cited exact note titles and extracted the precise hardware bottlenecks I had documented a year prior.
Plugin 2: In-line Writing and Generation with Text Generator
Related: 5 Best GitHub Copilot Alternatives in 2026 (Tested for Accuracy & Speed) →
While Smart Connections functions as an interactive research assistant, the Text Generator plugin operates like GitHub Copilot for raw prose. It inserts generated text directly into your active note based on hotkeys, context selections, or automated prompts.
Using the obsidian text generator ollama configuration allows you to complete sentences, rewrite technical jargon, auto-tag notes, and extract action items from meeting raw dumps without opening a sidebar chat.
Setting Up the Ollama Provider in Text Generator
- Open Obsidian Settings > Community Plugins > search for Text Generator and click Install, then Enable.
- Navigate to Text Generator Settings.
- Under LLM Provider, select Custom or OpenAI Compatible.
- Set the Endpoint URL to
http://localhost:11434/v1(Note the/v1suffix: Text Generator expects the OpenAI-compatible v1 route provided natively by Ollama). - Leave the API Key blank, or enter
ollamaif the plugin requires a non-empty string. - Under Model, click the refresh icon or manually type
qwen2.5:7borllama3.2:latest. - Set the Advanced Parameters:
- Temperature:
0.3(lower values keep generation factual and reduce hallucination). - Max Tokens:
2048.
- Temperature:
Custom Templates and In-line Shortcuts
Text Generator excels when using custom prompts stored right inside your vault. I created a template file under Templates/Prompts/Summarize Action Items.md:
---
PromptId: summarize-actions
Name: Extract Action Items
---
***
Task: Read the following note excerpt and extract all actionable tasks into a check-box list (- [ ]).
Group them by owner if names are mentioned.Context: {{selection}}
Highlighting a 500-word block of raw meeting transcript, pressing Cmd + Shift + G, and selecting Extract Action Items executed the task entirely within system memory.
Text Generator read the selection, routed the payload to localhost:11434/v1/chat/completions, and replaced or appended the extracted check-list items beneath my cursor within 2.5 seconds.
Smart Connections vs. Text Generator: Which Fits Your Workflow?
Related: Best AI SEO Tools in 2026: The Complete Comparison Guide →
Both plugins integrate with Ollama seamlessly, but they solve fundamentally different problems inside an offline ai note taking workflow.
| Feature / Metric | Obsidian Smart Connections | Obsidian Text Generator |
|---|---|---|
| Primary Focus | Whole-vault RAG, cross-note discovery, interactive Q&A | In-line text generation, prompt macros, execution on selection |
| Ollama API Path | Native API (/api/embeddings & /api/chat) | OpenAI-compatible endpoint (/v1) |
| Vector Indexing | Required (creates local vector database) | Not required |
| Optimal Ollama Model | nomic-embed-text + qwen2.5:7b | qwen2.5:7b or llama3.2:3b |
| RAM/VRAM Footprint | Moderate-High (Vector index + Chat model loaded) | Low-Moderate (Only generation model loaded) |
| Prompt Flexibility | Chat-based context retrieval | Customizable modular template files inside vault |
| Best For | "What do I know about X across all my files?" | "Rewrite this paragraph / Generate summary right here" |
If your goal is synthesis across months of research notes, Smart Connections is required. If your goal is speed, writing acceleration, and quick formatting templates, Text Generator is the better tool.
I keep both running simultaneously. Smart Connections uses nomic-embed-text and qwen2.5:7b, while Text Generator calls the exact same qwen2.5:7b model instance already held in VRAM by Ollama, causing zero extra memory overhead.
Troubleshooting Common Bottlenecks and Failures
Related: Perplexity vs ChatGPT Search vs Google AI Mode: The Real Comparison (2026) →
Even with a dedicated setup, running local inference engines inside Electron app plugins introduces specific performance bottlenecks. Here is how to fix the primary issues I encountered.
1. The Model Context Window Is Truncated (2048 Token Limit)
By default, Ollama sets a context length (num_ctx) of 2048 tokens unless explicitly directed otherwise. If you send a massive context payload via Smart Connections, Ollama will quietly cut off the top of your notes, causing hallucinated or incomplete answers.
To fix this, edit the Modelfile or configure parameters in your plugin. To increase context capacity globally for a model, create a file named Modelfile:
FROM qwen2.5:7b
PARAMETER num_ctx 8192Then create an updated local model in your terminal:
ollama create qwen2-8k -f ModelfileUpdate your plugin settings in Obsidian to point to qwen2-8k instead of the default tag.
2. VRAM Thrashing and Model Swapping Delays
If you assign Smart Connections an embedding model from Ollama (nomic-embed-text) alongside a large generation model (qwen2.5:7b), Ollama will repeatedly unload and load these models into VRAM if your GPU memory is under 12GB.
This causes a 5-to-10 second delay every time you alternate between running a search and generating a chat response.
To fix VRAM thrashing:
- Set the environment variable
OLLAMA_KEEP_ALIVE=-1in your terminal or startup script. This forces Ollama to keep loaded models continuously in memory rather than evicting them after 5 minutes of inactivity. - Alternatively, switch Smart Connections' embedding engine setting to Transformers.js (Local). This runs the embedding calculation inside Obsidian's JavaScript runtime via WebAssembly, leaving your entire GPU VRAM available for the generation model in Ollama.
3. Blank Responses or Silence on Generation Commands
If Text Generator completes an action without outputting text, open Obsidian's developer tools by pressing Cmd + Option + I (macOS) or Ctrl + Shift + I (Windows/Linux) and check the Console tab.
If you see 404 Not Found errors pointing to http://localhost:11434/v1/completions, you configured the wrong endpoint path. Ensure the base URL in Text Generator settings is strictly set to http://localhost:11434/v1. Do not add /chat/completions to the end of the URL field; the plugin appends that route automatically.
Frequently Asked Questions
Do I need a discrete GPU to connect Obsidian to Ollama?
No. Ollama supports CPU-only inference using AVX2 instruction sets, as well as native hardware acceleration on Apple Silicon (M1/M2/M3/M4 chips). While an Nvidia GPU with VRAM yields faster generation speeds (40+ tokens per second), an Apple Silicon Mac or modern Intel/AMD CPU can run 3B to 7B parameter models cleanly at readable speeds (10-25 tokens per second).
Will my local notes ever be sent to third-party servers?
No. When both plugins are set to point to localhost or 127.0.0.1, all data transfers remain entirely inside your machine's loopback network interface. You can verify this by turning off your Wi-Fi or physically unplugging your Ethernet cable; both Smart Connections and Text Generator will continue to index and generate responses normally.
Can I run both Smart Connections and Text Generator simultaneously?
Yes. Because both plugins send requests to the central Ollama daemon running in the background, they share hardware resources efficiently. Ollama automatically queues incoming execution calls if both plugins request inference at the exact same millisecond.
How do I handle large vaults with tens of thousands of notes without crashing?
For vaults containing over 10,000 notes, avoid indexing entire raw vaults at once with Smart Connections. Use the plugin's exclusion settings to ignore non-essential files, such as temporal daily notes, attachments, PDF exports, and archived data. Additionally, set Smart Connections' chunk size higher (e.g., 1024 tokens) to keep total vector node counts low and manageable for system RAM.
مواضيع مقترحة · Suggested Topics
استكشف مواضيع ومحاور ذات صلة بهذا المقال — روابط داخلية لتعميق قراءتك.
The Daily Pulse
Newsletter delivery is not connected yet. This form only saves your address in this browser; no email is sent.
Get concise, source-linked technology notes without the hype.