Rapidata leaderboard
RapidataLeaderboard #
RapidataLeaderboard(
name: str,
instruction: str,
show_prompt: bool,
show_prompt_asset: bool,
inverse_ranking: bool,
response_budget: int,
min_responses_per_matchup: int,
benchmark_id: str,
id: str,
openapi_service: OpenAPIService,
included_tags: list[str] | None = None,
excluded_tags: list[str] | None = None,
)
An instance of a Rapidata leaderboard.
Used to interact with a specific leaderboard in the Rapidata system, such as retrieving prompts and evaluating models.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name that will be used to identify the leaderboard on the overview. |
required |
instruction
|
str
|
The instruction that will determine what how the models will be evaluated. |
required |
show_prompt
|
bool
|
Whether to show the prompt to the users. |
required |
id
|
str
|
The ID of the leaderboard. |
required |
openapi_service
|
OpenAPIService
|
The OpenAPIService instance for API interaction. |
required |
included_tags
|
list[str] | None
|
The prompt tag values the leaderboard restricts its matchups to. |
None
|
excluded_tags
|
list[str] | None
|
The prompt tag values the leaderboard skips when building matchups. |
None
|
Source code in src/rapidata/rapidata_client/benchmark/leaderboard/rapidata_leaderboard.py
response_budget
property
#
The leaderboard's response budget — the total number of comparison responses collected per model evaluation.
This is the raw number behind :attr:level_of_detail; read it when you need
the exact budget rather than the named level (which is "custom" for
budgets that don't match a named level).
level_of_detail
property
writable
#
The level of detail of the leaderboard.
This is a friendly name for the leaderboard's :attr:response_budget — the
total number of comparison responses collected per model evaluation. A larger
budget buys more matchups and therefore more precise standings, at the cost
of a slower and more expensive evaluation. The named levels map to these
budgets: 'debug' (20), 'low' (2,000), 'medium' (4,000),
'high' (8,000), 'very high' (16,000). Any other budget reads back as
'custom' — use :attr:response_budget to get the exact number.
min_responses_per_matchup
property
writable
#
Returns the minimum number of responses required to be considered for the leaderboard.
show_prompt_asset
property
#
Returns whether the prompt asset is shown to the users.
included_tags
property
#
The prompt tag values this leaderboard restricts its matchups to.
Only benchmark prompts carrying at least one of these tags are used to build matchups; an empty list (the default) means no restriction. Fixed at creation — to re-scope a leaderboard, create a new one.
Not to be confused with the tags argument of :meth:get_standings, which
filters the standings you read back rather than what gets collected.
excluded_tags
property
#
The prompt tag values this leaderboard skips when building matchups.
A prompt carrying any of these tags is never used, even if it also carries one
of :attr:included_tags. Fixed at creation — to re-scope a leaderboard, create
a new one.
jobs
property
#
jobs: list[RapidataJob]
Returns all Rapidata jobs that have run for this leaderboard.
Every model evaluation on the leaderboard is carried out by a job. This collects the jobs across all runs of the leaderboard, most recent first.
Returns:
| Type | Description |
|---|---|
list[RapidataJob]
|
A list of RapidataJob instances, one per run that has an associated job. |
get_standings #
Returns the standings of the leaderboard.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tags
|
Optional[list[str]]
|
The matchups with these tags should be used to create the standings. If tags are None, all matchups will be considered. If tags are empty, no matchups will be considered. |
None
|
Returns:
| Type | Description |
|---|---|
'pd.DataFrame'
|
A pandas DataFrame containing the standings of the leaderboard. |
Source code in src/rapidata/rapidata_client/benchmark/leaderboard/rapidata_leaderboard.py
get_win_loss_matrix #
get_win_loss_matrix(
tags: Optional[list[str]] = None,
use_weighted_scoring: Optional[bool] = None,
) -> DataFrame
Returns the pairwise win/loss matrix for the participants in this leaderboard.
The returned DataFrame is square, with participant names on both the index
(rows) and columns. Cell [i, j] is how often participant i (row) beat
participant j (column) in their direct matchups. Read a row to see how a
model did against every opponent; the diagonal (a model against itself) is
always 0. This is the head-to-head breakdown behind :meth:get_standings,
which collapses the same matchups into a single Elo score per model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tags
|
Optional[list[str]]
|
Only count matchups carrying one of these prompt tags. If None, every matchup on the leaderboard is included; if an empty list, none are. |
None
|
use_weighted_scoring
|
Optional[bool]
|
If True, each matchup is weighted by the responding
annotators' reliability ( |
None
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
A pandas DataFrame indexed by participant name on both axes, where cell |
DataFrame
|
|
DataFrame
|
participant over the column participant. |
Source code in src/rapidata/rapidata_client/benchmark/leaderboard/rapidata_leaderboard.py
view #
Views the leaderboard.