LMArenaBridge  by CloudWaddie

OpenAI-compatible API bridge for LM Arena models

Created 5 months ago
284 stars

Top 92.0% on SourcePulse

GitHubView on GitHub
Project Summary

This project provides an OpenAI-compatible API endpoint that bridges users to models hosted on LMArena, enabling integration with various applications and interfaces like OpenWebUI. It is designed for developers and power users seeking to leverage LMArena's diverse model catalog through a standardized API, simplifying access and deployment.

How It Works

The bridge acts as a proxy, exposing a local OpenAI-compatible API endpoint (http://localhost:8000/api/v1). It authenticates with LMArena by extracting a user's arena-auth-prod-v1 token from browser cookies. Requests are then forwarded to LMArena using httpx or an optional userscript proxy for enhanced reliability, particularly with models employing strict anti-bot measures. This approach allows seamless integration with existing OpenAI-ecosystem tools.

Quick Start & Requirements

  • Primary install/run command:
    • Clone the repository: git clone https://github.com/CloudWaddie/LMArenaBridge.git
    • Install dependencies: pip install -r requirements.txt
    • Run the server: python -m src.main
  • Prerequisites: Python 3.x. Requires obtaining an arena-auth-prod-v1 authentication token from the LMArena website by inspecting browser cookies.
  • Integration: Can be used as a backend for OpenWebUI by setting the API Base URL to http://localhost:8000/api/v1.

Highlighted Details

  • Image Support: Automatically uploads images to LMArena's R2 storage for vision-capable models.
  • Production Error Handling: Features comprehensive validation for requests, models, and images, along with robust handling for upload failures, timeouts, and rate limiting, all returning OpenAI-compatible error formats.
  • Security: Includes recommendations for API key management, rate limiting configuration, changing default admin passwords, and securing the API via HTTPS and firewalls.
  • Debug Mode: Offers detailed logging for debugging, which should be disabled in production.

Maintenance & Community

The project is noted as being "very hard to maintain" due to LMArena's implementation of Cloudflare checkpoints, captchas, and ReCAPTCHA enterprise protections. It acknowledges the "AI Leaks server" as a partner and is featured in "FMHY." No direct community links (e.g., Discord, Slack) are provided.

Licensing & Compatibility

The repository's README does not specify a software license. Consequently, compatibility for commercial use or linking within closed-source projects is undetermined.

Limitations & Caveats

The project's maintainability is severely impacted by LMArena's anti-bot measures, leading to potential instability and frequent breakage. Its functionality is entirely dependent on the continued accessibility and unchanged policies of the LMArena website. Experimental support for stealth models may also introduce unforeseen issues.

Health Check
Last Commit

1 week ago

Responsiveness

Inactive

Pull Requests (30d)
5
Issues (30d)
4
Star History
57 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.