Skip to content
px7nnPublic

About

Personal AI Infrastructure & Network

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

28 Commits

Folders and files

Repository files navigation

PAIN Logo

PAIN

Personal AI Infrastructure & Network
Autonomous local intelligence engine with tool-calling runtime, real-time web grounding, and persistent memory.

FastAPI llama.cpp SQLite

Caution

Use at your own risk. This software is developed primarily for personal workflows and experimental research. Certain implementations and architectural choices may be considered resource-intensive, expensive, or potentially unsafe outside a trusted personal environment:

  • Host & Filesystem Access: The agent has tools to traverse, read, and OCR files across your local disk (tools/files). It executes with the exact permissions of the user running the server. Never run PAIN as root. Be aware of indirect prompt injection risks from untrusted web pages or documents.
  • Heavy Compute & Thermals: Running local GGUF models with GPU offloading and up to 16k context budgets generates heavy sustained load on CPU, GPU, VRAM, and RAM. Ensure adequate cooling.
  • Autonomous Tool Execution: The agent autonomously triggers web searches, evaluates math, queries files, and mutates persistent memory. Open-weights models can hallucinate or misinterpret prompts.
  • Unencrypted Storage: Chat logs, prompt personalities, and persistent memory records are saved in unencrypted SQLite (data/pain.db).
  • External Queries: While inference is strictly local, tools like web_search make outbound internet queries.

Provided "as is" without warranty of any kind. The author assumes no liability for hardware damage, data loss, security exposure, or unintended actions.


Features

  • Local GGUF Runtime: Direct llama-server integration with dynamic model switching.
  • Autonomous Tool Calling: Built-in web grounding, filesystem access, math, and OCR.
  • Persistent Memory: SQLite FTS5 storage with live database inspection and CRUD.
  • Real-Time Telemetry: Llama.cpp context gauge and one-click history compaction.
  • Responsive UI: Minimal interface tuned for desktop, tablet, and mobile.

Quickstart

Prerequisites

  • Python 3.10+
  • llama.cpp with llama-server compiled
  • GGUF models placed in models/

Setup & Run

# Clone and setup environment
git clone https://github.com/px7nn/PAIN.git
cd PAIN
python3 -m venv venv && source venv/bin/activate
pip install -r requirements.txt

# Configure paths in config.toml (point llama_dir to your llama.cpp build)
# Then start the server:
python3 main.py

Access the interface at http://localhost:8000.

Remote & Mobile Access

PAIN's interface is fully responsive. To access your local model from your phone, tablet, or another machine:

  • Local Network: Open http://<LAN_IP>:8000 from any device on your Wi-Fi/LAN.
  • SSH Tunnel:
    ssh -N -L 8000:localhost:8000 user@remote-host
    
  • Tunnels & Mesh VPNs: Forward or route port 8000 using Cloudflare Tunnel (cloudflared tunnel --url http://localhost:8000), Tailscale, or WireGuard to access your local agent from anywhere securely.

About

Personal AI Infrastructure & Network

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages