simple-one-api  by fruitbars

API adapter for OpenAI-compatible endpoints

created 1 year ago
2,198 stars

Top 21.0% on sourcepulse

GitHubView on GitHub
Project Summary

This project provides a unified API gateway for various Chinese large language models, abstracting away individual API differences and offering a single, OpenAI-compatible endpoint. It targets developers and users who want to easily integrate and switch between multiple LLMs, particularly those offering free tiers or requiring complex setup.

How It Works

The project acts as a reverse proxy, forwarding requests to different LLM providers based on configuration. It supports multiple models from providers like Xunfei, Baidu Qianfan, Tencent Hunyuan, and others, mapping their unique APIs to the standard OpenAI format. This approach simplifies integration by presenting a consistent interface, even for models with subtle API variations.

Quick Start & Requirements

  • Install: Download pre-compiled binaries from the Releases page or build from source using Go 1.21+.
  • Run: Execute ./simple-one-api (Linux/macOS) or simple-one-api.exe (Windows), optionally specifying a config file path. Docker images are also available.
  • Prerequisites: Go 1.21+ for building. Configuration requires API keys and credentials for each desired LLM provider.
  • Docs: https://github.com/fruitbars/simple-one-api/tree/main/docs

Highlighted Details

  • Supports over 15 LLM providers, including major Chinese models and international options like Groq and Llama Family.
  • Offers features like load balancing across multiple models or API keys for a single model, model name redirection, and per-service rate limiting (QPS/QPM).
  • Includes compatibility for models that don't natively support the system prompt by prepending it to the first user prompt.
  • Provides a web UI for configuration generation.

Maintenance & Community

The project is actively maintained with regular updates. A community chat is available for discussion and support.

Licensing & Compatibility

The project is licensed under the MIT License, allowing for commercial use and integration with closed-source applications.

Limitations & Caveats

While aiming for broad compatibility, specific model integrations might still have subtle differences or require custom configuration. The project relies on the continued availability and adherence to OpenAI-like interfaces by the supported LLM providers.

Health Check
Last commit

1 month ago

Responsiveness

1 day

Pull Requests (30d)
0
Issues (30d)
2
Star History
71 stars in the last 90 days

Explore Similar Projects

Starred by Tobi Lutke Tobi Lutke(Cofounder of Shopify), Chip Huyen Chip Huyen(Author of AI Engineering, Designing Machine Learning Systems), and
15 more.

litellm by BerriAI

1.9%
27k
SDK/proxy for calling 100+ LLM APIs using the OpenAI format
created 2 years ago
updated 19 hours ago
Feedback? Help us improve.