AxInMemoryBalancerStatsStore Generated TypeScript API reference. typescript api api/reference build/apidocs/Class.AxInMemoryBalancerStatsStore.md class AxInMemoryBalancerStatsStore

AxInMemoryBalancerStatsStore

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

Browser-compatible in-memory adaptive routing store.

Implements

Constructors

Constructor

TypeScript
new AxInMemoryBalancerStatsStore(): AxInMemoryBalancerStatsStore;

Returns

AxInMemoryBalancerStatsStore

Methods

get()

TypeScript
get(key: AxBalancerStatsKey): Promise<
  | undefined
  | Readonly<{
  failureEwma: number;
  logLatencyM2: number;
  logLatencyMean: number;
  observations: number;
  successes: number;
  version: 1;
}>>;

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

Read the latest route state, or return undefined for a cold route.

Parameters

ParameterType
keyAxBalancerStatsKey

Returns

Promise< | undefined | Readonly<{ failureEwma: number; logLatencyM2: number; logLatencyMean: number; observations: number; successes: number; version: 1; }>>

Implementation of

AxBalancerStatsStore.get


observe()

TypeScript
observe(key: AxBalancerStatsKey, observation: AxBalancerStatsObservation): Promise<void>;

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

Atomically reduce one observation into the state stored at key.

Parameters

ParameterType
keyAxBalancerStatsKey
observationAxBalancerStatsObservation

Returns

Promise<void>

Implementation of

AxBalancerStatsStore.observe

Docs