go-ai is a Go port of @mariozechner/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.
At the center is a registry-driven core: API providers register streaming implementations, models are registered in a global model registry, and callers invoke Stream() or Complete() with a Context, Model, and optional tool definitions. Provider packages translate the common Go types into each provider's wire protocol and emit a unified event stream (TextDelta, ThinkingDelta, ToolCallStart, Done, etc.). OAuth helpers and generated model metadata sit alongside the core so the same library can drive OpenAI, Anthropic, Google, Mistral, Bedrock, Codex, and compatible APIs without changing the calling code.
Same Stream() / Complete() surface across providers.
Typed tools with JSON Schema parameters and streamed tool-call deltas.
OpenAI, Anthropic, Google, Mistral, Bedrock, Codex, Azure/OpenAI-compatible APIs.
JSON-compatible with pi-ai types for Go ↔ TypeScript hand-off.
Per-request token usage and USD cost breakdown.
Built-in device flow / PKCE helpers for supported providers.