OChat
OChat is an Obsidian plugin for chatting with local or cloud-hosted models using the active Markdown note and relevant vault context. It defaults to local Ollama and also supports OpenAI-compatible servers such as Magnitude, LM Studio, and llama.cpp server, plus remote endpoints that expose either supported API.
Features
- Right sidebar chat for active-note and vault-aware questions.
- Local, private LAN, and cloud-hosted model endpoints, with local Ollama as the default.
- First-run setup that checks the default Ollama endpoint and shows a model picker when local models are found.
- Ollama provider using
POST /api/chatandGET /api/tags. - OpenAI-compatible provider using
/v1/chat/completionsand/v1/models. - Optional bearer-token authentication using Obsidian's secure secret storage.
- Active note, selected text, explicit
@noteattachments, and ranked Markdown vault snippets in context. - Compact assistant composer with context chips,
@note suggestions, Ask/Edit toggle, and icon controls. - Rendered Markdown chat responses using Obsidian's Markdown renderer.
- Collapsed model thinking blocks for models that emit
<think>...</think>, plus a livethinking...indicator while a request is running. - Endpoint testing in the sidebar settings panel with visible success, warning, and failure states.
- Markdown edit proposals with review mode enabled by default.
- Markdown-only file writes through Obsidian APIs.
Privacy and network use
OChat sends prompt text, active-note content, selected text, explicitly attached notes, and selected vault snippets to the configured model endpoint. The default endpoint is http://localhost:11434. When you configure a cloud endpoint, this context is sent to that provider.
Localhost and private LAN endpoints are allowed without extra acknowledgement. Public endpoints require an explicit acknowledgement in settings because note and vault context may leave your machine.
For @note suggestions and lexical context search, OChat enumerates Markdown file paths in the vault and reads eligible Markdown files. It ignores Obsidian's configuration folder and any folders listed under Excluded folders. Set Maximum vault results to 0 to prevent automatic vault snippets from being added to requests; explicitly attached notes are still read when selected.
For an authenticated endpoint, create or select an Obsidian secret in OChat's API key setting. OChat stores only the secret's ID in plugin settings and adds the secret value to requests as an Authorization: Bearer … header. To protect the credential in transit, API keys require HTTPS except when the endpoint is on localhost. Leave the setting empty for local endpoints that do not require authentication.
OChat does not include telemetry, ads, remote assets, or an auto-update mechanism.
Requirements
- Obsidian 1.13.0 or newer.
- Node.js 18 or newer for development.
- Access to an Ollama or OpenAI-compatible model endpoint, running locally, on a private LAN, or in the cloud.
Ollama quick start
- Install Ollama from ollama.com.
- Pull a model:
ollama pull llama3.2
- Confirm the local API is running:
curl http://localhost:11434/api/tags
- In OChat settings, use provider
Ollama, base URLhttp://localhost:11434, and modelllama3.2.
When OChat opens for the first time, it also checks http://localhost:11434 automatically. If models are found, choose one from the model picker. If Ollama is running somewhere else, enter that endpoint in the setup panel and test it.
Magnitude quick start
- Open Magnitude and download a model.
- In Settings → OChat, choose OpenAI-compatible and set Base URL to
http://127.0.0.1:10100/inference/v1. - In the OChat sidebar settings, choose Test endpoint and select the model.
Cloud and remote endpoint setup
OChat supports hosted endpoints that expose the Ollama API or an OpenAI-compatible API. The endpoint must support both model discovery and chat for the selected protocol.
- In Settings → OChat, set Provider to
OllamaorOpenAI-compatible, matching your endpoint's API. - Set Base URL to the endpoint's API base. For an OpenAI-compatible endpoint, include any required prefix such as
/v1, for examplehttps://models.example.com/v1. OChat appends/chat/completionsand/models, so enter the base URL rather than the full chat URL. For hosted Ollama, OChat appends/api/chatand/api/tags. - If authentication is required, create or select an Obsidian secret in API key. OChat sends it as a bearer token; API keys require HTTPS except on localhost.
- For a public endpoint, enable Acknowledge remote endpoint before testing or chatting. Your prompts and included note context will be sent to that endpoint.
- Open the OChat sidebar settings, choose Test endpoint, then select an available model.
Context workflow
OChat always includes the active Markdown note and current selection when you send a prompt. The composer shows the active note as a context chip so you can see what is grounded by default.
To attach more Markdown notes, type @ in the composer and choose a note from the suggestions, or click the plus button and search the vault. You can also type references directly, such as @README.md, @"Projects/Move Plan.md", or @[[Areas/Moving/00 Moving Dashboard.md]].
If you do not attach every relevant note, OChat still runs capped lexical search over the Markdown vault and includes ranked snippets that match your prompt, while respecting excluded folders.
Local development
Install dependencies:
npm install
Run tests:
npm test
Build the plugin:
npm run build
Install into a local vault:
npm run install-local -- "/path/to/Your Vault"
Then open Obsidian, enable community plugins, and enable OChat from Settings.
Installation
In Obsidian, open Settings → Community plugins → Browse, search for OChat, then select Install and Enable.
For a manual installation from a GitHub release:
- Download
main.js,manifest.json, andstyles.cssfrom the latest release. - Create this folder in your vault:
.obsidian/plugins/ochat. - Copy the downloaded files into
.obsidian/plugins/ochat. - Reload Obsidian and enable OChat in Settings > Community plugins.
Editing notes
When you ask OChat to edit notes, the model must return structured patch JSON with path, original, replacement, and rationale. OChat validates that each target is a Markdown file and that the original text appears exactly once before applying a replacement.
Review mode is on by default. With review mode enabled, proposed edits are shown in the OChat sidebar and require approval. If you turn review mode off, valid Markdown patches are applied automatically.
License
MIT
For plugin developers
Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.