# pi-mono | Mario Zechner | Knowledge Base | Instagit

AI agent toolkit: coding agent CLI, unified LLM API, TUI & web UI libraries, Slack bot, vLLM pods

GitHub Stars: 12.3k

Repository: https://github.com/badlogic/pi-mono

---

## Articles

### [How agentLoop Handles Tool Execution in π‑AI: A Deep Dive into the pi‑mono Agent Loop](/badlogic/pi-mono/how-agentloop-handles-tool-execution)

Discover how agentLoop in pi-mono handles tool execution by validating arguments, invoking handlers, and streaming events for real-time UI updates. Learn more about the pi-mono agent loop.

- Tags: deep-dive
- Published: 2026-02-16

### [How to Configure Message Queue and Steering Mode in π‑AI](/badlogic/pi-mono/how-to-configure-message-queue-and-steering-mode)

Learn to configure message queue and steering mode in π‑AI by adjusting steeringMode and followUpMode settings in JSON or via the SettingsManager API for optimized message handling.

- Tags: how-to-guide
- Published: 2026-02-16

### [How the TUI Differential Rendering System Works in pi-ai](/badlogic/pi-mono/how-tui-differential-rendering-system-works)

Discover how pi-ai's TUI differential rendering minimizes terminal output by efficiently updating only changed lines, not the whole screen. Optimize your terminal apps.

- Tags: internals
- Published: 2026-02-16

### [How to Deploy vLLM GPU Pods with the Pods CLI for pi-ai](/badlogic/pi-mono/how-to-deploy-vllm-gpu-pods-with-pods-cli)

Deploy vLLM GPU pods with the pods CLI for pi-ai. Effortlessly set up remote hosts, activate pods, and launch models for seamless AI deployment. Streamline your workflow today.

- Tags: how-to-guide
- Published: 2026-02-16

### [**pi‑ai in Mode for Process Integration: A Complete Guide to RPC-Based Agent Embedding**](/badlogic/pi-mono/how-to-use-pi-in-rpc-mode-for-process-integration)

Learn how to integrate processes with pi-ai in RPC mode for seamless agent embedding. This complete guide covers everything you need to know. Get started today.

- Tags: how-to-guide
- Published: 2026-02-16

### [How to Add Custom Themes to the pi‑AI Interface: A Complete Guide](/badlogic/pi-mono/how-to-add-custom-themes-to-pi)

Learn to add custom themes to the pi-AI interface by creating JSON files for palettes and overrides. Customize your pi-mono experience today!

- Tags: how-to-guide
- Published: 2026-02-16

### [How to Implement Abort and Continue After Abort in pi-ai](/badlogic/pi-mono/how-to-implement-abort-and-continue-after-abort)

Learn to implement abort and continue after abort in pi-ai Cancel LLM requests with AbortSignal and resume conversations by appending the aborted message with a fresh AbortController.

- Tags: how-to-guide
- Published: 2026-02-16

### [How to Debug Provider API Payloads in pi-ai: A Complete Guide](/badlogic/pi-mono/how-to-debug-provider-api-payloads)

Debug provider API payloads in pi-ai by intercepting and inspecting JSON with the onPayload callback. Learn how to analyze requests before they are sent.

- Tags: how-to-guide
- Published: 2026-02-16

### [How to Handle Context Window Overflow Errors in pi-ai: Detection and Recovery Guide](/badlogic/pi-mono/how-to-handle-context-window-overflow-errors)

Learn to handle context window overflow errors in pi-ai. Detect token limits using isContextOverflow and trigger auto-compaction to summarize history and retry requests.

- Tags: how-to-guide
- Published: 2026-02-16

### [How to Use Vertex AI with Application Default Credentials in pi-ai](/badlogic/pi-mono/how-to-use-vertex-ai-with-application-default-credentials)

Learn to use Vertex AI with Application Default Credentials in pi-ai. Configure project and location using environment variables for seamless authentication and access.

- Tags: how-to-guide
- Published: 2026-02-16

### [How to Customize Keyboard Keybindings in pi-ai: Complete Configuration Guide](/badlogic/pi-mono/how-to-customize-keyboard-keybindings)

Easily customize keyboard keybindings in pi-ai by editing the keybindings.json file. Learn how to tailor shortcuts to your workflow for a more efficient coding experience.

- Tags: how-to-guide
- Published: 2026-02-16

### [How Token Tracking and Cost Calculation Work in Pi-AI: A Complete Technical Guide](/badlogic/pi-mono/how-token-tracking-and-cost-calculation-works)

Explore how Pi-AI tracks tokens and calculates costs. Discover the technical details of usage monitoring and pricing in this complete guide to Pi-AI's cost management.

- Tags: deep-dive
- Published: 2026-02-16

### [How to Configure Thinking and Reasoning Options in pi-ai](/badlogic/pi-mono/how-to-configure-thinking-reasoning-options)

Learn how to configure thinking and reasoning options in pi-ai. Set the reasoning property in SimpleStreamOptions to control AI thought processes and enhance model capabilities.

- Tags: how-to-guide
- Published: 2026-02-16

### [How to Create Custom Extensions for the Pi Coding Agent: A Complete Guide](/badlogic/pi-mono/how-to-create-custom-extensions-for-pi-coding-agent)

