About Compere
A small library and HTTP service that turns “A or B?” votes into rankings, intelligently.
What it is
Compere is an open-source project from Skelf-Research.
It ships as a Python 3.11+ package on PyPI (pip install compere) and as a
FastAPI server with an interactive /docs endpoint. The same code can be embedded
as a library or run as a service backed by SQLite (default) or PostgreSQL.
What is actually inside
The repository contains exactly these algorithm modules:
mab.py— Upper Confidence Bound (UCB1) for picking the next pair to compare. Configurable viaUCB_EXPLORATION_CONSTANT(default1.414) andUCB_UNEXPLORED_WEIGHT(default1000.0).rating.py— Elo updates with configurable K-factor (ELO_K_FACTOR=32) and initial rating (ELO_INITIAL_RATING=1500).similarity.py— An alternative pairing strategy that selects similar entities for comparison instead of UCB-optimal ones.
That is the whole inference stack. There is no Bradley-Terry estimator, no Thurstone Case V, no TrueSkill / Glicko, no neural ranker. If you need those, compere is the wrong tool and we are happy to point you elsewhere.
HTTP surface
Eleven endpoints, all visible at http://localhost:8090/docs when running:
- Entities:
POST /entities/,GET /entities/,GET/PUT/DELETE /entities/{id} - Comparisons:
POST /comparisons/,GET /comparisons/ - Pair selection:
GET /mab/next_comparison,GET /comparisons/next - Ratings:
GET /ratings - Health:
GET /health,GET /health/ready
Deployment
A Dockerfile and docker-compose.yml ship in the repo. Optional
knobs include JWT authentication (AUTH_ENABLED), CORS origins, and request
rate limiting; all are off by default.
License and source
MIT. The source of truth is github.com/skelf-research/compere. Authoritative documentation lives at docs.skelfresearch.com/compere/.
Who built it
Skelf-Research is a small research group that publishes practical, narrowly-scoped tooling. Compere is one of those tools. If you have questions or want to contribute, issues and pull requests on the GitHub repository are the canonical channel.