
Pi AI Agent Toolkit
github.com/badlogic/pi-mono- Category
- AI Agents
- Rank
- No. 37Tools index
- Pricing
- Open Source
- Type
- TOOL
- Builder
- badlogic
- GitHub
- 103.0k stars
- Latest release
- v0.85.1
- Date
About
A comprehensive monorepo providing tools and libraries for building AI agents, including a unified LLM API, coding agent CLI, terminal/web UIs, and deployment management for GPU pods. Offers everything needed to create, deploy, and manage AI agents across different platforms.
What it does
Pi is a TypeScript agent harness built as cooperating packages. You can use its coding assistant from a terminal, embed its session runtime and tools in software, connect multiple model providers through one interface, or build terminal interfaces from exported components. Separate client, server, protocol, telemetry, and session-search layers support larger integrations.
Why it's ranked here
The project offers unusually broad implementation depth without collapsing everything into one executable. Its coding agent exposes interactive, text, JSON, and RPC modes, while the underlying packages remain reusable. Strong dependency controls add confidence. The main reservation is security: Pi inherits the launching process’s access unless you supply isolation.
What's good
The package boundaries are practical. Agent state, tool execution, context compaction, session search, telemetry, terminal rendering, transport, and model access can be adopted separately. The coding package also exports extension hooks and tool factories for programmatic use. Exact direct dependency pins, a committed lockfile, shrinkwrapped CLI dependencies, lifecycle-script checks, and isolated release smoke tests make the supply-chain policy concrete.
Tradeoffs
Pi has no built-in controls for filesystem, process, network, or credential access. Safe deployment therefore depends on a container, micro-VM, or external policy sandbox. The development environment requires Node 22.19 or newer. Some tests need provider API keys, though the test script skips them when keys are absent. Slack and chat workflow automation live in another project.
How to use it well
Use Pi when a TypeScript team wants a terminal coding agent that can also become an embedded runtime, extension host, or RPC-driven service. Start with the CLI, then adopt the agent and model packages as customization needs grow. Run untrusted tasks inside one of the documented isolation patterns. Do not choose it expecting built-in authorization controls or packaged Slack automation.
Technical notes+
The root package.json defines an ESM npm workspace, requires Node >=22.19.0, and sequences builds across TUI, telemetry, AI, agent, session backend, protocol, client, server, and coding-agent packages. packages/ai/src/index.ts presents a side-effect-free core surface and separates provider factories, API implementations, and compatibility exports by package subpaths. packages/coding-agent/src/main.ts selects interactive, print, JSON, or RPC operation and wires authentication, sessions, extensions, project trust, and runtime services. packages/server/src/server.ts implements framed protocol decoding, versioned handshakes, frame-size limits, handshake timeouts, session command dispatch, snapshots, and controlled connection shutdown. packages/telemetry/src/index.ts derives typed span attributes and events from serializable schema definitions.
Observed
- License
- MIT
- Primary language
- TypeScript using ECMAScript modules
- Packaging
- Private npm monorepo with multiple published workspace packages
- Install and release surface
- npm packages plus standalone binaries compiled with Bun from release source
- Interfaces
- Interactive CLI, text and JSON output modes, RPC mode, reusable libraries, and client-server protocol packages
- Runtime requirement
- Node.js 22.19.0 or newer
- Security boundary
- No built-in restriction system for filesystem, process, network, or credential access
- Testing
- Root test command runs script tests and workspace tests; provider-dependent tests can be skipped without API keys
Read from README.md, package.json, packages/ai/src/cli.ts, packages/ai/src/index.ts, packages/tui/src/index.ts, packages/agent/src/index.ts, packages/client/src/index.ts, packages/server/src/index.ts, packages/server/src/server.ts, packages/protocol/src/index.ts, packages/telemetry/src/index.ts, packages/coding-agent/src/cli.ts, packages/coding-agent/src/main.ts, packages/coding-agent/src/index.ts, packages/agent/src/search/index.ts.
What it can do
Build AI agents using unified LLM API
Developer code and LLM configuration → Functional AI agent
Generate code through coding agent CLI
Natural language prompts or coding requests → Generated code files
Deploy AI agents to GPU pods
AI agent application and deployment configuration → Running AI agent on GPU infrastructure
Manage AI agent runtime environments
Agent runtime configuration and parameters → Configured and running agent runtime
Create terminal-based AI agent interfaces
Agent logic and terminal UI configuration → Command-line AI agent interface
Create web-based AI agent interfaces
Agent logic and web UI configuration → Web application AI agent interface
Integrate multiple LLM providers through unified API
LLM provider credentials and API configurations → Unified interface for multiple LLM services
Tags
Tech Stack
Comments (0)
No comments yet
Editorially curated, with community endorsements as a secondary signal. Corrections welcome.