Scripts2026年5月21日·1 分钟阅读

AISuite — Unified Interface to Multiple Generative AI Providers

AISuite provides a simple, consistent Python API for calling large language models from OpenAI, Anthropic, Google, Mistral, and other providers. Switch between models by changing a single string parameter without rewriting application logic.

Agent 就绪

这个资产可以被 Agent 直接读取和安装

TokRepo 同时提供通用 CLI 命令、安装契约、metadata JSON、按适配器生成的安装计划和原始内容链接,方便 Agent 判断适配度、风险和下一步动作。

Stage only · 29/100Stage only
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Stage only
信任
信任等级:Established
入口
AISuite Overview
通用 CLI 安装命令
npx tokrepo install f992e8bc-54ae-11f1-9bc6-00163e2b0d79

Introduction

AISuite is a lightweight Python library created by Andrew Ng that standardizes the interface for calling generative AI models across multiple providers. It follows the OpenAI chat completions API pattern, making it trivial to swap providers during development, testing, or production without altering application code.

What AISuite Does

  • Provides a unified chat completions API across OpenAI, Anthropic, Google, AWS Bedrock, Mistral, and more
  • Uses a provider:model string format for instant model switching
  • Handles provider-specific authentication and request formatting transparently
  • Supports streaming responses and function calling where providers allow
  • Maintains minimal dependencies to avoid version conflicts

Architecture Overview

AISuite implements a thin adapter layer where each AI provider has a corresponding provider class that translates the unified API calls into provider-specific HTTP requests. The Client object routes requests based on the provider prefix in the model string, loads credentials from environment variables, and returns responses in a normalized format matching the OpenAI response schema.

Self-Hosting & Configuration

  • Install via pip with optional provider extras: pip install aisuite[anthropic]
  • Set API keys as environment variables (OPENAI_API_KEY, ANTHROPIC_API_KEY, etc.)
  • Configure custom base URLs for self-hosted or proxy endpoints
  • No server component needed; runs entirely as a client library
  • Compatible with Python 3.9+ and integrates with existing async frameworks

Key Features

  • Single import replaces multiple provider SDKs in your codebase
  • Provider:model string notation makes A/B testing across models straightforward
  • Automatic retry and error handling with provider-specific rate limit awareness
  • Extensible provider system for adding custom or local LLM endpoints
  • Lightweight with no heavy ML framework dependencies

Comparison with Similar Tools

  • LiteLLM — more comprehensive proxy server with 100+ model support; AISuite is lighter and library-only
  • LangChain — full application framework with agents and chains; AISuite focuses solely on the model call interface
  • OpenRouter — hosted routing service; AISuite runs locally without external dependencies
  • Portkey — enterprise gateway with caching and fallbacks; AISuite is a simpler client-side abstraction

FAQ

Q: Does AISuite add latency to API calls? A: No, it adds negligible overhead since it only translates parameters and passes through to the provider SDK or HTTP client.

Q: Can I use it with local models like Ollama? A: Yes, AISuite supports custom endpoints so you can point it at any OpenAI-compatible API server.

Q: Is streaming supported for all providers? A: Streaming is supported where the underlying provider API offers it. Check provider-specific documentation for availability.

Q: Who maintains AISuite? A: The project was created by Andrew Ng and is maintained as an open-source community project.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产