LLM abstractions that aren't obstructions
Project description
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
Built Distribution
File details
Details for the file mirascope-1.5.2.tar.gz
.
File metadata
- Download URL: mirascope-1.5.2.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b7d79baa861bbe26d6e7e5a3e9d4e1bb4cd1e72c6dde14179a0feec14f0d55e |
|
MD5 | 9a7f05e649c33dbd4da7938bb32dec19 |
|
BLAKE2b-256 | 2b690d0804a250427bc4275f92f5e019f1b2fd73c201a3bd54a1b8905ecca7b5 |
File details
Details for the file mirascope-1.5.2-py3-none-any.whl
.
File metadata
- Download URL: mirascope-1.5.2-py3-none-any.whl
- Upload date:
- Size: 236.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb6d5c33a49400f75a3d6b9cd6949661f9d39d6313be3cd91c9bc06b9d58d06c |
|
MD5 | 00a7fb2b1ba1fe1b671c54e207b12172 |
|
BLAKE2b-256 | ce74e4cab2304cdef6c88889eeb1c8b2c3550240bed8035d70df507483356400 |