Announcing aisuite: An Open-source Python package designed to simplify the use and comparison of multiple large language models (LLMs). Developed under the visionary leadership of Andrew Ng, aisuite aims to provide developers with a unified, intuitive interface for working with the world’s most popular LLMs. Whether you’re building a chatbot, crafting advanced NLP solutions, or diving into multi-agent systems, aisuite offers the tools you need to streamline your workflow.
Why aisuite?
The proliferation of large language models like OpenAI’s GPT, Anthropic’s Claude, Cohere’s Command, and others has created an exciting ecosystem of capabilities, each with unique strengths and weaknesses. However, the diversity of APIs and usage paradigms often poses a challenge for developers who wish to experiment with or integrate multiple models seamlessly.
aisuite bridges this gap by providing a standardized interface that feels familiar, especially if you’ve worked with OpenAI’s API. With aisuite, developers can easily interact with multiple LLMs, compare their results, and leverage the strengths of each model in a unified workflow.
Key Features of aisuite
- Unified Interface:
Use a single API format for accessing different LLMs, eliminating the need to learn separate syntax for each provider. - Easy Model Comparisons:
Quickly switch between models and evaluate their outputs side-by-side, making it effortless to determine which model performs best for a specific use case. - Seamless Integration:
Incorporates plug-and-play functionality, enabling you to scale projects from experimentation to deployment without rewriting code. - Multi-Agent Development:
Support for creating and managing multi-agent systems, where different LLMs or instances of the same model can collaborate, compete, or specialize in specific tasks. - Open Source and Extensible:
As an open-source project, aisuite encourages community contributions and is flexible enough to adapt to emerging LLMs and developer needs.
Installation
pip install aisuite
Short example (credit to Andrew Yg : https://github.com/andrewyng/aisuite)
Set the API keys.
export OPENAI_API_KEY="your-openai-api-key"
export ANTHROPIC_API_KEY="your-anthropic-api-key"
Use the python client.
import aisuite as ai
client = ai.Client()
models = ["openai:gpt-4o", "anthropic:claude-3-5-sonnet-20240620"]messages = [
{"role": "system", "content": "Respond in Pirate English."},
{"role": "user", "content": "Tell me a joke."},
]for model in models:
response = client.chat.completions.create(
model=model,
messages=messages,
temperature=0.75
)
print(response.choices[0].message.content)