Inline AI
approvedby nitinvishway
Type /ai <prompt> in any note, press Enter, and your local Ollama model writes inline. Thus, Inline AI - This plugin has not been manually reviewed by Obsidian staff.
✨ Inline AI an Obsidian Plugin
Type
/ai+ your prompt → Press Enter → AI response streams directly into your note
Never leave your note to get AI help. Generate text, brainstorm, summarize, and refactor—all inline.
🚀 Quick Start (30 seconds)
1️⃣ Choose Your AI Provider
Pick one (or come back to change it later):
| Provider | Speed | Cost | Setup |
|---|---|---|---|
| 🦙 Ollama | ⚡⚡ Fast | 💰 Free | Local |
| 🤖 OpenAI | ⚡ Fast | 💵 ~$0.01/prompt | 2 min |
| 🧠 Claude | ⚡ Fast | 💵 ~$0.01/prompt | 2 min |
| ✨ Gemini | ⚡⚡ Very fast | 💰 Free tier | 1 min |
2️⃣ Install Plugin
Current submission flow:
- Prepare the repo root with
manifest.json,README.md, andLICENSE. - Cut a release by bumping the version in
manifest.json, tagging a matching GitHub release, and attachingmain.js,manifest.json, andstyles.css. - Submit the repo URL through community.obsidian.md → Plugins → New plugin.
Manual install while developing:
git clone https://github.com/nitinvishway/Inline-AI.git
cd Inline-AI
npm install && npm run build
# Copy main.js + manifest.json + styles.css to .obsidian/plugins/Inline-AI/
3️⃣ Configure Your Provider
Settings → Inline AI → Choose provider → Paste API key (if needed) → Done ✅
📝 How to Use
Basic Syntax
/ai your prompt here
Press Enter ↵ → AI responds inline → Line is replaced with the response.
Examples
📚 Writing
/ai expand this idea into 3 paragraphs: [your text]
↓ Becomes: ↓
[AI-generated 3-paragraph expansion]
🧠 Brainstorming
/ai generate 5 blog post titles about productivity
📋 Summarizing
/ai summarize this in 2 sentences: [paste meeting notes]
🔄 Refactoring
/ai make this less wordy: The quick brown fox jumps over the lazy dog
🎨 Creative
/ai write a haiku about procrastination
📦 Submission Checklist
Before publishing to the Obsidian Community site, make sure:
manifest.jsonhas a uniqueidand does not contain "obsidian".- The repo root includes
README.md,LICENSE,manifest.json,main.js, andstyles.css. - Any file paths handled in code are passed through Obsidian's
normalizePath()for cross-platform safety. - The release tag matches the
versioninmanifest.json.
🔧 Setup by Provider
🦙 Ollama (Local, Private, Free) — Recommended for Privacy
Why choose Ollama?
- ✅ Runs on your machine (no data sent to cloud)
- ✅ Completely free
- ✅ Works offline
- ✅ Lightning fast
Setup (5 minutes):
- Install Ollama → Download from ollama.com
- Start Ollama:
ollama pull llama3.2 # or: mistral, phi3, neural-chat ollama serve - In Obsidian:
- Settings → Inline AI
- Provider: Ollama
- URL:
http://localhost:11434(default) - Model:
llama3.2
✅ Done! Try: /ai explain quantum computing
Models to try:
llama3.2— Balanced (fast + smart)mistral— Fastestphi3— Best for long contextneural-chat— Good reasoning
❓ Using WSL2? (Windows)
If Ollama runs in WSL and Obsidian on Windows:
# In WSL, start with:
OLLAMA_HOST=0.0.0.0 ollama serve
# Find WSL IP:
ip addr show eth0 | grep "inet "
# Copy the IP, e.g., 172.28.144.5
Then in Obsidian settings, use: http://172.28.144.5:11434
🤖 OpenAI ChatGPT — Best Quality
Why choose OpenAI?
- ✅ Highest quality responses
- ✅ Fast and reliable
- ✅ Large context window
- ✅ Latest models available
Setup (2 minutes):
-
Get API Key:
- Go to platform.openai.com/api/keys
- Create new secret key
- Copy it
-
In Obsidian:
- Settings → Inline AI
- Provider: OpenAI
- Paste your API key
- Model:
gpt-4o-mini(cheap) orgpt-4(premium)
✅ Done!
Cost estimate: ~$0.01 per prompt (very cheap)
💡 Pro tip: Use cheaper models
gpt-4o-mini— 95% as good, 10x cheaper ⭐gpt-4— Premium quality, higher costgpt-3.5-turbo— Older, less capable
Start with gpt-4o-mini.
🧠 Anthropic Claude — Best Reasoning
Why choose Claude?
- ✅ Excellent at long-form writing
- ✅ Better reasoning than GPT
- ✅ Good value for money
- ✅ Thoughtful responses
Setup (2 minutes):
-
Get API Key:
- Go to console.anthropic.com/keys
- Create new API key
- Copy it
-
In Obsidian:
- Settings → Inline AI
- Provider: Claude
- Paste your API key
- Model:
claude-3-5-sonnet-20241022
✅ Done!
✨ Google Gemini — Fastest + Free Tier
Why choose Gemini?
- ✅ Extremely fast
- ✅ Free tier available (no credit card needed initially)
- ✅ Good for quick queries
- ✅ Integrated with Google ecosystem
Setup (1 minute):
-
Get API Key:
- Go to aistudio.google.com
- Click "Get API Key"
- Create new API key
- Copy it
-
In Obsidian:
- Settings → Inline AI
- Provider: Gemini
- Paste your API key
- Model:
gemini-2.0-flash
✅ Done!
⚙️ Advanced Settings
| Setting | Options | Effect |
|---|---|---|
| System Prompt | Any text | Instructions always sent to the model (e.g., "Be concise") |
| Temperature | 0 — 1 | 0 = precise, 1 = creative. Default: 0.7 |
| Web Search | On/Off | Inject live web results into prompts |
| Search Engine | DuckDuckGo / Google | Which search to use (DuckDuckGo = no setup) |
🌐 Web Search (Optional)
Get live information in your prompts:
/ai what are the latest AI breakthroughs in 2024?
→ Plugin searches → Injects results → AI responds with current info
To enable:
- Settings → Inline AI → Toggle "Enable Web Search"
- Choose search engine:
- DuckDuckGo — Works instantly, no setup
- Google Custom Search — More thorough, requires API key
🎯 Real-World Use Cases
📖 Writer
/ai make this paragraph more engaging: [paste]
🧑💻 Developer
/ai explain what this code does: [paste code]
📚 Student
/ai create 5 study questions about photosynthesis
🧠 Researcher
/ai summarize this abstract and extract key findings: [paste]
📊 Analyst
/ai what trends do you see in this data: [paste data]
🎨 Designer
/ai generate 3 color palettes for a fintech app
🐛 Troubleshooting
| ❌ Problem | ✅ Solution |
|---|---|
| "Failed to fetch" | Ollama not running? Check http://localhost:11434 is accessible |
| API key rejected | Paste key again, check for spaces. Verify on provider's website |
| Nothing happens | Make sure you're in Edit mode, not Read mode |
| Slow first response | Normal! LLMs take time to start. Subsequent prompts are faster |
| Errors in console | Check Settings → About → Show debug info. Share logs in issues |
| Model not found (Ollama) | Run: ollama pull llama3.2 |
⌨️ Keyboard Shortcut
Don't have a command? Use the Ask AI command:
- Obsidian Command Palette (Ctrl+K / Cmd+K)
- Search "Ask AI"
- Press Enter
- Type your prompt
🔐 Privacy & Data
- Ollama: ✅ All processing local. No data leaves your machine.
- OpenAI/Claude/Gemini: Data sent to their servers per their privacy policies.
💡 Tips & Tricks
System Prompt Magic
Set a system prompt in Settings to customize AI behavior:
Example 1: You are a professional editor. Be concise but thorough.
Example 2: Output markdown formatted responses.
Example 3: Always explain your reasoning.
Temperature for Different Tasks
- 0.0 (Precise) → Summaries, facts, code
- 0.5 (Balanced) → General writing
- 1.0 (Creative) → Brainstorming, fiction
Combine with Web Search
/ai what happened in tech today?
(with web search enabled)
🤝 Contributing
Found a bug? Want a feature?
- Bug reports: Open an issue on GitHub
- Feature requests: Discuss in Discussions or issues
- Development: See Development section
📦 Development
Local Setup
git clone https://github.com/nitinvishway/Inline-AI.git
cd Inline-AI
npm install
npm run dev # Watch mode (rebuild on save)
Testing
- Copy
main.jsandmanifest.jsonto.obsidian/plugins/Inline-AI/ - Reload Obsidian (Ctrl+R / Cmd+R)
- Test changes in real-time
Hot Reload (Optional)
Install the Hot-Reload plugin for instant updates without restarting Obsidian.
📄 License
MIT — Use freely, modify, distribute.
❓ FAQ
Can I use multiple AI providers?
Not simultaneously, but you can switch anytime in Settings. Try one provider per use case!
What if my prompt is very long?
Works! But some models have context limits:
- Claude: 200K tokens (very generous)
- GPT-4: 128K tokens
- Gemini: 1M tokens
Ollama depends on your model.
Can I cancel a generation?
Currently: No, but it will stop when done. We're working on cancel buttons.
Does it work in mobile Obsidian?
Not yet. Desktop only for now.
Can I customize the /ai trigger?
Yes! In the code, search for /ai and change it. We're adding UI config soon.
🙌 Support
- Docs & Guides: This README
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Made with ❤️ for writers, thinkers, and builders.
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.