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.25.7.tar.gz (642.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mirascope-1.25.7-py3-none-any.whl (373.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for mirascope-1.25.7.tar.gz
Algorithm Hash digest
SHA256 f301f9c69adb047f23346a7abe9738caa636c1a322cbc8722bda36070c9f85ca
MD5 cb0e77da856908739cabc0fbc8f9e377
BLAKE2b-256 8f28738bbe42e2db33a7ac9c7671878e064069614ef504c48a3d6dc4dba8fddd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mirascope-1.25.7-py3-none-any.whl
  • Upload date:
  • Size: 373.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.6.10

File hashes

Hashes for mirascope-1.25.7-py3-none-any.whl
Algorithm Hash digest
SHA256 5cd3c14fcf7a7d5312cb6904b2d342702bee36999352cacdb5583df0ce5e5574
MD5 5e0743462ce3d7d88676018eee399a3a
BLAKE2b-256 62c3def493460d1c2792917cd4bc29c0366601493223dce95f491f391545c53c

See more details on using hashes here.

Supported by

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