aisuite is a Python library that provides a unified interface for interacting with multiple generative AI providers through two core layers: a Chat Completions API and an Agents API. The library abstracts away provider-specific differences, allowing developers to swap between services like OpenAI, Anthropic, Google, Mistral, Hugging Face, AWS, Cohere, Ollama, OpenRouter, and others by changing a single string in their code. This unified approach eliminates the friction of learning and maintaining separate SDKs for each provider.
The Chat Completions API layer implements an OpenAI-style interface that standardizes request and response structures across all supported providers. It handles core parameters like temperature, max_tokens, and tools in a provider-agnostic way, enabling developers to focus on application logic rather than SDK differences. Model names follow a simple format of provider:model-name, which aisuite uses to route calls to the appropriate provider with correctly formatted parameters. The API supports streaming across compatible providers including OpenAI, Anthropic, Ollama, and OpenAI-compatible endpoints, with tool calls streaming as incremental delta fragments that developers can assemble and execute manually.
The Agents API layer builds on top of Chat Completions to enable more sophisticated interactions. It simplifies tool calling by accepting plain Python functions, automatically generating schemas, executing calls, and feeding results back to the model. The max_turns parameter enables autonomous multi-turn loops where aisuite handles the entire cycle of sending messages, executing tool calls, and continuing until completion. For developers preferring manual control, the library also supports traditional OpenAI-format JSON tool specifications. The Agents API includes production-ready features such as tool policies for controlling which calls execute, state stores for persisting and resuming runs across processes, and artifact tracking for capturing agent outputs and execution traces.
aisuite natively supports the Model Context Protocol, allowing any MCP server's tools to be handed to models without boilerplate code. The library includes prebuilt toolkits for common tasks like file operations, git interactions, and shell commands, all sandboxed for safety. These toolkits can be attached to agents and governed through configurable policies including approval requirements and allow/deny lists.
The repository demonstrates active development with a clear architecture for extensibility. New providers can be added by implementing lightweight adapters following a naming convention, with module files named as provider_provider.py and classes named as ProviderProvider. This convention enables automatic discovery and loading of new integrations. The library is released under the MIT License for both commercial and non-commercial use.
aisuite also powers OpenWorker, a desktop AI coworker application that has been developed in its own separate repository. OpenWorker uses aisuite's capabilities to provide a desktop application for everyday tasks, with support for bringing your own API keys from major providers or running fully local with Ollama. The OpenWorker source code snapshot remains in the aisuite repository under the platform directory for now but will be removed in a future release as development has moved to the dedicated repository.