andrewyng/aisuite

Simple, unified interface to multiple Generative AI providers

What it solves

aisuite is a lightweight Python library designed to simplify building with Large Language Models (LLMs) by removing the friction of dealing with multiple different provider SDKs. It provides a unified interface for interacting with various AI models and a higher-level framework for creating agents that can use tools.

How it works

The library is structured in two primary layers:

  1. Chat Completions API: A unified, OpenAI-style interface that allows developers to switch between providers (such as OpenAI, Anthropic, Google, Mistral, and Ollama) by simply changing a model string (e.g., openai:gpt-4o to anthropic:claude-3-5-sonnet). It standardizes request and response structures across these different services.
  2. Agents API: A layer built on top of the chat API that enables the creation of agents. It allows developers to pass plain Python functions as tools, which the library automatically converts into schemas and executes. It supports multi-turn loops via a max_turns parameter and includes prebuilt toolkits for files, git, and the shell.

Additionally, it supports the Model Context Protocol (MCP) for integrating external tools without boilerplate code.

Who it’s for

Python developers building AI applications or agents who want to avoid vendor lock-in and easily experiment with different LLM providers without rewriting their integration code.

Highlights

  • Unified API: One interface for a wide array of providers including OpenAI, Anthropic, Google, Mistral, Hugging Face, AWS, Cohere, Ollama, and OpenRouter.
  • Automated Tool Calling: Converts Python functions directly into tools and manages the execution loop automatically.
  • Agentic Framework: Includes a Runner for structured work, tool policies for security (e.g., approval policies), and state stores for persisting conversations.
  • MCP Support: Native integration with the Model Context Protocol for easy tool expansion.
  • Extensible: New providers can be added via a simple adapter pattern.

Related

  • Project
  • Project
  • Project
  • Project
  • Project