Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/cloudwaddie/lmarenabridge/llms.txt

Use this file to discover all available pages before exploring further.

LMArena Bridge is designed for long-running production deployments. This page covers the built-in error handling pipeline, how to enable debug logging, which metrics to monitor, and the security steps you should take before exposing the bridge on a network.

Error handling

LMArena Bridge includes comprehensive error handling for production use:
CategoryWhat it covers
Request validationJSON format, required fields, and data types
Model validationModel availability and access permissions
Image processingImage formats, sizes (max 10 MB), and MIME types
Upload failuresGraceful handling of image upload failures with retry logic
Timeout handlingConfigurable timeouts for all HTTP requests (30–120 s)
Rate limitingBuilt-in rate limiting per API key
Error responsesOpenAI-compatible error format for easy client integration

Debug mode

Debug mode is off by default in production. To enable it, set DEBUG = True in src/constants.py:
src/constants.py
# Set to True for detailed logging, False for minimal logging
DEBUG = True
When debug mode is on, you will see:
  • Detailed request/response logs
  • Image upload progress
  • Model capability checks
  • Session management details
Keep debug mode off in production. It increases log verbosity and can reduce performance.

Monitoring

Track these key metrics in production:
  • API response times — slow responses indicate timeout issues
  • Error rates — track 4xx/5xx errors from POST /api/v1/chat/completions
  • Model usage — the dashboard shows the top 10 most-used models
  • Image upload success — monitor image upload failures in logs

Security best practices

  1. API keys — use strong, randomly generated keys; the dashboard auto-generates secure keys
  2. Rate limiting — configure appropriate requests-per-minute (RPM) per API key in the dashboard
  3. Admin password — change the default admin password in config.json or through the dashboard
  4. HTTPS — place a reverse proxy (nginx, Caddy) with SSL in front of the bridge; see Configure a reverse proxy
  5. Firewall — restrict external access to port 8000

Default values

SettingValueSource
Server port8000PORT in src/constants.py
Request timeout120 secondsDEFAULT_REQUEST_TIMEOUT in src/constants.py
Default RPM60 requests per minuteDEFAULT_RATE_LIMIT_RPM in src/constants.py

Build docs developers (and LLMs) love