🤖 pi-mono
A unified AI agent toolkit for building, deploying, and interacting with LLM-powered agents in production.
pi-mono (github.com/robertpelloni/pi-mono) is an open-source agent toolkit that consolidates the full agent development lifecycle into a single, coherent system. Designed for developers building AI tools, it provides a coding agent CLI, a unified LLM API, a TUI library, a web UI library, a Slack bot, and vLLM pod orchestration — all working together out of the box.
Architecture Overview
pi-mono is organized around a central Agent runtime that can be driven by multiple interfaces. The core components are:
🧠 Coding Agent CLI
Terminal-based agent with multi-turn reasoning, tool execution, code generation, and file system access. Supports streaming output and interactive debugging.
pi-mono run "refactor this module to use async"
🔌 Unified LLM API
Abstraction layer over OpenAI, Anthropic, vLLM, and local models. Automatic fallback, cost tracking, and structured output parsing.
# Single API for any provider
response = await llm.chat(messages, model="auto")
🖥️ TUI Library
Python-native terminal UI components for building agent dashboards, logs viewers, and interactive REPLs. Keyboard-driven, with rich text and real-time updates.
🌐 Web UI Library
FastAPI-based web interface components: chat views, agent state panels, tool call inspectors, and deployment dashboards. Ships with pre-built templates.
💬 Slack Bot
Configurable Slack app that routes messages to agents, supports threaded conversations, slash commands, and file uploads for context sharing.
⚡ vLLM Pods
Built-in orchestrator for spinning up vLLM inference servers. Auto-scaling pool management, model loading, and health checks for self-hosted models.
Key Technical Features
1. Multi-Interface Agent Runtime
All interfaces (CLI, TUI, web, Slack) share the same Agent core. Add custom tools via a simple decorator API:
from pi_mono import tool
@tool(description="Query a PostgreSQL database")
def run_sql(query: str) -> list[dict]:
# ... execute query
return results
2. Unified LLM Adapter
The llm module normalizes streaming, token counting, and error handling across providers. Key capabilities:
- Provider auto-detection from model string (e.g.,
claude-3→ Anthropic,gpt-4→ OpenAI) - Structured output via Pydantic model extraction
- Tool-use abstraction — same tool definitions work across all backends
- Cost accounting per-request and per-session
3. vLLM Pod Management
# Start a vLLM pod with auto-scaling
pi-mono vllm deploy --model meta-llama/Llama-3.1-8B --gpus 2 --port 8000
# List running pods
pi-mono vllm ls
The orchestrator handles GPU allocation, model downloading, and integrates with the unified LLM API — so your agents can seamlessly switch between local vLLM pods and cloud APIs.
4. TUI Framework
Built on urwid with a reactive component model. Supports:
- Markdown rendering for agent responses
- Interactive JSON inspectors for tool calls
- Split-pane views for code + conversation
- Vim-like keybindings (configurable)
Getting Started
pip install pi-mono
# CLI mode
pi-mono run
# Web UI (FastAPI server)
pi-mono serve
# Slack bot (requires app config)
pi-mono slack start
# Deploy local vLLM
pi-mono vllm deploy --model path/to/model
unified_llm module is importable separately — you can use it to build custom agent frameworks without the full toolkit. All interfaces are optional; plug in only what you need.
Use Cases
- Codebase agents: Attach file system, git, and linting tools for autonomous code review and refactoring
- Internal dev ops: Slack agent that deploys services, runs queries, and monitors logs
- Rapid prototyping: Use the REPL-like CLI to test agent behaviors before building a web interface
- Self-hosted inference: Deploy vLLM pods for sensitive data workflows, then route agents through the unified API
Repository Structure
pi-mono/
├── pi_mono/
│ ├── core/ # Agent runtime, tool system, memory
│ ├── llm/ # Unified LLM API + adapters
│ ├── tui/ # Terminal UI components
│ ├── web/ # FastAPI routes, chat templates
│ ├── slack/ # Slack bot handler
│ └── vllm/ # vLLM pod manager & API proxy
├── cli.py
└── pyproject.toml
Why pi-mono?
Most agent tools focus on a single interface (CLI-only or web-only) or lock you into one LLM provider. pi-mono was built by developers who needed a homogeneous toolkit where the same agent code works in the terminal, a web dashboard, and a Slack channel — with the ability to swap between local and cloud models without changing a single line of agent logic.