Disclaimer: While I generally do not advocate for the use of automated tools for social media interactions, as they can reduce genuine human engagement, I wanted to build ollama-reply as an experiment. It was an opportunity to explore the capabilities of Ollama and dive into browser extensions.
ollama-reply is an open-source browser extension that leverages the power of the Ollama Llama3 model to generate engaging replies for social media growth. This tool is designed as a free and open alternative to MagicReply.
- Open Source 📖: Freely modify and distribute the code.
- Powerful AI 🧠: Uses the Ollama Llama3 model for generating replies.
- Browser Extension 🌐: Easy to use directly in your chromium browser.
- Customizable ⚙️: Configurable to use any ollama model and adapt the answers to your needs
- Free 💸: No cost to download and use the extension.
ollama-reply is a react-based browser extension built using the following technologies:
Before you begin, ensure you have:
- A Chromium based Browser
- Ollama installed - download here
-
Pull the AI Model:
- Use the command
ollama pull llama3:8b
to download the Llama3 model. You can also use other models if you prefer. See Configuration for more information.
- Use the command
-
Start Ollama Server:
⚠️ Ensure you set the environment variableOLLAMA_ORIGINS=* ollama serve
to allow calls from the browser extension.
-
Download the Repository:
- Download the ollama-reply repository from GitHub.
-
Unzip the Repository:
- Unzip the downloaded repository to a desired location on your computer.
-
Load the Extension:
- Open Google Chrome (or other chromium browser) and navigate to
chrome://extensions/
. - Enable Developer Mode by toggling the switch at the top-right.
- Click on "Load unpacked" and select the
dist
folder inside the unzipped folder of this repository.
- Open Google Chrome (or other chromium browser) and navigate to
Once installed, navigate to any post on Twitter or LinkedIn, and you will see an additional button labeled "Generate Reply". Clicking this button will use the Ollama Llama3 model to generate a contextually relevant reply.
By default the extension uses the llama3:8b
model. You can change this by pulling the model you want from ollama and updating the MODEL
variable in the src/entries/background/main.ts
file. You will need to rebuild the extension after changing the model.
You can configure the answers generated by the extension by updating the SYSTEM_PROMPT
variable in the src/entries/background/main.ts
file. This variable is used as the prompt for the Ollama model. You will need to rebuild the extension after changing the prompt.
This project uses @samrum/vite-plugin-web-extension. Refer to the plugin documentation for more information.
npm install
Hot Module Reloading is used to load changes inline without requiring extension rebuilds and extension/page reloads Currently only works in Chromium based browsers.
npm run dev
Rebuilds extension on file changes. Requires a reload of the extension (and page reload if using content scripts)
npm run watch
Minifies and optimizes extension build
npm run build
Loads the contents of the dist directory into the specified browser
npm run serve:chrome
npm run serve:firefox
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
- Inspired by MagicReply
- @samrum/vite-plugin-web-extension
- Ollama