No description
Find a file
2023-11-07 19:51:25 -08:00
.github Create FUNDING.yml (#45) 2023-05-30 11:14:28 -07:00
images Patch 2.4.1 (#124) 2023-08-08 00:41:32 -07:00
src v2.4.4: Add new GPT-4 TURBO model (#182) 2023-11-07 19:51:25 -08:00
typings Add correct implementation of sse and stopStreaming 2023-04-21 20:40:53 -07:00
.editorconfig Initial commit 2023-03-30 17:15:32 -07:00
.eslintignore Initial commit 2023-03-30 17:15:32 -07:00
.eslintrc Initial commit 2023-03-30 17:15:32 -07:00
.gitignore Initial commit 2023-03-30 17:15:32 -07:00
.npmrc Initial commit 2023-03-30 17:15:32 -07:00
esbuild.config.mjs Migrate to LangChainJS (#17) 2023-05-16 14:52:45 -07:00
jest.config.js Add tests for chat context 2023-04-08 22:57:45 -07:00
LICENSE Add license 2023-03-30 23:52:55 -07:00
localai_setup.md Remove proxy server for LocalAI (#123) 2023-08-07 23:15:00 -07:00
manifest.json v2.4.4: Add new GPT-4 TURBO model (#182) 2023-11-07 19:51:25 -08:00
package-lock.json v2.4.4: Add new GPT-4 TURBO model (#182) 2023-11-07 19:51:25 -08:00
package.json v2.4.4: Add new GPT-4 TURBO model (#182) 2023-11-07 19:51:25 -08:00
README.md Update readme v2.4.2 (#127) 2023-08-10 17:25:04 -07:00
styles.css Fix system prompt and AI chat font size (#107) 2023-07-12 16:54:57 -07:00
tsconfig.json Remove fetch and use SSE instead 2023-04-20 20:30:14 -07:00
version-bump.mjs Initial commit 2023-03-30 17:15:32 -07:00
versions.json v2.4.4: Add new GPT-4 TURBO model (#182) 2023-11-07 19:51:25 -08:00
wasmPlugin.mjs Migrate to LangChainJS (#17) 2023-05-16 14:52:45 -07:00

🔍 Copilot for Obsidian

GitHub release (latest SemVer) Obsidian Downloads

Copilot for Obsidian is a free and open-source ChatGPT interface right inside Obsidian. It has a minimalistic design and is straightforward to use.

  • 💬 ChatGPT UI in Obsidian.
  • 🛠️ Prompt AI with your writing using Copilot commands to get quick results.
  • 🚀 Turbocharge your Second Brain with AI.
  • 🧠 Talk to your past notes for insights.

My goal is to make this AI assistant local-first and privacy-focused. It has a local vector store and can work with local models for chat and QA completely offline! More features are under construction. Stay tuned!

UI

🛠️ Features

  • Chat with ChatGPT right inside Obsidian in the Copilot Chat window.
  • No repetitive login. Use your own API key (stored locally).
  • No monthly fee. Pay only for what you use.
  • Model selection of OpenAI, Azure and local models powered by LocalAI.
  • No need to buy ChatGPT Plus to use GPT-4.
  • No usage cap for GPT-4 like ChatGPT Plus.
  • One-click copying any message as markdown.
  • One-click saving the entire conversation as a note.
  • Use the active note as context, and start a discussion around it by switching to "QA: Active Note" in the Mode Selection menu.
    • This feature is powered by retrieval augmentation with a local vector store. No sending your data to a cloud-based vector search service!
  • Easy commands to simplify, emojify, summarize, translate, change tone, fix grammar, rewrite into a tweet/thread, count tokens and more.
  • Set your own parameters like LLM temperature, max tokens, conversation context based on your need (pls be mindful of the API cost).
  • User custom prompt! You can add, apply, edit, delete your custom prompts, persisted in your local Obsidian environment! Be creative with your own prompt templates, sky is the limit!
  • Local model support for offline chat and QA using LocalAI. Talk to your notes without internet! (experimental feature)

🎬 Video Demos

🎉 NEW in v2.4.0: Local Copilot! No internet required!! 🎉

Please make sure you go through this Step-by-step setup guide to setup Local Copilot on your device correctly!

I've got feedback about "Use Local Copilot" toggle being unnecesary, so it is removed in v2.4.1. Now, make sure your have --cors flag enabled in your LocalAI server (or .env CORS=true if you use Docker). Then simply fill in the OpenAI Proxy Base URL as "http://localhost:8080/v1" and restart the plugin to chat with your local models.

When you are done, clear the OpenAI Proxy Base URL to switch back to non-local models.

🤗 New to Copilot? Quick Guide for Beginners:

  • Chat with ChatGPT, copy messages to note, save entire conversation as a note
  • QA around your past note
  • Fix grammar and spelling, Summarize, Simplify, Emojify, Remove URLs
  • Generate glossary, table of contents
  • Translate to a language of your choosing
  • Change tone: professional, casual, straightforward, confident, friendly
  • Make longer/shorter
  • Rewrite into a tweet/thread

💬 User Custom Prompt: Create as Many Copilot Commands as You Like!

You can add, apply, edit and delete your own custom Copilot commands, all persisted in your local Obsidian environment! Check out this demo video below!

🔧 Copilot Settings

The settings page lets you set your own temperature, max tokens, conversation context based on your need.

New models will be added as I get access.

You can also use your own system prompt, choose between different embedding providers such as OpenAI, CohereAI (their trial API is free and quite stable!) and Huggingface Inference API (free but sometimes times out).

⚙️ Installation

Copilot for Obsidian is now available in Obsidian Community Plugin!

  • Open Community Plugins settings page, click on the Browse button.
  • Search for "Copilot" in the search bar and find the plugin with this exact name.
  • Click on the Install button.
  • Once the installation is complete, enable the Copilot plugin by toggling on its switch in the Community Plugins settings page.

Now you can see the chat icon in your leftside ribbon, clicking on it will open the chat panel on the right! Don't forget to check out the Copilot commands available in the commands palette!

⛓️ Manual Installation

  • Go to the latest release
  • Download main.js, manifest.json, styles.css and put them under .obsidian/plugins/obsidian-copilot/ in your vault
  • Open your Obsidian settings > Community plugins, and turn on Copilot.

🔔 Note

  • The chat history is not saved by default. Please use "Save as Note" to save it. The note will have a title Chat-Year_Month_Day-Hour_Minute_Second, you can change its name as needed.
  • "New Chat" clears all previous chat history. Again, please use "Save as Note" if you would like to save the chat.
  • "Use Active Note as Context" creates a local vector index for the active note so that you can chat with super long note! To start the QA, please switch from "Conversation" to "QA: Active Note" in the Mode Selection dropdown.
  • You can set a very long context in the setting "Conversation turns in context" if needed.

📣 Again, please always be mindful of the API cost if you use GPT-4 with a long context!

🤔 FAQ (please read before submitting an issue)

It's not using my note as context
  • Please don't forget to switch to "QA: Active Note" in the Mode Selection dropdown in order to start the QA. Copilot does not have your note as context in "Conversation" mode. Settings
  • In fact, you don't have to click the button on the right before starting the QA. Switching to QA mode in the dropdown directly is enough for Copilot to read the note as context. The button on the right is only for when you'd like to manually rebuild the index for the active note, like, when you'd like to switch context to another note, or you think the current index is corrupted because you switched the embedding provider, etc.
  • Reference issue: https://github.com/logancyang/obsidian-copilot/issues/51
Unresponsive QA when using Huggingface as the Embedding Provider
  • Huggingface Inference API is free to use. It can give errors such as 503 or 504 frequently at times because their server has issues. If it's an issue for you, please consider using OpenAI or CohereAI as the embedding provider. Just keep in mind that OpenAI costs more, especially with very long notes as context.
"model_not_found"
"insufficient_quota"
"context_length_exceeded"
  • GPT-3.5 has a 4096 context token limit, GPT-4 has 8K (there is a 32K one available to the public soon per OpenAI). So if you set a big token limit in your Copilot setting, you could get this error. Note that the prompts behind the scenes for Copilot commands can also take up tokens, so please limit your message length and max tokens to avoid this error. (For QA with Unlimited Context, use the "QA: Active Note" chain in the dropdown! Requires Copilot v2.1.0.)
  • Reference issue: https://github.com/logancyang/obsidian-copilot/issues/1#issuecomment-1542934569
Azure issue
  • It's a bit tricky to get all Azure credentials right in the first try. My suggestion is to use curl to test in your terminal first, make sure it gets response back, and then set the correct params in Copilot settings. Example:
    curl https://YOUR_RESOURCE_NAME.openai.azure.com/openai/deployments/YOUR_DEPLOYMENT_NAME/completions?api-version=VERSION\
      -H "Content-Type: application/json" \
      -H "api-key: YOUR_API_KEY" \
      -d "{
      \"prompt\": \"Once upon a time\",
      \"max_tokens\": 5
    }"
    
  • Reference issue: https://github.com/logancyang/obsidian-copilot/issues/98

When opening an issue, please include relevant console logs. You can go to Copilot's settings and turn on "Debug mode" at the bottom for more console messages!

📝 Planned features (based on feedback)

  • Support embedded PDFs as context
  • Integration with ElevenLabs or Bark to let the AI speak like human
  • Unlimited context for a collection of notes.
  • Retrieval augmented generation (RAG) with your vault. Explore, brainstorm and review ideas like never before!

🙏 Say Thank You

If you are enjoying Copilot, please support my work by buying me a coffee here: https://www.buymeacoffee.com/logancyang

Buy Me A Coffee

Please also help spread the word by sharing about the Copilot for Obsidian Plugin on Twitter, Reddit, or any other social media platform you use.

You can find me on Twitter @logancyang.