simlock
병렬 코딩 에이전트가 동일 시뮬레이터를 놓고 충돌하지 않도록 제어 평면 제공
an ambient intelligence library
저장소 README에서 가져옴
README 전체를 불러오는 중입니다. 아래는 저장된 발췌입니다.
Marvin is a Python framework for producing structured outputs and building agentic AI workflows.
Marvin provides an intuitive API for defining workflows and delegating work to LLMs:
• Cast, classify, extract, and generate structured data from any inputs.
• Create discrete, observable tasks that describe your objectives.
• Assign one or more specialized AI agents to each task.
• Combine tasks into a thread to orchestrate more complex behaviors.
Configure your LLM provider (Marvin uses OpenAI by default but natively supports all Pydantic AI models):README 전문 보기 ↗Marvin is a Python library for extracting structured data and running tasks with language models. It builds on Pydantic AI for model access and adds typed tasks, tools, and conversation history. Made by Prefect.
Requires Python 3.10 or later and credentials for your model provider.
uv add marvin
export OPENAI_API_KEY="your-api-key"
Marvin uses OpenAI by default. See model configuration for other providers.
import marvin
from pydantic import BaseModel
class Contact(BaseModel):
name: str
email: str
contacts = marvin.extract("Email Ada at [email protected]", Contact)
print(contacts)
Use cast to produce one value, extract to find a list of values, classify to choose labels, and generate to create examples. Each has an async counterpart.
For work that needs instructions, context, or tools, use a task:
import marvin
def stock_level(product: str) -> int:
"""Return the number of units in stock."""
return {"notebook": 12, "pen": 30}[product]
count = marvin.run(
"Check how many notebooks are in stock",
result_type=int,
tools=[stock_level],
)
An Agent holds model settings, instructions, and tools you want to reuse. A Thread shares conversation history across calls and stores it in a database. See the quickstart and examples for both.
uv sync
uv run pytest tests/basic
uv run pre-commit run --all-files
Tests under tests/ai make model requests and require provider credentials. Keep test data separate from your local history by setting MARVIN_HOME_PATH to a temporary directory.
The documentation lives in docs/ and is published at askmarvin.ai. See releases for changes between versions.