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, Gemini, Groq, Cohere, LiteLLM, Azure AI, Vertex 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.core import openai
from pydantic import BaseModel

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

@openai.call("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

This version

1.7.3

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.7.3.tar.gz (1.8 MB view details)

Uploaded Source

Built Distribution

mirascope-1.7.3-py3-none-any.whl (248.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mirascope-1.7.3.tar.gz
  • Upload date:
  • Size: 1.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.14

File hashes

Hashes for mirascope-1.7.3.tar.gz
Algorithm Hash digest
SHA256 1131c779914583b8623d3d53092d4c6ff3b6a68bf45f4bab615c60ad3fc82d92
MD5 a5a5b4fd9d96f5be55451533c4aa1a0a
BLAKE2b-256 ae17f2d67cd1477f61dadb024002f4f2a2b86de3f01fc0a554ddad1308d6c5a3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mirascope-1.7.3-py3-none-any.whl
  • Upload date:
  • Size: 248.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.14

File hashes

Hashes for mirascope-1.7.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5b9e9f3ab56cc0604931fc9de7569e240ce5829c3d65905a8d772a7b1f3bf8ac
MD5 da12752ac2ad790cacd017bc7f32801e
BLAKE2b-256 78c8ed966e059f549b63d50421525175f0bbeab37011bbb5e19614f12d1ecaa2

See more details on using hashes here.

Supported by

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