qwen2API  by YuJunZhiXue

Qwen chat and image generation API gateway

Created 3 weeks ago

New!

590 stars

Top 54.8% on SourcePulse

GitHubView on GitHub
Project Summary

A project that bridges the gap between the Qwen web interface and standard AI API protocols, qwen2API offers a self-hosted gateway for developers needing OpenAI, Anthropic Claude, or Gemini compatible endpoints. It empowers users to leverage Qwen's capabilities, including advanced tool calling and image generation, within their existing AI workflows without direct reliance on proprietary SDKs. The primary benefit is enhanced flexibility and integration for applications interacting with Qwen models.

How It Works

The system employs a FastAPI backend and a React/Vite frontend, architected around a hybrid engine that can utilize browser automation (Camoufox) or HTTPX for interacting with the chat.qwen.ai web service. This approach allows for compatibility with various API standards by translating requests and responses. Key features include an account pool for managing multiple Qwen logins, dynamic rate limiting, automatic retries, and a robust tool-calling parser, aiming to mimic real user interactions for greater stability and feature support.

Quick Start & Requirements

  • Primary Install: Docker Compose is the recommended method for production and testing. A local source installation requires Python 3.12+ and Node.js 20+.
  • Prerequisites: Docker, Python 3.12+, Node.js 20+ (for local development). The Docker image includes necessary browser components.
  • Resource Footprint: Docker deployment requires sufficient memory for the browser engine (shm_size configurable, default 256m). Local development setup involves installing backend and frontend dependencies.
  • Links: Project GitHub repository (implied by URL).

Highlighted Details

  • Multi-API Compatibility: Supports OpenAI Chat Completions (/v1/chat/completions), Anthropic Messages (/anthropic/v1/messages), and Gemini GenerateContent (/v1beta/models/{model}:generateContent) interfaces.
  • Tool Calling & Image Generation: Implements robust tool-calling parsing and provides an OpenAI-compatible image generation endpoint (/v1/images/generations) powered by Qwen's underlying capabilities.
  • Hybrid Execution Engine: Offers hybrid, httpx, and browser modes, with hybrid recommended for balancing speed and fidelity.
  • WebUI Management Console: Includes an integrated admin interface for managing accounts, API keys, testing endpoints, and monitoring service status.

Maintenance & Community

No specific details regarding maintainers, community channels (like Discord/Slack), or roadmap are provided in the README.

Licensing & Compatibility

The project is released under the MIT License, permitting broad use, modification, and distribution. However, the project explicitly states it is not an official service and users are responsible for adhering to upstream service terms, legal regulations, and data security requirements. Commercial use is permitted under MIT terms, but users must ensure compliance with Qwen's terms of service.

Limitations & Caveats

This project acts as a compatibility layer and does not provide official Qwen commercial services. Users bear full responsibility for any account restrictions, legal issues, or data loss resulting from its use. The effectiveness and stability depend on the underlying Qwen web interface and the user's account status.

Health Check
Last Commit

1 week ago

Responsiveness

Inactive

Pull Requests (30d)
17
Issues (30d)
29
Star History
601 stars in the last 26 days

Explore Similar Projects

Feedback? Help us improve.