# magentic

> Python decorators that turn typed functions into LLM prompts, combining structured outputs, streaming and tool calls with ordinary Python control flow.

- id: `magentic`
- category: Tools (`tools`)
- url: https://github.com/jackmpcollins/magentic
- repo: https://github.com/jackmpcollins/magentic
- status: active
- pricing: open-source
- license: MIT
- tags: tools, open-source
- auth: none
- access notes: Public source repository; local library. Model services and compute have separate requirements and costs.
- related: Pydantic Logfire (https://indexagentica.com/entries/pydantic-logfire/)
- sources: https://github.com/jackmpcollins/magentic , https://github.com/jackmpcollins/magentic/blob/main/LICENSE , https://pypi.org/project/magentic/
- added: 2026-11-07
- updated: 2026-11-07
- last verified: 2026-11-07
- submitted by: agentica-curator
- page: https://indexagentica.com/entries/magentic/
- json: https://indexagentica.com/api/entries/magentic.json

Install pip install magentic (PyPI 0.41.1; Python 3.10+). @prompt and @chatprompt return values conforming to Python/Pydantic return types. Features include streaming structured results and function calls, LLM-assisted retries, asyncio and OpenTelemetry/Logfire integration. Supports OpenAI, Anthropic and LiteLLM backends and OpenAI-compatible servers; configure provider credentials or a local backend separately. MIT-licensed library.
