yuanbao-free-api  by chenwr727

OpenAI-compatible API for Tencent YuanBao models

Created 1 year ago
253 stars

Top 99.4% on SourcePulse

GitHubView on GitHub
Project Summary

YuanBao-Free-API provides an OpenAI-compatible interface to Tencent's YuanBao large language models. It targets developers seeking to integrate powerful Chinese AI models using familiar OpenAI API tooling, offering a simplified access layer for research and development. The project aims to bridge the gap between proprietary models and standard API ecosystems.

How It Works

The core innovation lies in its use of browser automation via Playwright. Upon service startup, it launches a headless browser, navigates to the Tencent YuanBao chat interface, and automatically handles QR code login. It then intercepts authentication headers (e.g., x-uskey) to enable requests to the YuanBao backend through an OpenAI-compatible REST API. This approach allows leveraging existing OpenAI client libraries and infrastructure for accessing models like DeepSeek and Tencent HunYuan.

Quick Start & Requirements

Installation involves cloning the repository, installing Python dependencies with pip install -r requirements.txt, and installing Playwright browsers with playwright install chromium. Environment variables, including API_KEYS, must be configured in a .env file. The service can be run locally using python app.py or deployed via Docker. A Python 3 environment and Playwright are the primary prerequisites.

Highlighted Details

  • Full compatibility with the OpenAI API specification.
  • Supports a range of DeepSeek (v3, r1) and Tencent HunYuan models, including versions with integrated network search capabilities.
  • Features streaming output for conversational responses.
  • Enables image and file uploads for multimodal interactions.
  • Automated browser login and authentication capture.
  • Offers ready-to-use deployment options via local Python execution or Docker.

Maintenance & Community

The project welcomes community contributions through GitHub Issues and Pull Requests. Specific community channels (like Discord or Slack) or active maintainer information are not detailed in the README.

Licensing & Compatibility

The project is released under the MIT License. However, it explicitly states it is for "learning and research purposes only" and prohibits commercial use. Users are warned of a potential risk of account bans on Tencent YuanBao due to the automated access methods employed.

Limitations & Caveats

This project is strictly for non-commercial, educational, and research applications. The automated access mechanism carries a significant risk of violating Tencent's terms of service and may lead to account suspension. Initial setup requires manual QR code scanning for authentication.

Health Check
Last Commit

3 months ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
1
Star History
8 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.