aisuite  by andrewyng

Unified interface for multiple generative AI providers

created 1 year ago
12,330 stars

Top 4.1% on sourcepulse

GitHubView on GitHub
Project Summary

This library provides a unified interface for interacting with multiple Generative AI providers, simplifying LLM integration for developers. It offers a standardized API, similar to OpenAI's, allowing users to easily switch between and compare responses from various LLMs without code modifications.

How It Works

aisuite acts as a thin wrapper around provider-specific Python client libraries or HTTP endpoints. It uses a convention-based system for loading provider implementations, enabling seamless integration of new LLM services. The core advantage lies in its abstraction layer, which standardizes requests and responses, making it simple to swap providers and test different models.

Quick Start & Requirements

  • Install with pip install aisuite or pip install 'aisuite[provider_name]' or pip install 'aisuite[all]'.
  • Requires API keys for desired providers, configurable via environment variables or client constructor.
  • See examples folder for usage: examples

Highlighted Details

  • Supports Anthropic, AWS, Azure, Cerebras, Google, Groq, HuggingFace, Ollama, Mistral, OpenAI, Sambanova, and Watsonx.
  • Standardized chat completions interface, with plans to expand to other use cases.
  • Offers a simple abstraction for tool/function calling, supporting both manual handling and automatic execution.
  • Model names are specified as <provider>:<model-name> (e.g., openai:gpt-4o).

Maintenance & Community

  • Open to contributions; see Contributing Guide.
  • Discord server available for community interaction.

Licensing & Compatibility

  • MIT License, permitting commercial and non-commercial use, modification, and distribution.

Limitations & Caveats

The library is primarily focused on chat completions, with other use cases planned for future expansion.

Health Check
Last commit

3 days ago

Responsiveness

1 week

Pull Requests (30d)
10
Issues (30d)
1
Star History
410 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.