https://github.com/codecat1111/local-ai-assistant
A local AI assistant that seamlessly integrates on-device AI models like DeepSeek with web browsers such as Chrome via extensions. It enables privacy-focused, real-time AI interactions without relying on cloud-based services.
https://github.com/codecat1111/local-ai-assistant
deepseek-r1 extension-chrome ollama
Last synced: 2 months ago
JSON representation
A local AI assistant that seamlessly integrates on-device AI models like DeepSeek with web browsers such as Chrome via extensions. It enables privacy-focused, real-time AI interactions without relying on cloud-based services.
- Host: GitHub
- URL: https://github.com/codecat1111/local-ai-assistant
- Owner: codecat1111
- License: mit
- Created: 2025-02-22T09:08:01.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-05-31T05:35:14.000Z (about 1 year ago)
- Last Synced: 2025-12-06T23:07:38.240Z (6 months ago)
- Topics: deepseek-r1, extension-chrome, ollama
- Language: JavaScript
- Homepage:
- Size: 392 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Local AI Assistant - Chrome Extension β¨π₯οΈπ
## Why This is Powerful π‘ππ
This AI-powered Chrome extension leverages a locally hosted model, eliminating API costs, reliance on external servers, and privacy concerns. Unlike cloud-based solutions, this approach ensures complete data security while offering seamless functionality.
Additionally, models such as DeepSeek, Mistral, and LLaMA can also be run locally, offering flexibility in choosing the best AI model for specific tasks. These models vary in size and capability, allowing users to optimize performance based on their hardware while still benefiting from a fully offline, privacy-focused AI assistant. You control the AI, ensuring reliability and performance without third-party interference. πβ‘π
## Setting Up Ollama π οΈπ§
Before running the extension, follow these steps to configure Ollama properly:
1. **Install Ollama** from the official [Ollama website](https://ollama.ai/).
2. **Download the model** you want to use (default: 300M parameters for optimal performance on most laptops). You can find official instructions for downloading and installing models in the [Ollama documentation](https://github.com/ollama/ollama/blob/main/README.md#model-library).
3. **Configure Ollama to Accept Chrome Requests:**
- Open Windows PowerShell and execute:
```powershell
ollama stop # Stops Ollama if running
$env:OLLAMA_ORIGINS="chrome-extension://*"
$env:OLLAMA_HOST="0.0.0.0"
```
4. **Start Ollama again** by running the following command in Windows PowerShell (For future use, you only need to run this command to start Ollama):
```powershell
ollama serve
```
This will launch the Ollama server and allow the Chrome extension to communicate with it. Ensure the server remains running to avoid `403 Forbidden` errors.
5. **Keep the server running** in PowerShell to prevent a `403 Forbidden` error.
## Installation π οΈπ₯π§
1. Clone the repository:
```bash
git clone https://github.com/codecat1111/local-ai-assistant.git
cd ai-text-assistant
```
2. Ensure that Ollama is installed and operational.
3. Navigate to `chrome://extensions/` in Google Chrome.
4. Enable **Developer Mode** from the upper-right corner.
5. Click **Load unpacked** and specify the `ai-text-assistant` directory. βοΈπβ
6. **Reload the extension and refresh the webpage** where you plan to use it.
## Usage π±οΈππ
1. Select a segment of text within any active webpage.
2. Launch the extension from the Chrome toolbar.
3. Choose from one of the available analytical modes: Grammar Check, Code Review, Text Summarization, Social Media Post Generation, or General Text-Based Queries.
4. Examine the processed output within an inline popup or an independent browser window. πππ
## System Architecture ποΈππ οΈ
This extension comprises multiple modular components:
- **background.js**: Orchestrates communication with the Ollama model and manages asynchronous task execution.
- **content.js**: Captures and transmits user-selected textual data from web pages.
- **popup.js**: Implements the interactive graphical user interface.
- **response.js**: Formats and displays the computational output returned by the AI model.
- **manifest.json**: Configures essential permissions, runtime behaviors, and metadata for Chrome extension deployment.
A Use-Case Diagram showing how the system works
## API Reference π‘ππ
### `queryOllama(prompt, model)`
Facilitates communication with the locally hosted Ollama API for text analysis and transformation. π€ππ
```javascript
async function queryOllama(prompt, model = "qwen2.5:0.5b")
```
- **Parameters:**
- `prompt` (string): The textual input to be processed by the model.
- `model` (string, optional): The computational model variant to be utilized (default: `qwen2.5:0.5b`).
- **Returns:** A structured response containing AI-generated textual output. π¬ππ¬
## Screenshots & Demo π₯πΌοΈ
[**YouTube Demo Link(coming soon!)**](#)
Screenshots: πΈπ₯οΈπ
1. Extension UI
Extension UI
2. Commands to run to start allow communication between Ollama and Chrome (or any browser)
Commands to run to start allow communication between Ollama and Chrome (or any browser)
3. A Summarize Feature in use
A Summarize Feature in use
4. Server Side Logs
Server Side Logs
## Contribution Guidelines βοΈππ€
1. Fork the repository to your personal GitHub account.
2. Create a dedicated feature branch for modifications:
```bash
git checkout -b feature-name
```
3. Commit the changes and push to your forked repository:
```bash
git commit -m "Implemented feature enhancements"
git push origin feature-name
```
4. Submit a pull request for review and integration. ποΈπ’β
## Licensing πβοΈπ
This software is distributed under the MIT License. πππ‘οΈ
## β Found It Helpful? [Star It!](https://github.com/codecat1111/local-ai-assistant/stargazers)
If you found this project helpful, let the community know by giving it a [star](https://github.com/codecat1111/local-ai-assistant/stargazers): [πβ](https://github.com/codecat1111/local-ai-assistant/stargazers)
---
For inquiries, feature requests, or to report issues, please utilize the GitHub issue tracking system or contribute via pull requests. π¬π’π©