go-ai is a Go port of @earendil-works/pi-ai: a unified LLM library that exposes the same high-level Stream()/Complete() API across multiple providers. It supports streaming deltas, typed tool calling, cross-provider message/context types, automatic model discovery, cost tracking, and provider-specific OAuth flows. The current implementation tracks the bounded pi-ai v0.84.0 release surface.
At the centre is a registry-driven core: providers register streaming implementations, models enter a global registry, and callers invoke Stream() or Complete() with a Context, Model and optional tools. Provider packages translate the common Go types into each wire protocol and emit one event stream. OAuth helpers, deferred response lifecycle handling, telemetry and generated model metadata sit alongside the core.
Same Stream() / Complete() surface across providers.
Typed tools with JSON Schema parameters and streamed tool-call deltas.
OpenAI, Anthropic, Google, Mistral, Bedrock, Codex, Azure, Baseten and compatible APIs.
1,153 text models across 38 providers and 42 image models, generated from the pi-ai v0.84.0 release data.
JSON-compatible with pi-ai types for Go and TypeScript hand-off.
Per-request token usage and USD cost breakdown.
Built-in device flow / PKCE helpers for supported providers.