https://github.com/Mirascope/mirascope
LLM abstractions that aren't obstructions
https://github.com/Mirascope/mirascope
artificial-intelligence developer-tools function-calling hacktoberfest llm llm-agent llm-tools prompt-engineering pydantic-v2 python
Last synced: 8 days ago
JSON representation
LLM abstractions that aren't obstructions
- Host: GitHub
- URL: https://github.com/Mirascope/mirascope
- Owner: Mirascope
- License: mit
- Created: 2023-12-05T01:22:34.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-02T16:56:21.000Z (21 days ago)
- Last Synced: 2025-04-10T22:17:48.795Z (13 days ago)
- Topics: artificial-intelligence, developer-tools, function-calling, hacktoberfest, llm, llm-agent, llm-tools, prompt-engineering, pydantic-v2, python
- Language: Python
- Homepage: http://mirascope.com/
- Size: 97.8 MB
- Stars: 1,064
- Watchers: 15
- Forks: 74
- Open Issues: 23
-
Metadata Files:
- Readme: README.md
- Contributing: docs/CONTRIBUTING.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
- awesome-llm-json - Mirascope
- awesome-pydantic - Mirascope - Pythonic prompt engineering for developers built on Pydantic (Machine Learning)
- awesome-pydantic - Mirascope - Pythonic prompt engineering for developers built on Pydantic (Machine Learning)
- awesome-llmops - Mirascope - fast, efficient development and ensuring quality in LLM-based applications |  | (LLMOps / Observability)
README
---
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](https://openai.com/), [Anthropic](https://www.anthropic.com/), [Mistral](https://mistral.ai/), [Google (Gemini/Vertex)](https://googleapis.github.io/python-genai/), [Groq](https://groq.com/), [Cohere](https://cohere.com/), [LiteLLM](https://www.litellm.ai/), [Azure AI](https://azure.microsoft.com/en-us/solutions/ai), and [Bedrock](https://aws.amazon.com/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:
```bash
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:
```python
from mirascope import llm
from pydantic import BaseModelclass 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](https://mirascope.com/tutorials/getting_started/quickstart) 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](https://mirascope.com/learn) documentation.
## Versioning
Mirascope uses [Semantic Versioning](https://semver.org/).
## Licence
This project is licensed under the terms of the [MIT License](https://github.com/Mirascope/mirascope/blob/dev/LICENSE).