pi-python¶
Unified LLM provider abstraction and agent framework for Python.
Packages¶
pi-llm¶
Streaming LLM API with model discovery, tool calling, token tracking, and cost calculation.
- Stream or await LLM responses with typed events
- Define tools with JSON Schema, validate arguments automatically
- Track token usage and dollar costs
- Support for extended thinking / reasoning
pi-llm-agent¶
Stateful agent framework with tool execution, event streaming, and lifecycle management.
- Multi-turn agent loop: prompt → LLM → tool calls → repeat
- Parallel or sequential tool execution
- Pre/post tool call hooks for access control
- Steering and follow-up message queues
- Cooperative cancellation
Quick Links¶
- Getting Started — Install and run your first example
- pi-llm Quickstart — Streaming, completing, and tool calls
- pi-llm-agent Quickstart — Build an agent with tools
- Build a Research Agent — End-to-end tutorial