jackmpcollins/magentic
A Python library enabling LLM-powered functions via decorators with structured outputs, streaming, retries, and multi-provider support.

Magentic provides @prompt and @chatprompt decorators that turn Python functions into LLM-powered calls, returning structured outputs via pydantic models or built-in types. It supports streaming for real-time consumption, LLM-assisted retries for schema adherence, and OpenTelemetry observability with Pydantic Logfire integration. The library works with OpenAI, Anthropic, and Ollama providers, enabling developers to combine LLM queries and tool calls with traditional Python code to build complex agentic applications.