Skip to content

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