Learn how to create custom extensions for the Pi coding agent. This guide shows you how to write TypeScript or JavaScript modules to register tools, commands, and lifecycle hooks.

- Tags: how-to-guide
- Published: 2026-02-16

### [How to Handle Streaming Tool Calls with Partial JSON Arguments in pi-ai](/badlogic/pi-mono/how-to-handle-streaming-tool-calls-with-partial-json)

Master streaming tool calls with partial JSON in pi-ai. Learn to buffer, parse safely, and update your UI with toolcall_delta for a seamless developer experience.

- Tags: how-to-guide
- Published: 2026-02-16

### [How to Create Skills for pi‑ai: A Complete Developer Guide](/badlogic/pi-mono/how-to-create-skills-for-pi)

Learn to create skills for pi-ai by defining metadata and executable scripts that the Mom Slack-bot discovers and exposes to the LLM. Follow this developer guide for pi-mono.

- Tags: how-to-guide
- Published: 2026-02-16

### [How to Use Prompt Templates in pi-ai: A Complete Guide to Reusable Markdown Snippets](/badlogic/pi-mono/how-to-use-prompt-templates-in-pi)

Master prompt templates in pi-ai. Learn to store reusable Markdown snippets with arguments and Bash-style slicing for efficient AI prompting. Explore this complete guide.

- Tags: how-to-guide
- Published: 2026-02-16

### [How Session Branching and Compaction Work in pi-ai](/badlogic/pi-mono/how-session-branching-and-compaction-work)

Learn how pi-ai uses session branching and compaction with its append-only JSON-L tree. Discover how branch creates new histories and appendCompaction summarizes old entries to save tokens.

- Tags: deep-dive
- Published: 2026-02-16

### [How to Serialize and Persist Conversation Context in π‑AI: A Complete Guide](/badlogic/pi-mono/how-to-serialize-and-persist-conversation-context)

Learn to serialize and persist conversation context in π-AI using JSON-Lines with serializeConversation() and SessionManager. Manage your chat history effectively.

- Tags: how-to-guide
- Published: 2026-02-16

### [How to Configure Custom Models for Ollama or LiteLLM in pi-ai](/badlogic/pi-mono/how-to-configure-custom-models-for-ollama-or-litellm)

Configure custom Ollama or LiteLLM models in pi-ai effortlessly. Create a models.json file to define providers and model IDs, loading them instantly without restarts.

- Tags: how-to-guide
- Published: 2026-02-16

### [How Cross-Provider Handoffs Work in pi-ai: A Unified Streaming Approach](/badlogic/pi-mono/how-cross-provider-handoffs-work-between-llm-models)

Discover how pi-ai achieves seamless cross-provider handoffs. Our unified streaming API normalizes LLM interactions for fluid conversation flow between models.

- Tags: deep-dive
- Published: 2026-02-16

### [How to Use TypeBox Schemas for Tool Definitions in pi-ai](/badlogic/pi-mono/how-to-use-typebox-schemas-for-tool-definitions)

Learn to define pi-ai tool parameters with TypeBox schemas. Convert to JSON-Schema for LLMs and validate at runtime with AJV. Enhance your AI development.

- Tags: how-to-guide
- Published: 2026-02-16

### [How to Add a New LLM Provider to pi-ai: A Complete Implementation Guide](/badlogic/pi-mono/how-to-add-new-llm-provider-to-pi-ai)

Learn to add a new LLM provider to pi-ai with this complete implementation guide. Extend types, implement streaming, register the API, and add model discovery.

- Tags: how-to-guide
- Published: 2026-02-16

### [Understanding pi-tui's Differential Rendering Architecture for Terminal UIs](/badlogic/pi-mono/pi-tui-differential-rendering-architecture)

Explore pi-tui's differential rendering architecture. Learn how it efficiently updates terminal UIs by sending only necessary escape sequences for changed screen regions.

- Tags: architecture
- Published: 2026-02-15

### [Model Scoping and Resolution Using Provider Patterns in pi-mono](/badlogic/pi-mono/pi-mono-model-scoping-provider-patterns)

Discover model scoping and resolution in pi-mono using provider patterns. Learn how to achieve flexible LLM discovery with pattern matching and automatic fallback resolution across multiple vendors.

- Tags: deep-dive
- Published: 2026-02-15

### [How to Extend pi-coding-agent with Custom CLI Flags and Functionality](/badlogic/pi-mono/extend-pi-coding-agent-custom-cli)

Extend pi-coding-agent with custom CLI flags and functionality. Learn to register new options and access values in event handlers without modifying core code. Enhance your workflow.

- Tags: how-to-guide
- Published: 2026-02-15

### [Integrating Multiple LLM Providers in the pi-ai Abstraction: A Complete Guide](/badlogic/pi-mono/pi-ai-multi-llm-provider-integration)

Learn the four-step pattern to integrate multiple LLM providers in the pi-ai abstraction. Implement dual streaming functions, register APIs, and consume via helpers for seamless LLM access.

- Tags: how-to-guide
- Published: 2026-02-15

### [How pi-coding-agent Handles Session Management for Resuming, Forking, and Continuing Tasks](/badlogic/pi-mono/pi-coding-agent-session-management)

Discover how pi-coding-agent's SessionManager uses a JSON-L tree for robust session management, enabling effortless task resumption, forking, and continuation.

- Tags: how-to-guide
- Published: 2026-02-15

