compere

FAQ

Frequently asked questions

Straight answers about what compere does, how to run it, and where it fits.

What is compere in one sentence?

compere is an open-source Python package and FastAPI service that ranks items from pairwise “A or B?” votes, using a UCB1 bandit to choose pairs and Elo to score them.

What algorithms does it use?

Exactly two: UCB1 (Upper Confidence Bound) for adaptive pair selection and Elo for rating updates. It does not implement Bradley-Terry, Thurstone Case V, TrueSkill, Glicko, or any neural ranker.

How do I install and run it?

Run “pip install compere” (or “uv add compere”), then “compere --port 8090”. Interactive OpenAPI docs are served at /docs. A Dockerfile and docker-compose.yml also ship in the repository.

Which databases are supported?

Persistence is via SQLAlchemy. SQLite is the default (sqlite:///./compere.db) and needs no setup; PostgreSQL is supported by setting DATABASE_URL. The same code runs on either.

Can I use compere without running a server?

Yes. Import compere.modules and call create_entity, create_comparison, and get_ratings directly. This is convenient for offline studies and notebooks.

How many votes do I need for a good ranking?

It depends on how many entities you have and how close they are. Because UCB concentrates votes on uncertain pairs, you typically need far fewer than the exhaustive n(n-1)/2. Watch the leaderboard stabilise and apply a stopping rule rather than targeting a fixed count.

What are the default Elo and UCB parameters?

Elo: K-factor 32 (ELO_K_FACTOR), initial rating 1500 (ELO_INITIAL_RATING). UCB: exploration constant c = 1.414 (UCB_EXPLORATION_CONSTANT), unexplored weight 1000.0 (UCB_UNEXPLORED_WEIGHT). All are configurable.

Does compere handle authentication and rate limiting?

Optionally. JWT auth (AUTH_ENABLED + SECRET_KEY), CORS origins (CORS_ORIGINS), and request rate limiting are all available but off by default.

How is compere different from a plain Elo library?

A plain Elo library gives you the rating update and nothing else — you decide which pair to compare. compere adds UCB pair selection, persistence, a leaderboard, and an HTTP API. See the comparison page for details.

How is it different from AHP ranking tools?

AHP tools model multi-criteria decisions with weighted criteria and exhaustive pairwise matrices. compere is a single-dimension ranking tool that uses adaptive pair selection to avoid the exhaustive step.

What license is compere under?

MIT. The source is at github.com/skelf-research/compere and the documentation at docs.skelfresearch.com/compere/.

Still have a question?

Tell us what you're comparing and we'll help you figure out the fit.

Contact us →