lpgcast.bench.run¶
Run the corpus through a model, or the oracle, and score every episode.
Attributes¶
ClientFactory = Callable[[BenchCase, LPGCastSettings], LLMClient]
module-attribute
¶
PRICES_ENV = 'LPGCAST_BENCH_PRICES'
module-attribute
¶
RECAST_CACHE_SUBDIR = 'recast'
module-attribute
¶
Classes¶
BenchReport
¶
Bases: BaseModel
A benchmark run.
Source code in lpgcast/bench/run.py
Attributes¶
corpus_digest
instance-attribute
¶
corpus_modified = Field(description='The cases differ from the pinned digest: not publishable.')
class-attribute
instance-attribute
¶
corpus_version = CORPUS_VERSION
class-attribute
instance-attribute
¶
graflo_version = Field(default_factory=lambda: version('graflo'))
class-attribute
instance-attribute
¶
lpgcast_version = __version__
class-attribute
instance-attribute
¶
prices_source = None
class-attribute
instance-attribute
¶
publishable
property
¶
rows
instance-attribute
¶
split
instance-attribute
¶
started
instance-attribute
¶
CaseRecord
¶
Bases: BaseModel
One case's episodes and their sum.
Source code in lpgcast/bench/run.py
Attributes¶
counts
instance-attribute
¶
digest = Field(default=None, description="The case's content digest; absent before corpus 1.1.0.")
class-attribute
instance-attribute
¶
episodes
instance-attribute
¶
family
instance-attribute
¶
instance
instance-attribute
¶
name
instance-attribute
¶
split
instance-attribute
¶
EpisodeRecord
¶
Bases: BaseModel
One episode's outcome: enough to pair two runs episode by episode.
Source code in lpgcast/bench/run.py
Row
¶
Bases: BaseModel
Every selected case cast by one model.
Source code in lpgcast/bench/run.py
Attributes¶
cases
instance-attribute
¶
counts
property
¶
label
instance-attribute
¶
model = Field(description='Model settings that reach the provider.')
class-attribute
instance-attribute
¶
usd = Field(default=None, description='List price of the tokens used, billed or replayed; None without a price for this model.')
class-attribute
instance-attribute
¶
Functions:¶
case_settings(case, base)
¶
base with the settings case pins.
load_prices(path=None)
¶
The price table and its _source note; empty when none is configured.
Source code in lpgcast/bench/run.py
model_clients(settings)
¶
Clients for the configured model, one cache per settings.
Source code in lpgcast/bench/run.py
new_report(split, started, rows, prices_source)
¶
A report over rows, stamped with the corpus it ran against.
Source code in lpgcast/bench/run.py
oracle_clients()
¶
price(counts, entry)
¶
USD for counts' tokens at entry's rates.
Source code in lpgcast/bench/run.py
recast_settings(base)
¶
base with its own cache directory, so the second cast makes a fresh call.
Source code in lpgcast/bench/run.py
run_case(case, settings, clients, *, concurrency=8)
async
¶
Cast and score every episode of case.
Raises:
| Type | Description |
|---|---|
LLMConfigurationError
|
the deployment is misconfigured. |
CacheMissError
|
a miss while the cache requires hits. |
Source code in lpgcast/bench/run.py
run_row(cases, settings, *, oracle=False, concurrency=8, prices=None)
async
¶
One row: every case cast by the configured model, or by the oracle.