marvin
a simple and powerful tool to get things done with AI
Decision gist · record as of 2026-08-14
Yes, if you are building AI-powered applications and want structured, validated outputs without writing LLM response parsing code. Marvin's combination of simple extraction utilities and a composable task-agent framework makes it suitable for both quick prototyping and more complex agentic systems. Low install friction, active maintenance, permissive license, and no known vulnerabilities. Main constraint: requires an LLM API key and incurs per-call costs.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python >=3.10.
- Requires an LLM provider API key (OpenAI by default; set OPENAI_API_KEY environment variable, or configure an alternative via pydantic-ai).
- Low install friction; pure Python wheel with no compiled dependencies.
License · maintenance · safety
permissive license (permissive) — Apache License 2.0 (permissive). You may use, modify, and distribute Marvin and derivative works freely, including in commercial applications, provided you retain license notices and include a copy of the license with distributions.
last release 2026-03-04 (163 days)
0 known vulnerabilities (OSV.dev, 2026-08-14) · 91,045 downloads/mo, #13,547 on PyPI
Alternatives
Verify before relying
import marvin
# Simple structured extraction
result = marvin.extract(
"i found $30 on the ground and bought 5 bagels for $10",
int,
instructions="only USD"
)
print(result) # [30, 10]
# Or run a task
poem = marvin.run("Write a short poem about artificial intelligence")
print(poem)- Whether all Pydantic AI models are truly natively supported or if some require additional configuration beyond what the fact sheet shows.
- Performance characteristics and latency for complex multi-agent workflows or large-scale task orchestration.
- Specific error handling and retry behavior when LLM calls fail or time out.
What it is and what it does
Marvin bridges the gap between unstructured AI outputs and type-safe Python code. At its core, it provides four structured-output utilities—extract, cast, classify, and generate—that let you pull native Python types and custom objects directly from LLM responses. Built on top of Pydantic for validation, it ensures results match your schema before they reach your code.
Beyond simple extraction, Marvin 3.x introduces a task-and-agent model for building agentic workflows. You define Tasks with clear instructions and result types, assign specialized Agents (which wrap LLM configurations), and optionally give tasks access to custom tools and context. Tasks can be composed into Threads for orchestrating complex multi-step behaviors. The framework is designed to make AI work observable and debuggable—you see which tools were called, what the agent did, and whether it succeeded.
Use it for
- Extract structured data (prices, dates, entities) from unstructured text or documents without manual parsing.
- Classify user input into predefined categories (support tickets to departments, sentiment labels, etc.) with type-safe enum results.
- Build multi-step workflows where specialized agents collaborate—e.g., one agent researches, another writes, a third reviews.
- Generate synthetic test data or examples matching a specific schema for testing or prototyping.
- Delegate complex reasoning tasks to an LLM while keeping your application logic type-checked and deterministic.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you are building AI-powered applications and want structured, validated outputs without writing LLM response parsing code.
Marvin's combination of simple extraction utilities and a composable task-agent framework makes it suitable for both quick prototyping and more complex agentic systems. Low install friction, active maintenance, permissive license, and no known vulnerabilities. Main constraint: requires an LLM API key and incurs per-call costs.
Install
marvin on PyPI
Before you install
Low install friction; pure Python wheel with no compiled dependencies. Actively maintained as of 163 days ago. Depends on a substantial but well-established stack: pydantic-ai, sqlalchemy, alembic, jinja2, typer, and rich—all mature libraries with good ecosystem standing.
Requires Python >=3.10. Requires an LLM provider API key (OpenAI by default; set OPENAI_API_KEY environment variable, or configure an alternative via pydantic-ai).
License in practice
Apache License 2.0 (permissive). You may use, modify, and distribute Marvin and derivative works freely, including in commercial applications, provided you retain license notices and include a copy of the license with distributions.
Quickstart
import marvin
# Simple structured extraction
result = marvin.extract(
"i found $30 on the ground and bought 5 bagels for $10",
int,
instructions="only USD"
)
print(result) # [30, 10]
# Or run a task
poem = marvin.run("Write a short poem about artificial intelligence")
print(poem)
Verify before relying
- Whether all Pydantic AI models are truly natively supported or if some require additional configuration beyond what the fact sheet shows.
- Performance characteristics and latency for complex multi-agent workflows or large-scale task orchestration.
- Specific error handling and retry behavior when LLM calls fail or time out.
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 10 packagesaiosqlitealembicjinja2partial-json-parserpydantic-aipydantic-settingspydanticrichsqlalchemytyper |
| Maintenance | Actively maintained 163 days since the last release |
| First released | |
| Downloads | 91,045 / month, #13,547 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
Evidence: marvin-3.2.7-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “extract classify generate with ai”
- marvinMarvin is a Python framework for building AI workflows that produce…
- google-cloud-documentaiPython client library for Google Cloud Document AI, which parses…
- extend-aiOfficial Python SDK for the Extend document processing API, enabling…
Give your agent the search over MCP, or paste the wish link into any chat.
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to call 100+ LLM providers (OpenAI, Anthropic, Gemini, Bedrock, Azure, and others) using OpenAI-compatible API format, available as both a Python SDK and a self-hosted AI Gateway proxy server.
Install it if you need to work with multiple LLM providers or want to centralize LLM routing in your organization.
Client library and CLI tool for downloading, uploading, and managing models, datasets, and repositories on the Hugging Face Hub platform.
Install it if you work with Hugging Face Hub models or datasets.
LangChain provides a framework for building agents and LLM-powered applications by composing language models, tools, and memory through a unified API that abstracts over multiple model providers.
hf-xet provides chunk-based deduplication and efficient file transfer for the Hugging Face Hub, enabling faster uploads and downloads of large files with local disk caching.
Tokenizers converts raw text into token sequences for NLP models, with support for training custom vocabularies and using pre-built tokenizers (BPE, WordPiece) optimized for speed via Rust.
Transformers provides a unified framework for loading, fine-tuning, and running state-of-the-art pretrained models across text, vision, audio, video, and multimodal tasks using PyTorch, JAX, or TensorFlow.
Install it if you need to run or train any transformer-based model for NLP, vision, audio, or multimodal tasks.
See also agent-framework-core · pydantic-ai · semantic-kernel · pydantic-deep · agent-framework · agent-framework-claude · strands-agents-builder · autogen · langchain-cli