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

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

Uploaded Source

Built Distribution

mirascope-1.9.5-py3-none-any.whl (262.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for mirascope-1.9.5.tar.gz
Algorithm Hash digest
SHA256 ba5657492aea43f086eb35333f3a47c2b9a215d2e4568d0ab310e4f332041e04
MD5 64307f04c79bf94328b81c70e3b15925
BLAKE2b-256 88f4ece5f9efff36de5d2ebacbe1d349c257e43e010bbd9d8623947b06c98b1d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mirascope-1.9.5-py3-none-any.whl
  • Upload date:
  • Size: 262.6 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.9.5-py3-none-any.whl
Algorithm Hash digest
SHA256 547d0e939ea26db277ca9103348936f652e1fa94fd6de9e52d342de5f49de53c
MD5 a6cb4242b113b31f57d678c7032de2cf
BLAKE2b-256 6f5005ca0144e44db77d28b359358e62fcec66de0bc60dbca0a078bceb24a9a8

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