andrewyng/aisuite
OpenWorker
A desktop AI coworker, built on aisuite — now in its own repository: andrewyng/openworker.
OpenWorker chats, does deep research, and carries out real tasks on your computer — reading files with permission, connecting to Slack/email, producing PDFs, documents, and spreadsheets, and running scheduled automations. Bring your own API key (OpenAI, Anthropic, Google) or run fully local with Ollama; your data stays on your machine.
⬇ Download for macOS macOS 13+ (Apple Silicon) · ⬇ Download for Windows Windows 10/11 (x64) · Quickstart
OpenWorker development has moved to the new repo. A snapshot of its source remains here under
platform/for now and will be removed in a future release.
aisuite
aisuite is a lightweight Python library for building with LLMs, in two layers: a unified Chat Completions API across providers, and an Agents API with tools and toolkits on top. aisuite also powers OpenWorker, a desktop AI coworker developed in its own repository:
|
|
- Chat Completions API — a unified, OpenAI-style interface for OpenAI, Anthropic, Google, Mistral, Hugging Face, AWS, Cohere, Ollama, OpenRouter, Requesty, and more. Swap providers by changing one string.
- Agents API · Toolkits · MCP — give models real Python functions as tools, run multi-turn loops, attach ready-made toolkits (files, git, shell) or any MCP server, and govern it all with tool policies.
- OpenWorker — a desktop AI coworker built using aisuite, shipped as an app for everyday tasks. Developed in its own repository.
Installation
Install the base package, or include the SDKs of the providers you plan to use:
|
|
You’ll also need API keys for the providers you call — the Chat Completions quickstart covers key setup and your first calls.
Looking for the OpenWorker desktop app? Downloads are on its releases page.
Chat Completions — one API across providers
The chat API provides a high-level abstraction for model interactions. It supports all core parameters (temperature, max_tokens, tools, etc.) in a provider-agnostic way, and standardizes request and response structures so you can focus on logic rather than SDK differences.
Model names use the format <provider>:<model-name>; aisuite routes the call to the right provider with the right parameters:
|
|
→ Quickstart: docs/chat-completions-quickstart.md — install, key setup, local models, and more examples.
Streaming
Pass stream=True to get an iterator of OpenAI-shaped chunks from any supporting provider (OpenAI, Anthropic, Ollama, and OpenAI-compatible endpoints) — the same loop works across all of them:
|
|
The async variant is await client.chat.completions.acreate(..., stream=True), iterated with async for. Tool calls stream too: schema dicts and callables are passed to the model as usual, and the chunks carry incremental delta.tool_calls fragments for you to assemble and execute (streaming is manual tool calling — it can’t be combined with max_turns).
Agents — give models real tools
aisuite turns tool calling into a one-liner: pass plain Python functions and it generates the schemas, executes the calls, and feeds results back to the model.
Tool calling with max_turns
|
|
With max_turns set, aisuite sends your message, executes any tool calls the model requests, returns the results to the model, and repeats until the conversation completes. response.choices[0].intermediate_messages carries the full tool interaction history if you want to continue the conversation.
Prefer full manual control? Omit max_turns and pass OpenAI-format JSON tool specs — aisuite returns the model’s tool-call requests and you run the loop yourself. See examples/tool_calling_abstraction.ipynb for both styles.
The Agents API
For longer-running, structured work there is a first-class Agents API: declare an agent once, run it with a Runner, and attach toolkits — prebuilt, sandboxed tool families for files, git, and shell:
|
|
The Agents API also gives you the pieces a production harness needs:
- Tool policies —
RequireApprovalPolicy, allow/deny lists, or your own callable deciding which tool calls run. - State stores — persist and resume runs (in-memory, file, or Postgres) and continue conversations across processes.
- Artifacts & tracing — capture what an agent produced and every step it took along the way.
MCP tools
aisuite natively supports the Model Context Protocol, so any MCP server’s tools can be handed to a model without boilerplate (pip install 'aisuite[mcp]'):
|
|
For reusable connections, security filters, and tool prefixing, use the explicit MCPClient.
→ Quickstart: docs/agents-quickstart.md — manual tool handling, the full Agents API, policies, state stores, and MCP in depth.
Extending aisuite: Adding a Provider
New providers can be added by implementing a lightweight adapter. The system uses a naming convention for discovery:
| Element | Convention |
|---|---|
| Module file | <provider>_provider.py |
| Class name | <Provider>Provider (capitalized) |
Example:
|
|
This convention ensures consistency and enables automatic loading of new integrations.
Contributing
Contributions are welcome. Please review the Contributing Guide and join our Discord for discussions.
License
Released under the MIT License — free for commercial and non-commercial use.