Compere¶
A comparative rating system using Multi-Armed Bandit algorithms and Elo ratings.
Compere is a dual-purpose system that operates both as a standalone web service (FastAPI) and as a Python library. It combines the proven Elo rating system with intelligent Multi-Armed Bandit (MAB) algorithms to efficiently rank entities through pairwise comparisons.
Features¶
- Elo Rating System - Dynamic rating updates based on pairwise comparisons
- Multi-Armed Bandit (UCB) - Intelligent entity selection with exploration/exploitation balance
- REST API - Full-featured FastAPI backend with OpenAPI documentation
- Python Library - Direct integration without running a separate server
- Vue.js Demo UI - Interactive interface for simulations and demonstrations
- Database Flexibility - Supports SQLite, PostgreSQL, and MySQL
- Production Ready - Docker support, rate limiting, authentication, and more
Quick Start¶
Once running, visit http://localhost:8090/docs for the interactive API documentation.
Use Cases¶
| Scenario | Description |
|---|---|
| Product Rankings | Compare products based on user preferences |
| Content Moderation | Rank content quality through human evaluation |
| A/B Testing | Compare variations using pairwise judgments |
| Recommendation Systems | Build preference models from comparisons |
| Survey Research | Collect comparative preference data |
| Gaming/Esports | Maintain player or team rankings |
How It Works¶
graph LR
A[Get Next Pair] --> B[UCB Algorithm]
B --> C[User Compares]
C --> D[Update Elo Ratings]
D --> E[Update MAB State]
E --> A
- UCB Algorithm selects the optimal pair for comparison
- User/evaluator makes a comparison decision
- Elo ratings are updated based on the outcome
- MAB state is updated to improve future pair selection
- Repeat until ratings converge
Documentation¶
-
:material-rocket-launch:{ .lg .middle } Getting Started
Install Compere and run your first comparison
-
:material-api:{ .lg .middle } API Reference
Complete REST API endpoint documentation
-
:material-language-python:{ .lg .middle } Library Usage
Use Compere as a Python library
-
:material-cog:{ .lg .middle } Configuration
Environment variables and options
-
:material-chart-line:{ .lg .middle } Algorithms
How Elo and MAB algorithms work
-
:material-docker:{ .lg .middle } Deployment
Docker, production setup, and troubleshooting
License¶
MIT License - Copyright (c) 2025 Skelf Research