
Mirascope
Decorator-based Python/TS toolkit for calling any frontier LLM with structured outputs and tools.
About
Mirascope is a Python and TypeScript toolkit that wraps LLM calls in a single unified interface: decorate a function with @llm.call("provider/model") and get retries, streaming, structured output parsed into Pydantic models, and tool-calling with an agent loop. The same code works across providers (Anthropic, OpenAI, Google, etc.) by abstracting provider differences. It positions itself as the minimal layer between raw provider SDKs and heavy frameworks — no graph engine, no mandatory cloud.
What it can do
- **@llm.call decorator**: turn any function into an LLM call with model routing as a string
- **Structured outputs**: `format=SomePydanticModel` parses responses into typed objects
- **Tools & agents**: `@llm.tool` decorator plus a resume/execute tool-call loop
- **Streaming, async, retries**: built-in across providers
- **Provider-agnostic**: one interface for Anthropic, OpenAI, Google, and others
- **Python + TypeScript**: parallel implementations in one monorepo
Setup
```bash
# Python
uv add "mirascope[all]"
# or: pip install mirascope
```
```python
from mirascope import llm
@llm.call("anthropic/claude-sonnet-4-5")
def recommend_book(genre: str):
return f"Recommend a {genre} book."
print(recommend_book("fantasy").text())
```
Set provider API keys as environment variables (e.g. ANTHROPIC_API_KEY). TypeScript version: npm i @mirascope/mirascope. Full docs at mirascope.com/docs.
Prerequisites
Python 3.10+ (or Node.js 18+ for the TS version). API keys for whichever LLM providers you call.
Use cases
Works with
Trust score — 8/10
Scored 8/10 (metrics tier, metrics-v1). Evidence: 1,531 GitHub stars (log-scaled vs catalog peers); blended with ~21,435 monthly package downloads; last push 1d ago; 19 releases/12mo; 21 open issues. Manual review: clean decorator API, Pydantic-native structured outputs, Python+TS; young project (1.5k stars), thin ecosystem; provider parity depends on each provider API. License: MIT.
★ 1,531 GitHub stars
How the trust score is built
Full methodology →- Adoption · stars/downloads, log-scaled vs peers
- 6.3/10
- Maintenance · recency, releases, issue load
- 9.5/10
- Openness · license + docs
- 10.0/10
- Manual review · sanity read + red-flag check
- 8.0/10
- · 1,531 GitHub stars (log-scaled vs catalog peers)
- · blended with ~21,435 monthly package downloads
- · last push 1d ago; 19 releases/12mo; 21 open issues
- · manual review: clean decorator API, Pydantic-native structured outputs, Python+TS; young project (1.5k stars), thin ecosystem; provider parity depends on each provider API
Sources
Every fact above was checked against these sources. Where a claim comes from the provider and couldn't be independently verified, the text says so.