Pi Monorepo: An AI Agent Toolkit
Pi Monorepo is a comprehensive suite of tools designed for building and deploying AI agents, managing Large Language Model (LLM) interactions, and facilitating the development of AI-powered applications. It provides a unified LLM API, command-line interface (CLI) tools, terminal UI (TUI) and web UI libraries, a Slack bot integration, and utilities for managing vLLM deployments on GPU pods.
Core Components and Features:
-
Unified LLM API (
@mariozechner/pi-ai): This package offers a consistent interface for interacting with various LLM providers, including OpenAI, Anthropic, Google, and others. It abstracts away the complexities of different provider APIs, allowing developers to seamlessly switch between models and services.- Key Features:
- Provider Abstraction: A single API for multiple LLM backends.
- Model Management: Easily configure and select different LLM models.
- Tool Calling: Built-in support for LLMs that can call external tools and functions.
- Streaming Support: Handles streaming responses from LLMs for real-time interaction.
- Configuration: Flexible configuration for API keys, model parameters, and provider-specific settings.
- Use Cases: Chatbots, content generation, data analysis, code generation, and any application requiring LLM integration.
- Key Features:
-
Agent Runtime (
@mariozechner/pi-agent-core): This core component provides the framework for building sophisticated AI agents. It manages agent state, orchestrates tool usage, and handles the execution flow of agent tasks.- Key Features:
- State Management: Maintains the internal state of an agent throughout its lifecycle.
- Tool Orchestration: Manages the registration, selection, and execution of tools by the agent.
- Task Execution: Defines and executes complex agent tasks, including multi-step processes.
- Event Handling: Provides hooks and events for monitoring and controlling agent behavior.
- Use Cases: Building autonomous agents, complex workflows, AI assistants, and decision-making systems.
- Key Features:
-
Interactive Coding Agent CLI (
@mariozechner/pi-coding-agent): A powerful command-line interface designed to assist developers with coding tasks. It leverages AI to understand code context, suggest completions, refactor code, and answer coding-related questions.- Key Features:
- Code Completion: Suggests code snippets and completions in real-time.
- Code Refactoring: Assists in restructuring and improving existing code.
- Code Explanation: Provides explanations for code segments.
- Context Awareness: Understands the project structure and code context for relevant suggestions.
- Interactive Prompting: Allows users to interact with the agent via a CLI for specific coding tasks.
- Use Cases: Accelerating software development, improving code quality, learning new codebases, and automating repetitive coding tasks.
- Key Features:
-
Slack Bot (
@mariozechner/pi-mom): This package enables the integration of AI agents into Slack workspaces. The bot can receive messages, delegate them to the pi coding agent or other AI agents, and post responses back to Slack.- Key Features:
- Slack Integration: Connects AI agents to Slack channels and direct messages.
- Message Delegation: Routes user messages to appropriate AI agents.
- Response Posting: Delivers AI-generated responses back to Slack.
- Slash Command Support: Can be configured to respond to Slack slash commands.
- Use Cases: Bringing AI assistance directly into team communication workflows, automating tasks within Slack, and providing quick answers to team queries.
- Key Features:
-
Terminal UI Library (
@mariozechner/pi-tui): A versatile library for building rich and interactive terminal user interfaces. It features differential rendering, allowing for efficient updates and a smooth user experience in the terminal.- Key Features:
- Differential Rendering: Optimizes UI updates by only rendering changed elements.
- Component-Based: Provides building blocks for creating complex TUI applications.
- Cross-Platform Compatibility: Designed to work across different terminal emulators.
- Customization: Allows for extensive customization of UI elements and appearance.
- Use Cases: Creating interactive CLIs, TUI dashboards, developer tools, and terminal-based applications.
- Key Features:
-
Web UI Components (
@mariozechner/pi-web-ui): A collection of web components for building modern AI chat interfaces. These components can be easily integrated into web applications to provide a user-friendly experience for interacting with AI models.- Key Features:
- Reusable Components: Pre-built UI elements for chat interfaces (e.g., message bubbles, input fields, loading indicators).
- Customizable Styling: Allows for easy theming and branding to match application design.
- Framework Agnostic: Can be used with various web frameworks (React, Vue, Angular, or plain HTML).
- Accessibility: Designed with accessibility best practices in mind.
- Use Cases: Building AI-powered customer support interfaces, interactive documentation, AI assistants for websites, and conversational UIs.
- Key Features:
-
vLLM Deployment CLI (
@mariozechner/pi-pods): This command-line tool simplifies the management of vLLM deployments, particularly for running LLMs on GPU pods. It streamlines the process of setting up, configuring, and scaling LLM inference endpoints.- Key Features:
- vLLM Integration: Optimized for vLLM, a high-throughput LLM serving engine.
- GPU Pod Management: Facilitates deployment and management on GPU-accelerated infrastructure.
- Configuration: Simplifies the configuration of inference parameters, model loading, and endpoint setup.
- Scalability: Aids in scaling LLM inference services for production environments.
- Use Cases: Deploying LLMs for production applications, managing inference servers, optimizing LLM performance on GPUs, and creating scalable AI services.
- Key Features:
Target Audience:
Pi Monorepo is targeted towards:
- Software Developers: Who need tools to integrate AI capabilities into their applications, build AI agents, or automate coding tasks.
- AI Engineers and Researchers: Who are working on LLM deployments, agent development, and experimenting with new AI architectures.
- DevOps Engineers: Responsible for deploying and managing AI models and services in production environments.
- Product Managers: Looking to leverage AI to enhance their products and user experiences.
Unique Selling Points:
- Unified Approach: Provides a cohesive set of tools for the entire AI agent development lifecycle, from local development to production deployment.
- Flexibility: Supports multiple LLM providers, diverse agent types, and various deployment targets.
- Developer Experience: Focuses on simplifying complex tasks through intuitive CLIs, reusable UI components, and clear documentation.
- Performance: Leverages optimized libraries like vLLM for efficient LLM inference.
Getting Started:
- Install Dependencies: Run
npm installfrom the repository root. - Build Packages: Execute
npm run buildto compile all packages. - Lint and Check: Use
npm run checkfor linting, formatting, and type checking. - Run Tests: Execute
./test.shfor general tests or./pi-test.shto run tests directly from sources.
Pi Monorepo aims to be a foundational toolkit for anyone serious about building with AI, offering a robust and flexible platform for innovation.

