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.

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, file operations, and more
  • ๐Ÿ“ง 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
  • ๐Ÿš€ 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

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

# 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
  • Settings panel
  • OAuth setup for Google
  • Tool execution display

๐Ÿงฐ Tools

Web Tools

  • Web Search - Search using DuckDuckGo
  • Web Fetch - Extract content from web pages

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

๐Ÿ’ณ 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 tools
โ”‚       โ”œโ”€โ”€ 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.2.0.tar.gz (76.4 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.2.0-py3-none-any.whl (98.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: local_pigeon-0.2.0.tar.gz
  • Upload date:
  • Size: 76.4 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.2.0.tar.gz
Algorithm Hash digest
SHA256 6b59a8fbb911c939be0b35b1514e61567aa7d8941920327d213bf638065c165a
MD5 a60907334f63b9fbb3282eec96c7aafb
BLAKE2b-256 e83237085300bad56fb75214d2381a8f335d6a832695c235f2fa255ac5b213f0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: local_pigeon-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 98.8 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1a02b58b587fb5e6f7b9d5edf590a14fc1fe3234da4895efa27d9efe665b0715
MD5 1d19154b67dd33cb7daeff9e29a342a2
BLAKE2b-256 f93a9f1d5b70d38838672870cd88163b427434d1c31850785c0041c3801fcf82

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