Skip to main content

LLM abstractions that aren't obstructions

Project description

Tests Coverage Docs PyPI Version Stars License Stars


Mirascope is a powerful, flexible, and user-friendly library that simplifies the process of working with LLMs through a unified interface that works across various supported providers, including OpenAI, Anthropic, Mistral, Google (Gemini/Vertex), Groq, Cohere, LiteLLM, Azure AI, and Bedrock.

Whether you're generating text, extracting structured information, or developing complex AI-driven agent systems, Mirascope provides the tools you need to streamline your development process and create powerful, robust applications.

30 Second Quickstart

Install Mirascope, specifying the provider(s) you intend to use, and set your API key:

pip install "mirascope[openai]"
export OPENAI_API_KEY=XXXXX

Make your first call to an LLM to extract the title and author of a book from unstructured text:

from mirascope import llm
from pydantic import BaseModel

class Book(BaseModel):
    title: str
    author: str

@llm.call(provider="openai", model="gpt-4o-mini", response_model=Book)
def extract_book(text: str) -> str:
    return f"Extract {text}"

book = extract_book("The Name of the Wind by Patrick Rothfuss")
assert isinstance(book, Book)
print(book)
# Output: title='The Name of the Wind' author='Patrick Rothfuss'

Tutorials

Check out our quickstart tutorial and many other tutorials for an interactive way to getting started with Mirascope.

Usage

For a complete guide on how to use all of the various features Mirascope has to offer, read through our Learn documentation.

Versioning

Mirascope uses Semantic Versioning.

Licence

This project is licensed under the terms of the MIT License.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mirascope-1.24.0.tar.gz (604.0 kB view details)

Uploaded Source

Built Distribution

mirascope-1.24.0-py3-none-any.whl (370.7 kB view details)

Uploaded Python 3

File details

Details for the file mirascope-1.24.0.tar.gz.

File metadata

  • Download URL: mirascope-1.24.0.tar.gz
  • Upload date:
  • Size: 604.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.6.10

File hashes

Hashes for mirascope-1.24.0.tar.gz
Algorithm Hash digest
SHA256 9dffb530460bb312a7d775b34ff93318faa2a4668103b21bb13c5db88bfcad35
MD5 babc283b1b24e35aa16930b215e27265
BLAKE2b-256 936ccdac9263306d52bc09dd49ad4ead3b9a030c654d79957bd414715de3d073

See more details on using hashes here.

File details

Details for the file mirascope-1.24.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mirascope-1.24.0-py3-none-any.whl
Algorithm Hash digest
SHA256 097f50efd75520e5c174e147c38fc2127c9d2c5f05a5b3325d6be8106a1a185d
MD5 d1e7fdb2937c8b4e344deed79e5c32b1
BLAKE2b-256 251f6ca3b2da15c22db051b5525031a1822e11e9d5131f5836d957ae54733a49

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page