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.
Frequently asked
- What is jackmpcollins/magentic?
- A Python library enabling LLM-powered functions via decorators with structured outputs, streaming, retries, and multi-provider support.
- Is magentic open source?
- Yes — jackmpcollins/magentic is open source, released under the MIT license.
- What language is magentic written in?
- jackmpcollins/magentic is primarily written in Python.
- How popular is magentic?
- jackmpcollins/magentic has 2.4k stars on GitHub.
- Where can I find magentic?
- jackmpcollins/magentic is on GitHub at https://github.com/jackmpcollins/magentic.