Obsidian AI Providers
⚠️ Important Note: This plugin is a configuration tool - it helps you manage your AI settings in one place.
Think of it like a control panel where you can:
- Store your API keys and settings for AI services
- Share these settings with other Obsidian plugins
- Avoid entering the same AI settings multiple times
Required by plugins
Supported providers
- OpenAI
- OpenRouter
- Anthropic
- Google Gemini
- Mistral AI
- Together AI
- Fireworks AI
- Perplexity AI
- DeepSeek
- xAI (Grok)
- Cerebras
- Z.AI
- Groq
- 302.AI
- Novita AI
- DeepInfra
- SambaNova
- LM Studio
- Ollama (and Open WebUI)
- OpenAI compatible API
Features
- Fully encapsulated API for working with AI providers
- Develop AI plugins faster without dealing directly with provider-specific APIs
- Easily extend support for additional AI providers in your plugin
- Available in 11 languages: English, Spanish, French, Italian, Portuguese, German, Russian, Chinese, Japanese, Korean, and Dutch
Installation
Obsidian plugin store (recommended)
This plugin is available in the Obsidian community plugin store https://obsidian.md/plugins?id=ai-providersBRAT
You can install this plugin via BRAT:pfrankov/obsidian-ai-providers
Create AI provider
Ollama
- Install Ollama.
- Install Gemma 2
ollama pull gemma2or any preferred model from the library. - Select
OllamainProvider type - Click refresh button and select the model that suits your needs (e.g.
gemma2)
OLLAMA_ORIGINS to *:
- For MacOS run
launchctl setenv OLLAMA_ORIGINS "*". - For Linux and Windows check the docs.
OpenAI
- Select
OpenAIinProvider type - Set
Provider URLtohttps://api.openai.com/v1 - Retrieve and paste your
API keyfrom the API keys page - Click refresh button and select the model that suits your needs (e.g.
gpt-4o)
OpenAI compatible server
There are several options to run local OpenAI-like server:- Open WebUI
- llama.cpp
- llama-cpp-python
- LocalAI
- Obabooga Text generation web UI
- LM Studio
- ...maybe more
OpenRouter
- Select
OpenRouterinProvider type - Set
Provider URLtohttps://openrouter.ai/api/v1 - Retrieve and paste your
API keyfrom the API keys page - Click refresh button and select the model that suits your needs (e.g.
anthropic/claude-3.7-sonnet)
Google Gemini
- Select
Google GeminiinProvider type - Set
Provider URLtohttps://generativelanguage.googleapis.com/v1beta/openai - Retrieve and paste your
API keyfrom the API keys page - Click refresh button and select the model that suits your needs (e.g.
gemini-1.5-flash)
LM Studio
- Select
LM StudioinProvider type - Set
Provider URLtohttp://localhost:1234/v1 - Click refresh button and select the model that suits your needs (e.g.
gemma2)
Groq
- Select
GroqinProvider type - Set
Provider URLtohttps://api.groq.com/openai/v1 - Retrieve and paste your
API keyfrom the API keys page - Click refresh button and select the model that suits your needs (e.g.
llama3-70b-8192)
For plugin developers
Docs: How to integrate AI Providers in your plugin.Development checks
Use Node.js 24 and install the committed dependencies with npm ci.
Run npm run format:check, npm run check, npm run build,
npm run sdk:build, and npm run example:build before submitting a change.
The check command runs lint, tests with 100% coverage thresholds, and type checks.
These checks and builds also run on pull requests.
Quick reference (details in SDK docs):
try {
const finalText = await aiProviders.execute({
provider,
prompt: "Hello",
onProgress: (chunk, full) => {/ stream UI update /},
abortController
});
// use finalText
} catch (e) {
// handle error / abort
}
Tool-calling loops are available via toolsExecute() (SDK 1.7.0 / Service API v4). It is message-only and uses top-level tools / tool_choice, returning an OpenAI-style assistant message (role, content, tool_calls) that you can append directly to messages history.
Removed callbacks: onEnd / onError — promise resolve/reject covers them (only onProgress remains for streaming). Legacy chainable handler also deprecated.
Roadmap
- [x] Docs for devs
- [x] Ollama context optimizations
- [x] German translations
- [x] Chinese translations
- [x] Update to latest OpenAI version and embedding models
- [x] Russian translations
- [x] Groq Provider support
- [x] Passing messages instead of one prompt
- [x] Anthropic Provider support
- [x] Shared embeddings to avoid re-embedding the same documents multiple times
- [x] Spanish, Italian, French, Dutch, Portuguese, Japanese, Korean translations
- [x] Incapsulated basic RAG search with optional BM25 search
My other Obsidian plugins
- Local GPT that assists with local AI for maximum privacy and offline access.
- Colored Tags that colorizes tags in distinguishable colors.