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.8.1.tar.gz
.
File metadata
- Download URL: mirascope-1.8.1.tar.gz
- Upload date:
- Size: 1.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 097516b5ee7af11e6addf53c5622ad24408242cede672aee8b01263041e405dd |
|
MD5 | f4049d065676e847f8ff4d3f0cf27850 |
|
BLAKE2b-256 | 44fd5740a0ee1709b55f1d6a2b5ddc40c0accce14b11a505a95060428f153118 |
File details
Details for the file mirascope-1.8.1-py3-none-any.whl
.
File metadata
- Download URL: mirascope-1.8.1-py3-none-any.whl
- Upload date:
- Size: 256.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 | bcc6177523c82379bce2347ea8d1d0ed1990d7e16ed36a99ca9d97c658c887fa |
|
MD5 | 547cee0e44fd4f96735eb8270fd76d38 |
|
BLAKE2b-256 | 5d1adace0f64bb4e8453397eacc57db7d9dcde4bc5a44b1e0f8396c8aacee639 |