Class BowirePriceProfiles

Namespace
Kuestenlogik.Bowire.Benchmarking
Assembly
Kuestenlogik.Bowire.Benchmarking.dll

#621 — price profiles from configuration, under Bowire:Benchmark:PriceProfiles:<name>:

"model-a":  { "Rates": { "input": 0.0000030, "output": 0.0000150 } }
"router-b": { "Url": "https://router.example/api/v1/models",
              "Rates": { "input": "data[id=model-b].pricing.prompt",
                         "output": "data[id=model-b].pricing.completion" } }

With a Url the rates are paths into the provider's answer (the syntax of a metric expression's references), read once when the run starts.

public static class BowirePriceProfiles
Inheritance
BowirePriceProfiles
Inherited Members

Fields

Section

The configuration section the profiles live in.

public const string Section = "Bowire:Benchmark:PriceProfiles"

Field Value

string

Methods

Names(IConfiguration?)

The names of the configured profiles.

public static IReadOnlyList<string> Names(IConfiguration? configuration)

Parameters

configuration IConfiguration

Returns

IReadOnlyList<string>

ResolveAsync(IConfiguration?, string, HttpClient, CancellationToken)

Resolve the profile name. Throws InvalidOperationException with a readable message when it is not configured, a rate is not a number, or the provider's rates cannot be read.

public static Task<BowirePriceProfile> ResolveAsync(IConfiguration? configuration, string name, HttpClient http, CancellationToken ct = default)

Parameters

configuration IConfiguration
name string
http HttpClient
ct CancellationToken

Returns

Task<BowirePriceProfile>