Thanks to visit codestin.com
Credit goes to github.com

Skip to content

b7s/purr-ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

73 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

PurrAI

{PurrAI}

Your adorable AI companion living in your machine

Laravel NativePHP Alpine.js Tailwind CSS License

Features โ€ข Installation โ€ข Usage โ€ข Configuration โ€ข Tech Stack

๐ŸŒŸ Overview

PurrAI is a lightweight, cross-platform desktop application that brings the power of AI to your fingertips. With a cute black kitten mascot living in your system's, you can instantly access AI assistance for any task - from answering questions to analyzing images and documents.

Built with modern web technologies and packaged as a native application, PurrAI runs seamlessly on Linux, Windows, and macOS while maintaining a minimal footprint.


โœจ Features

๐ŸŽฏ Core Capabilities

  • ๐Ÿ”‘ Multi-Provider Support - Configure multiple AI providers (OpenAI, Anthropic, Ollama, etc.)
  • ๐Ÿ’ฌ Intelligent Chat Interface - Natural conversation with AI powered by PrismPHP
  • ๐ŸŽ™๏ธ Audio detection - Speak by voice, use it completely locally with LaravelWhisper or online service.
  • ๐Ÿ“Ž Document Attachment - Upload and analyze documents of any type (past, drag and drop, etc.)
  • ๐Ÿ“ Text Analysis - Analyze text from any source.
  • ๐Ÿ–ผ๏ธ Image Analysis - Paste images for AI processing
  • ๐Ÿ–ฅ๏ธ System access - Search or list files and ask about them (or use dangerous commands like delete, move, rename - if you give the right permissions in the "Danger" area in Settings)
  • ๐Ÿ’พ Conversation History - All chats saved locally in SQLite with search
  • ๐ŸŒ“ Dark/Light Mode - Beautiful interface that adapts to your system theme
  • ๐Ÿ”’ Privacy-Focused - Local Ollama models and LaravelWhisper (for audio) run in your system without exposing your data
  • ๐ŸŒ i18n Support - Available in multiple languages (en, pt, es,)

๐Ÿš€ Installation

Prerequisites

  • PHP 8.4+
  • Composer
  • Node.js 18+ & npm 10+
  • SQLite

Setup

# Clone the repository
git clone https://github.com/b7s/purr-ai.git

cd purrai

# Install PHP dependencies
composer install

# Install JavaScript dependencies
npm install

# Copy environment file
cp .env.example .env

# Publishing the Electron project
php artisan native:install --publish

Fix Linux Permissions for production

After run native:install, add "afterInstall" to your nativephp/electron/electron-builder.mjs (if "deb" not exists, add it after "linux"):

   linux: {
   /*...*/
   },
   deb: {
      afterInstall: join(
         process.env.APP_PATH,
         "scripts",
         "fix-permission-linux-app-after-install.tpl",
      ),
   },

It will attempt to correct permission issues when installing the builded app in "/opt".

Attention: Whenever you update the project (composer update), the files in "nativephp" will be overwritten and you will need to add the script again.


๐ŸŽฎ Usage

Starting the Application

# Development mode
composer native:dev

# Production build
php artisan native:build

Linux permissions for development

Ensure the correct privileges for Electron while performing your tests. Use the command:

bash scripts/fix-electron-sandbox.sh

Make the file executable before running it: chmod +x scripts/fix-electron-sandbox.sh. Sometimes you will need to run this command again as permissions may be lost after updating the project.

First Time Setup

  1. Click the kitten icon in your menu bar
  2. Navigate to Settings (โš™๏ธ)
  3. Add your AI provider API keys:
    • OpenAI
    • Anthropic Claude
    • Google Gemini
    • Or configure local Ollama
  4. Audio detection if you wish

Linux Installation from .deb Package

If you're installing PurrAI from a .deb package and encounter a sandbox error, run these commands after installation:

# Fix chrome-sandbox permissions
sudo chown root:root /opt/PurrAI/chrome-sandbox
sudo chmod 4755 /opt/PurrAI/chrome-sandbox

# Verify permissions (should show -rwsr-xr-x)
ls -la /opt/PurrAI/chrome-sandbox

# Launch PurrAI
purrai

Why is this needed? The Electron chrome-sandbox requires SUID permissions to run securely. Due to build system limitations, these permissions must be set manually after installation.

Using the Assistant

  1. Start a conversation - Type your question in the input box
  2. Attach files - Click the attachment icon to upload documents
  3. Paste images - Use Ctrl+V (Cmd+V on Mac) to paste screenshots
  4. View history - Click the history dropdown to browse past conversations
  5. New chat - Click the new chat button to start fresh

โš™๏ธ Configuration

AI Provider Setup

Navigate to Settings to configure your preferred AI providers:

// Supported providers via PrismPHP
- OpenAI (GPT)
- Anthropic (Claude)
- Google (Gemini)
- Ollama (Local models)
- And more...

Local Ollama Setup

For privacy-focused users, configure Ollama to run AI models locally:

  1. Install Ollama
  2. Pull your preferred model: ollama pull llama2
  3. Add Ollama endpoint in Settings
  4. Select local model in chat

๐Ÿ› ๏ธ Tech Stack (๐Ÿ™ Acknowledgments)

Backend

Frontend

  • Alpine.js 3 - Minimal JavaScript framework
  • Tailwind CSS 4 - Utility-first CSS with Glassmorphism style
  • Iconoir - Beautiful open-source icon library (CSS)
  • Blade Templates - Laravel's templating engine

Native Application


๐Ÿงช Tests

composer test

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

๐Ÿ“ License

This project is licensed under the MIT License - see the LICENSE file for details.


Made with โค๏ธ and ๐Ÿฑ by Bruno

Report Bug โ€ข Request Feature

About

Your adorable AI companion living in your machine

Resources

Stars

Watchers

Forks