Metadata-Version: 2.4
Name: pi-py-ai
Version: 0.83.0
Summary: Python port of @earendil-works/pi-ai — Unified LLM API with multi-provider streaming
Project-URL: Homepage, https://github.com/encyc/pi-py
Project-URL: Repository, https://github.com/encyc/pi-py
Project-URL: Issues, https://github.com/encyc/pi-py/issues
Author: Justin Gao
License: MIT
Classifier: Development Status :: 4 - Beta
Classifier: Framework :: Pydantic
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.11
Requires-Dist: anthropic>=0.39
Requires-Dist: json-repair>=0.30
Requires-Dist: openai>=1.50
Requires-Dist: pydantic>=2.7
Requires-Dist: python-dotenv>=1.0
Description-Content-Type: text/markdown

# pi-ai

Python port of [@earendil-works/pi-ai](https://github.com/earendil-works/pi) — Unified LLM API.

## Install

```bash
pip install pi-ai
```

## Quick Start

```python
from pi_ai import stream, Context, UserMessage, Model, StreamOptions

model = Model(
    id="deepseek-chat", api="openai-completions", provider="deepseek",
    base_url="https://api.deepseek.com/v1", input=["text"],
    context_window=64000, max_tokens=8192,
)
ctx = Context(messages=[UserMessage(content="Hello")])
es = stream(model, ctx, StreamOptions(api_key="sk-..."))
async for event in es:
    if event.type == "text_delta": print(event.delta, end="")
```

## Providers

- **OpenAI** — Chat Completions (also works with DeepSeek, OpenRouter, etc.)
- **Anthropic** — Messages API with thinking (extended reasoning) support
- **Faux** — Test mock

## Links

- [GitHub](https://github.com/encyc/pi-py) | [Issues](https://github.com/encyc/pi-py/issues)
- [PORTING.md](./PORTING.md) — deviations from upstream
