AxBalancerOptions Generated TypeScript API reference. typescript api api/reference build/apidocs/TypeAlias.AxBalancerOptions.md type AxBalancerOptions

AxBalancerOptions

TypeScript
type AxBalancerOptions<TModelKey> = object;

Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/ai/balance.ts#L85

Options for the balancer.

Type Parameters

Type ParameterDefault type
TModelKeystring

Properties

comparator()?

TypeScript
optional comparator: (a: AxAIService<unknown, unknown, TModelKey>, b: AxAIService<unknown, unknown, TModelKey>) => number;

Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/ai/balance.ts#L86

Parameters

ParameterType
aAxAIService<unknown, unknown, TModelKey>
bAxAIService<unknown, unknown, TModelKey>

Returns

number


debug?

TypeScript
optional debug: boolean;

Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/ai/balance.ts#L90


initialBackoffMs?

TypeScript
optional initialBackoffMs: number;

Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/ai/balance.ts#L91


maxBackoffMs?

TypeScript
optional maxBackoffMs: number;

Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/ai/balance.ts#L92


maxRetries?

TypeScript
optional maxRetries: number;

Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/ai/balance.ts#L93


strategy?

TypeScript
optional strategy: AxBalancerAdaptiveStrategy<TModelKey>;

Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/ai/balance.ts#L99

Opt into request-time provider selection using learned failure rate, successful latency, and estimated cost. When omitted, the existing comparator-ordered behavior is unchanged.

Docs