← all repositories
andrewyng/aisuite

One API to prompt them all

A thin Python wrapper that lets you swap GPT-4o for Claude or Gemini without touching your code.

15k stars Python Language ModelsAgents
aisuite
Velocity · 7d
+6.0
★ / day
Trend
steady
star history

What it does

aisuite is a lightweight Python library that normalizes chat completions across a dozen-odd LLM providers—OpenAI, Anthropic, Google, Mistral, Ollama, and others. You call client.chat.completions.create() with a provider:model string; it translates the request, fires the right SDK, and hands back a standardized response. The API surface deliberately apes OpenAI’s, so the learning curve is essentially flat.

The interesting bit

The library sneaks in lightweight agentic behavior through a single max_turns parameter. Pass it a list of raw Python functions (not JSON schemas) and aisuite will auto-generate tool schemas, execute the functions, and loop the results back to the model until the job is done or the turn limit hits. It also speaks MCP natively, so external tool servers plug in without boilerplate.

Key highlights

  • Switch models by changing one string: openai:gpt-4oanthropic:claude-3-5-sonnet-20240620
  • Auto tool execution: pass callables, not JSON specs; the library handles schema generation and the request loop
  • MCP support for connecting to external tool servers (filesystem, database, etc.) via config dict or reusable MCPClient
  • Modular provider architecture: drop a <provider>_provider.py file in the right directory to add a new backend
  • Optional extras install: aisuite[anthropic], aisuite[mcp], or aisuite[all] to keep dependencies minimal

Caveats

  • Not a full agent framework; max_turns is a convenience loop, not a planning or memory system
  • Provider SDKs and API keys are still your problem; the library doesn’t bundle them or manage authentication beyond passing through config

Verdict

Worth a look if you’re building prototypes that need to hop between models or providers without rewriting glue code. Skip it if you already have deep integrations with a single provider’s advanced features—this is abstraction, not augmentation.

Frequently asked

What is andrewyng/aisuite?
A thin Python wrapper that lets you swap GPT-4o for Claude or Gemini without touching your code.
Is aisuite open source?
Yes — andrewyng/aisuite is open source, released under the MIT license.
What language is aisuite written in?
andrewyng/aisuite is primarily written in Python.
How popular is aisuite?
andrewyng/aisuite has 15k stars on GitHub and is currently holding steady.
Where can I find aisuite?
andrewyng/aisuite is on GitHub at https://github.com/andrewyng/aisuite.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.