LLM Connector

pending

by Lorenz Barna

Centralized LLM provider management. Connect AI providers and expose a unified API for other plugins.

Updated 1mo agoMITDiscovered via Obsidian Unofficial Plugins
View on GitHub

LLM Connector for Obsidian

Centralized LLM provider management for Obsidian. Configure AI providers once, let other plugins use them through a simple, standardized API. Be provider-agnostic by using the tier system (Fast, Balanced, Advanced, Thinking, Code, Embedding) instead of hardcoding model names. Currently Supports Ollama, OpenRouter, OpenAI, and Anthropic. More to come!

How it works:

  1. Providers are connected once in the settings and supply available models to the connector
  2. You assign models to performance tiers (Fast, Balanced, Advanced, Thinking, Code, Embedding)
  3. Other Plugins request completions via tier-based API

Features

For Users

  • 4 Provider Integrations: Ollama, OpenRouter, OpenAI, Anthropic
  • Performance Tier System: Select models for 6 Tiers (Fast, Balanced, Advanced, Thinking, Code and Embedding)
  • Automatic Fallbacks: If a tier isn't configured, it automatically falls back to the next best tier
  • Unified Settings: Configure all providers in one place

For Plugin Developers

  • Unified API: One API for all LLM providers - no need to implement provider-specific code
  • Tier-Based Requests: Request "balanced" tier instead of hardcoding model names
  • Reference Implementation: LLM Tester plugin shows exactly how to integrate

Getting Started

Plugin Installation

  1. Open Obsidian Settings → Community plugins
  2. Click "Browse" and search for LLM Connector
  3. Click "Install" and then toggle it ON

Configuration

  1. Open Settings → LLM Connector

  2. Enable Providers (Provider-Specific Guides in the User Guide)

    • Configure API settings
    • Press Test connection to verify connection and fetch model list
    • Should show "✓" next to Provider name
  3. Assign Models to Tiers:

    • Fast: Select a smaller model for quick tasks (e.g., granite3.2:2b)
    • Balanced: Select your preferred general-purpose model (e.g., llama3.2)
    • Advanced: Select a larger model for complex tasks (e.g., claude-sonnet-4.5 or gpt-5)
    • Thinking: For reasoning tasks (e.g., deepseek-r1)
    • Code: For code generation (e.g., qwen2.5-coder or gpt-5.2-codex)
    • Embedding: For vector embeddings (e.g., nomic-embed-text)
  4. Miscellaneous Settings:

    • Default tier: Balanced (used when plugin doesn't specify)
    • Notification mode: Console (or "Notice" to show Obsidian notifications)
    • Show once per session: ON (reduce notification spam)

Mobile Limitations

Important: LLM Connector works on Obsidian mobile, but with limitations:

  • Local Ollama does NOT work - Ollama runs on localhost and cannot be accessed from mobile devices
  • Remote Ollama DOES work - If you expose Ollama via network (e.g., Tailscale, VPN, public IP), mobile can connect
  • All cloud providers work - OpenRouter, OpenAI, and Anthropic work normally on mobile

Recommendation:

  • Do NOT sync plugin settings if you use Ollama locally on desktop
  • Configure cloud providers separately on mobile
  • OR expose Ollama remotely and configure the remote URL in mobile settings

Privacy & Data Handling

What data is sent where:

  • Ollama (Local): All data stays on your machine. No external servers contacted.
  • OpenRouter: Your prompts and responses are sent to OpenRouter, which forwards to the selected model provider. Data is not stored by OpenRouter (see their privacy policy).
  • OpenAI: Your prompts and responses are sent to OpenAI servers. By default, API data is not used for training (see data usage policies).
  • Anthropic: Your prompts and responses are sent to Anthropic servers. API data is not used for training (see privacy policy).

This plugin:

  • Does NOT store, log, or transmit any of your data
  • Does NOT collect telemetry or analytics
  • Stores API keys locally in Obsidian settings (encrypted by Obsidian)
  • Only sends data when you explicitly trigger an LLM request
  • Open source - you can audit the code yourself

Performance Tiers

The tier system lets you configure different models for different use cases:

TierUse CaseExample ModelsFallback Chain
FastQuick responses, simple tasksgranite3.2:2b, gpt-4o-mini, claude-haikufast → balanced → advanced
BalancedGeneral-purpose, most tasksllama3.2, gpt-4o, Phi4balanced → advanced → fast
AdvancedComplex reasoning, long contextphi4, gpt-4-turbo, claude-sonnetadvanced → balanced → fast
ThinkingDeep reasoning, problem-solvingdeepseek-r1, o1-preview, claude-opusthinking → advanced → balanced → fast
CodeCode generation, reviewdeepseek-coder, gpt-4o, claude-sonnet, qwen2.5-codercode → advanced → balanced → fast
EmbeddingVector embeddings, semantic searchnomic-embed-text, text-embedding-ada-002embedding ONLY (no fallback)

Examples are only current suggestions based on popular models. Do your own research and testing as the AI landscape evolves rapidly!

How Fallback Works:

  • If you request "advanced" tier but haven't configured it, the system automatically falls back to "balanced"
  • If "balanced" also isn't configured, it falls back to "fast"
  • Notifications show which tier was actually used
  • Embedding tier NEVER falls back (incompatible with chat models)

API for Plugin Developers

LLM Connector exposes a clean, typed API for other Obsidian plugins to consume. This allows plugins to access AI capabilities without implementing provider-specific code and forcing the user to reconfigure providers for each plugin.

Find the Complete API documentation in the Dev Guide. An example usecase can be found in the LLM Tester plugin.

Troubleshooting

Find common issues and solutions in the Troubleshooting Part of the User Guide.

Plugins using LLM Connector

  • Dynamic Contacts - Generate contact summaries, action items, and follow-ups using LLMs

Roadmap

Planned Features

  • Mobile support: Test and optimize for iOS/Android
  • True streaming: Real-time token streaming (if Obsidian API permits)
  • Vision tier: Image understanding with multimodal models (GPT-4 Vision, Claude 3 Opus)
  • Conversation history: Multi-turn chat support with context management
  • Cost tracking: Usage analytics and spending limits for cloud providers
  • Custom providers: SDK for adding your own provider implementations
  • Model caching: Cache model lists to reduce API calls
  • Retry logic: Automatic retry for generation tasks

About AI use in Development

LLM Connector is an experiment in semi-automated development using AI. Big parts of the codebase and documentation were generated with the help of OpenCode using models like Claude Sonnet 4.5 and others. For me this is an attempt to find out what is currently possible with AI-assisted development and what its limitations are. I believe this to be a successful experiment and am happy with the results and especially think this plugin has potential to be useful, which is why I decided to release it as a community plugin.

License

MIT License - see LICENSE file for details.

Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes with clear commit messages
  4. Test thoroughly
  5. Submit a pull request

For bugs and feature requests, open an issue on GitHub.

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.