jose-donato / ollama-reply

open-source browser extension that leverages the power of the AI to generate engaging replies for social media growth.
MIT License
218 stars 31 forks source link
browser-extension llama3 ollama tailwindcss

ollama-reply

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.

Features

Technologies

ollama-reply is a react-based browser extension built using the following technologies:

Getting Started

Prerequisites

Before you begin, ensure you have:

Installation Steps

  1. 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.
  2. Start Ollama Server:

    • ⚠️ Ensure you set the environment variable OLLAMA_ORIGINS=* ollama serve to allow calls from the browser extension.
  3. Download the Repository:

    • Download the ollama-reply repository from GitHub.
  4. Unzip the Repository:

    • Unzip the downloaded repository to a desired location on your computer.
  5. 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.

Usage

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.

Configuration

Model Selection

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.

Prompt Configuration

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.

Development

This project uses @samrum/vite-plugin-web-extension. Refer to the plugin documentation for more information.

Project Setup

npm install

Commands

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

Development, Watch

Rebuilds extension on file changes. Requires a reload of the extension (and page reload if using content scripts)

npm run watch

Production

Minifies and optimizes extension build

npm run build

Load extension in browser

Loads the contents of the dist directory into the specified browser

npm run serve:chrome
npm run serve:firefox

Contributing

Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

License

Distributed under the MIT License. See LICENSE for more information.

Acknowledgments