Skip to main content

Local AI agent with Discord/Telegram, Google Workspace, and payments - powered by Ollama

Project description

๐Ÿ•Š๏ธ Local Pigeon

  _                     _   ____  _                       
 | |    ___   ___ __ _| | |  _ \(_) __ _  ___  ___  _ __  
 | |   / _ \ / __/ _` | | | |_) | |/ _` |/ _ \/ _ \| '_ \ 
 | |__| (_) | (_| (_| | | |  __/| | (_| |  __/ (_) | | | |
 |_____\___/ \___\__,_|_| |_|   |_|\__, |\___|\___/|_| |_|
                                   |___/                  

A fully local AI agent powered by Ollama (or llama-cpp-python). Your AI assistant that runs entirely on your device, connecting to Discord, Telegram, or a web interface while keeping all LLM inference local and private.

PyPI version Python 3.10+ License: MIT

โœจ Features

  • ๐Ÿง  Local LLM Inference - Uses Ollama for on-device model inference
  • ๐Ÿ” Privacy First - Your conversations never leave your device
  • ๐Ÿ’ฌ Multi-Platform - Discord, Telegram, and Web UI support
  • ๐Ÿ”ง Extensible Tools - Web search, browser automation, and more
  • ๐ŸŒ Browser Automation - Navigate dynamic websites (Google Flights, etc.)
  • ๐ŸŽค Voice Input - Speech-to-text for hands-free interaction
  • ๐Ÿ“ง Google Workspace - Gmail, Calendar, and Drive integration
  • ๐Ÿ’ณ Payment Capabilities - Stripe virtual cards and crypto (USDC/ETH)
  • โœ… Human-in-the-Loop - Approval workflow for sensitive operations
  • ๐Ÿ“Š Activity Dashboard - Track interactions across all platforms
  • ๐Ÿš€ Easy Setup - One-command installation

๐Ÿ“‹ Prerequisites

  • Python 3.10+ (Download)
  • Ollama (Download) - or Local Pigeon can auto-download models via llama-cpp-python
  • A supported LLM model (e.g., gemma3, llama3.2, qwen2.5)

๐Ÿš€ Quick Start

Option 1: Auto-Installer (Recommended)

Windows (PowerShell):

irm https://raw.githubusercontent.com/tradermichael/local_pigeon/main/install.ps1 | iex

Mac/Linux:

curl -sSL https://raw.githubusercontent.com/tradermichael/local_pigeon/main/install.sh | bash

Option 2: pip Install

pip install local-pigeon

# Optional features:
pip install local-pigeon[browser]  # Browser automation (Playwright)
pip install local-pigeon[voice]    # Voice input (Speech Recognition)
pip install local-pigeon[all]      # Everything

Option 3: From Source

git clone https://github.com/tradermichael/local_pigeon.git
cd local_pigeon
pip install -e .

Option 4: Docker

docker-compose up -d

โš™๏ธ Configuration

1. Set up Ollama (or skip for auto-download)

If you have Ollama installed, make sure it's running:

# Start Ollama (if not running)
ollama serve

# Pull a model
ollama pull gemma3:latest

No Ollama? Local Pigeon will automatically fall back to llama-cpp-python and download a model from HuggingFace on first run.

2. Configure Local Pigeon

Run the setup wizard:

local-pigeon setup

Or manually create a .env file:

# Ollama
OLLAMA_HOST=http://localhost:11434
OLLAMA_MODEL=gemma3:latest

# Discord (optional)
DISCORD_BOT_TOKEN=your_discord_bot_token

# Telegram (optional)
TELEGRAM_BOT_TOKEN=your_telegram_bot_token

# Google Workspace (optional)
GOOGLE_CLIENT_ID=your_client_id
GOOGLE_CLIENT_SECRET=your_client_secret

# Browser automation (optional)
BROWSER_ENABLED=true
BROWSER_HEADLESS=true  # false to see browser window

# Payments (optional)
STRIPE_API_KEY=sk_...
PAYMENT_APPROVAL_THRESHOLD=25.00

3. Run Local Pigeon

# Start all enabled platforms
local-pigeon run

# Or run specific platform
local-pigeon run --platform discord
local-pigeon run --platform telegram
local-pigeon run --platform web

๐Ÿ’ฌ Platforms

Discord Bot

  1. Create a bot at Discord Developer Portal
  2. Enable "Message Content Intent" under Bot settings
  3. Copy the bot token to your .env
  4. Invite the bot to your server with appropriate permissions

Features:

  • Responds to mentions and DMs
  • Streaming responses with message edits
  • Slash commands: /model, /clear, /status
  • Payment approval via DM

Telegram Bot

  1. Create a bot via @BotFather
  2. Copy the bot token to your .env
  3. Optionally set TELEGRAM_ALLOWED_USERS to restrict access

Features:

  • Message handling with user whitelist
  • Streaming responses
  • Commands: /model, /clear, /status
  • Inline keyboard for payment approvals

Web UI

Access at http://localhost:7860 when running with --platform web.

Features:

  • Chat interface with streaming
  • Voice input (microphone)
  • Activity log across all platforms
  • Settings panel
  • OAuth setup for Google
  • Tool execution display

๐Ÿงฐ Tools

Web Tools

  • Web Search - Search using DuckDuckGo
  • Web Fetch - Extract content from web pages
  • Browser - Full browser automation (Playwright)
  • Browser Search - Specialized search tasks (Google Flights, etc.)

Google Workspace

  • Gmail - Read, search, and send emails
  • Calendar - View and create events
  • Drive - List, search, and read files

Payments

  • Stripe Card - Virtual card for online payments
  • Crypto Wallet - USDC/ETH on Base network

Discord Tools

  • Send Messages - Post to channels
  • Send DMs - Direct message users
  • Get Messages - Read channel history
  • Add Reactions - React to messages
  • List Channels - See available channels
  • Create Threads - Start discussion threads

๐Ÿ’ณ Payment System

Local Pigeon supports both traditional and crypto payments:

Stripe Virtual Cards

  • Create virtual cards for online purchases
  • Real-time transaction monitoring
  • Human-in-the-loop approval for amounts above threshold

Crypto Wallet (CDP)

  • USDC and ETH support on Base network
  • Send and receive payments
  • Approval workflow for security

Approval Workflow

Payments above your configured threshold (default: $25) require approval:

  1. Agent requests payment
  2. You receive approval request (Discord DM, Telegram message, or Web UI)
  3. Approve or deny within 5 minutes
  4. Payment proceeds or is cancelled

Configure threshold:

PAYMENT_APPROVAL_THRESHOLD=25.00

๐Ÿ” Security

  • Local Processing - LLM runs on your device via Ollama
  • Encrypted Storage - OAuth tokens encrypted at rest
  • Human Approval - Sensitive operations require confirmation
  • User Whitelist - Restrict bot access to specific users

๐Ÿ“ Project Structure

local_pigeon/
โ”œโ”€โ”€ src/
โ”‚   โ””โ”€โ”€ local_pigeon/
โ”‚       โ”œโ”€โ”€ core/           # Agent, LLM client, conversation
โ”‚       โ”œโ”€โ”€ platforms/      # Discord, Telegram adapters
โ”‚       โ”œโ”€โ”€ tools/          # Web, Google, Payment, Discord tools
โ”‚       โ”‚   โ”œโ”€โ”€ web/        # Search, fetch, browser automation
โ”‚       โ”‚   โ”œโ”€โ”€ google/     # Gmail, Calendar, Drive
โ”‚       โ”‚   โ”œโ”€โ”€ discord/    # Discord action tools
โ”‚       โ”‚   โ””โ”€โ”€ payments/   # Stripe, crypto wallet
โ”‚       โ”œโ”€โ”€ storage/        # Database, credentials
โ”‚       โ”œโ”€โ”€ ui/             # Gradio web interface
โ”‚       โ”œโ”€โ”€ config.py       # Configuration management
โ”‚       โ””โ”€โ”€ cli.py          # Command-line interface
โ”œโ”€โ”€ config.yaml             # YAML configuration
โ”œโ”€โ”€ .env.example            # Environment template
โ”œโ”€โ”€ install.ps1             # Windows installer
โ”œโ”€โ”€ install.sh              # Mac/Linux installer
โ”œโ”€โ”€ Dockerfile              # Docker build
โ””โ”€โ”€ docker-compose.yml      # Docker orchestration

๐Ÿ› ๏ธ Development

Setup Development Environment

git clone https://github.com/tradermichael/local_pigeon.git
cd local_pigeon
pip install -e ".[dev]"

Run Tests

pytest

Code Style

ruff check .
ruff format .

๐Ÿ“ Commands Reference

# Run the agent
local-pigeon run [--platform discord|telegram|web]

# Interactive setup wizard
local-pigeon setup

# Check system status
local-pigeon status

# List available models
local-pigeon models

# Interactive chat (terminal)
local-pigeon chat

# Show version
local-pigeon version

๐Ÿค Contributing

Contributions are welcome! Please read our contributing guidelines.

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

๐Ÿ“„ License

MIT License - see LICENSE for details.

๐Ÿ™ Acknowledgments


Made with โค๏ธ for local-first AI

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

local_pigeon-0.3.0.tar.gz (86.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

local_pigeon-0.3.0-py3-none-any.whl (110.3 kB view details)

Uploaded Python 3

File details

Details for the file local_pigeon-0.3.0.tar.gz.

File metadata

  • Download URL: local_pigeon-0.3.0.tar.gz
  • Upload date:
  • Size: 86.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for local_pigeon-0.3.0.tar.gz
Algorithm Hash digest
SHA256 a26a9e681debd7043f3ebd12188920ddc736446e55cd941041e5d036997f0509
MD5 10ce761f520564a4a57433eb9996f990
BLAKE2b-256 51749586edcfb8d36ef307507daa18d716148bd292c0da84b3f314fdf35bbad5

See more details on using hashes here.

File details

Details for the file local_pigeon-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: local_pigeon-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 110.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for local_pigeon-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fb5fbf0f96e4f0ff260ea847415bbd72c333d1ff7d9803e22c83e5ebf5498112
MD5 bfdcd7528658d36b5de3307e56eb0147
BLAKE2b-256 11dce815eaed4db928cd629a8cbcd887c082ac5fa0376387a7145f83878c8d54

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page