Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

33 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

✨ 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:

  1. Prepare the repo root with manifest.json, README.md, and LICENSE.
  2. Cut a release by bumping the version in manifest.json, tagging a matching GitHub release, and attaching main.js, manifest.json, and styles.css.
  3. 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:

  1. manifest.json has a unique id and does not contain "obsidian".
  2. The repo root includes README.md, LICENSE, manifest.json, main.js, and styles.css.
  3. Any file paths handled in code are passed through Obsidian's normalizePath() for cross-platform safety.
  4. The release tag matches the version in manifest.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):

  1. Install Ollama β†’ Download from ollama.com
  2. Start Ollama:
    ollama pull llama3.2  # or: mistral, phi3, neural-chat
    ollama serve
  3. 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 β€” Fastest
  • phi3 β€” Best for long context
  • neural-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):

  1. Get API Key:

  2. In Obsidian:

    • Settings β†’ Inline AI
    • Provider: OpenAI
    • Paste your API key
    • Model: gpt-4o-mini (cheap) or gpt-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 cost
  • gpt-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):

  1. Get API Key:

  2. 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):

  1. Get API Key:

  2. 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:

  1. Settings β†’ Inline AI β†’ Toggle "Enable Web Search"
  2. 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:

  1. Obsidian Command Palette (Ctrl+K / Cmd+K)
  2. Search "Ask AI"
  3. Press Enter
  4. 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

  1. Copy main.js and manifest.json to .obsidian/plugins/Inline-AI/
  2. Reload Obsidian (Ctrl+R / Cmd+R)
  3. 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


Made with ❀️ for writers, thinkers, and builders.

About

Type /ai <your prompt> anywhere in a note, press Enter, and your local Ollama model streams a response directly into the note replacing the trigger line.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages