# aisuite **Repository Path**: RickieWen/aisuite ## Basic Information - **Project Name**: aisuite - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: DSWalkThru - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-12-30 - **Last Updated**: 2024-12-30 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # aimodels [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) Simple, unified interface to multiple Generative AI providers. ## Installation ```shell pip install aimodels ``` ## Set up This library provides a thin wrapper around python client libraries to interact with various Generative AI providers allowing creators to seamlessly swap out or test responses from a number of LLMs without changing their code. To get started you will need the API Keys for the providers you intend to use and install the provider specific library to use. The API Keys are expected to be in the host ENV and can be set manually or by using a tool such as [`python-dotenv`](https://pypi.org/project/python-dotenv/) or [`direnv`](https://direnv.net/). For example if you wanted to use Antrophic's Claude 3.5 Sonnet in addition to OpenAI's ChatGPT 4o you would first need to set the API keys: ```shell export ANTHROPIC_API_KEY="your-anthropic-api-key" export OPENAI_API_KEY="your-openai-api-key" ``` Install the respective client libraries: ```shell pip install openai anthropic ``` In your python code: ```python from aimodels.client import MultiFMClient models = ["openai:gpt-4o", "anthropic:claude-3-5-sonnet-20240620"] client = MultiFMClient() 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) ``` For more examples, check out the `examples` directory where you will find several notebooks that you can run to experiment with the interface. The current list of supported providers can be found in the `aimodels.providers` package. ## License aimodels is released under the MIT License. You are free to use, modify, and distribute the code for both commercial and non-commercial purposes. ## Contributing If you would like to contribute, please read our [Contributing Guide](CONTRIBUTING.md)