FallbackAdapter is an LLM that can fallback to a different LLM if the current LLM fails.

Example

const fallbackLLM = new FallbackAdapter({
llms: [primaryLLM, secondaryLLM, tertiaryLLM],
attemptTimeout: 5.0,
maxRetryPerLLM: 1,
});

Hierarchy (view full)

Constructors

Properties

attemptTimeout: number
llms: llm.LLM[]
maxRetryPerLLM: number
retryInterval: number
retryOnChunkSent: boolean

Accessors

  • get model(): string
  • Get the model name/identifier for this LLM instance.

    Returns string

    The model name if available, "unknown" otherwise.

    Remarks

    Plugins should override this property to provide their model information.

Methods

  • Pre-warm connection to the LLM service

    Returns void