__ __ _______ _______ _______ ___ _______
| |_| || || || _ || | | |
| || _ || _____|| |_| || | | |
| || | | || |_____ | || | | |
| || |_| ||_____ || || | | _|
| ||_|| || | _____| || _ || | | |_
|_| |_||_______||_______||__| |__||___| |_______|
Mosaic is a lightweight Python library that extends the capabilities of the Instructor library for LLM-based tasks. Born out of a personal project to streamline repetitive processes in GenAI development, Mosaic aims to reduce overhead and simplify common operations in LLM/GenAI projects.
- Extends Instructor library functionality
- Simplifies common LLM-based tasks
- Reduces code repetition in GenAI projects
- Lightweight and easy to integrate
pip install ava-mosaic-ai
import ava_mosaic_ai
from pydantic import BaseModel
# Initialize LLM
llm = ava_mosaic_ai.get_llm("openai")
# Define response model
class ResponseModel(BaseModel):
response: str
# Use Mosaic's simplified interface
response = llm.create_completion(
response_model=ResponseModel,
messages=[{"role": "user", "content": "Tell me a joke about AI"}],
)
print(response)
For full documentation, visit our docs site.
We welcome contributions! Please see our Contributing Guide for more details.
- Add support for more LLM providers
- Implement advanced prompt engineering tools
- Develop a CLI for quick prototyping
- A heartfelt shoutout to @daveebbelaar for his implementation of
llm_factory
, which inspired this project. Check out his work here. - Immense gratitude to the creators of the Instructor library. Their work has saved countless hours in GenAI project development.
Mosaic is released under the MIT License. See the LICENSE file for details.
Built with ❤️ by [karan Singh Kochar]