← all repositories

jackmpcollins/magentic

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

magentic
Velocity · 7d
+2.2
★ / day
Trend
steady
star history

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.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.