Repolode
andrewyng

andrewyng/aisuite

A lightweight Python library that gives one OpenAI-style API across many LLM providers, plus an Agents API with tools and MCP support.

Stars
16,353
Forks
1,734
Open issues
161
Last commit
last month

What is it?

aisuite is a Python library for calling large language models from many providers through one interface. Models are named as <provider>:<model-name>, so switching between OpenAI, Anthropic, Google, Ollama and other supported providers means changing a single string. Requests and responses share one structure, and core parameters such as temperature and max_tokens work the same way across providers.

On top of the chat layer, aisuite can turn plain Python functions into tools: it generates the schemas, runs the calls and feeds results back to the model in a loop controlled by max_turns. For longer tasks there is an Agents API with a Runner, prebuilt file, git and shell toolkits, tool approval policies, state stores for resuming runs, and native support for Model Context Protocol (MCP) servers.

The project also includes streaming (sync and async) and a documented way to add new providers through a simple adapter class.

Key features

  • 01Unified chat completions API across multiple LLM providers, switched by a model string.
  • 02Streaming output for sync and async calls, including tool call fragments.
  • 03Python functions can be passed as tools, with automatic schema generation and a multi-turn loop.
  • 04Agents API with a Runner, prebuilt files/git/shell toolkits, and tool approval policies.
  • 05Native MCP support so any MCP server's tools can be given to a model.
  • 06Extensible provider adapters following a simple naming convention.

Use cases

  • Comparing or failing over between OpenAI, Anthropic and other providers without rewriting application code.
  • Building a Python tool-using assistant that calls local functions or MCP servers.
  • Prototyping a multi-step agent that works on a code repository's files and git history.
  • Running the same prompts against local Ollama models and hosted APIs.

Quick start

  1. 1

    Install the base aisuite package from PyPI

    pip install aisuite
  2. 2

    Install the SDK for the provider you plan to use (for example Anthropic)

    pip install 'aisuite[anthropic]'
  3. 3

    Set up API keys for your providers, following the Chat Completions quickstart

  4. 4

    Create a client and call a model using the provider:model format

Things to know

  • You need API keys from the model providers you call, so there is setup work before first use.
  • Some features such as the Agents API and MCP tools need extra installs or are described as separate concepts in the README.
  • OpenWorker, the desktop app built on aisuite, has moved to its own repository.

Topics

FAQ

What is aisuite?
A lightweight Python library that gives one OpenAI-style API across many LLM providers, plus an Agents API with tools and MCP support. aisuite is a Python library for calling large language models from many providers through one interface. Models are named as <provider>:<model-name>, so switching between OpenAI, Anthropic, Google, Ollama and other supported providers means changing a single string. Requests and responses share one structure, and core parameters such as temperature and max_tokens work the same way across providers.
Is aisuite free to use? What license does it have?
aisuite is open source under the MIT license. Check the license terms before using it in commercial products.
Is aisuite still maintained?
Updated within 6 months. The last commit to aisuite was on Sep 18, 2026.
What can I use aisuite for?
Comparing or failing over between OpenAI, Anthropic and other providers without rewriting application code. Building a Python tool-using assistant that calls local functions or MCP servers. Prototyping a multi-step agent that works on a code repository's files and git history. Running the same prompts against local Ollama models and hosted APIs.
How do I install aisuite?
Install the base aisuite package from PyPI: pip install aisuite Install the SDK for the provider you plan to use (for example Anthropic): pip install 'aisuite[anthropic]' Set up API keys for your providers, following the Chat Completions quickstart Create a client and call a model using the provider:model format
Where can I get aisuite?
The source code and installation instructions are on GitHub: https://github.com/andrewyng/aisuite

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects