Obsidian Local LLM is a plugin for Obsidian that provides access to a powerful neural network, allowing users to generate text in a wide range of styles and formats using a local LLM from the LLAMA family.
The plugin allows users to input a prompt as a canvas block and receive answers in the new block. The LLM can be configured to use a variety of models and settings, allowing users to customize the output to their specific needs.
See gallery below.
The plugin uses a server from llama-cpp-python as the API backend, which relies on the llama.cpp library. The plugin also requires Python 3.7 or later and the pip package manager to be installed on your system.
To install llama-cpp-python and its dependencies, run the following command:
pip install llama-cpp-python[server]
Folow the link to the repository, click 'Show Table with models' and choose the model which is suitable for you and in the 'ggml' format.
For now, is available two ways how to install the plugin
Install using BRAT
- Install BRAT trough Community Plugins
- Open BRAT settings
- Click 'Add Beta plugin'
- Insert link to repository
- Click 'Add Plugin'
- Enable 'Obsidian Local LLM' plugin in Community Plugins
- Clone repository
git clone https://github.com/zatevakhin/obsidian-local-llm
- Change directory
cd obsidian-local-llm
- Install dependencies
npm install
- Build plugin
npm build
- Create
obsidian-local-llm
directory in your vault$HOME/MyObsidian/.obsidian/plugins
- Move
main.js
,manifest.json
, andstyles.css
into that directory - Open Obsidian > Settings > Community Plugins > Toggle Obsidian Local LLM
To use the plugin, follow these steps:
- Open a terminal
- Set environment variable with the ggml model path example:
export MODEL=/.../ggml-model-name.bin
- Run the API server using the command
python3 -m llama_cpp.server
- Don't close the terminal until you want to use the plugin
- Open a canvas in Obsidian
- Create a new block
- Type in a prompt text
- Use Right-click on the block to open a context menu
- Click on the "LLM Instruction" option
- Wait for the generated text to appear in the new block
obsidian-local-llm-canvas.mp4
obsidian-local-llm-canvas-typewriter.webm
Contributions to the plugin are welcome! If you would like to contribute, please fork the repository and submit a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.