Parameters required when creating a new LM provider instance.

LmProviderParams

interface LmProviderParams {
    apiKey?: string;
    defaults?: LmDefaults;
    name: string;
    onEndEmit?: ((result) => void);
    onError?: ((err) => void);
    onStartEmit?: ((data) => void);
    onToken?: ((t) => void);
    serverUrl: string;
}

Properties

apiKey?: string

The key used for authentication.

defaults?: LmDefaults

Default settings.

name: string

Identifier for the LM provider.

onEndEmit?: ((result) => void)

Callback triggered when inference ends.

Type declaration

onError?: ((err) => void)

Callback triggered on errors.

Type declaration

    • (err): void
    • Parameters

      • err: string

      Returns void

onStartEmit?: ((data) => void)

Callback triggered when inference starts.

Type declaration

onToken?: ((t) => void)

Callback when a new token is received.

Type declaration

    • (t): void
    • Parameters

      • t: string

      Returns void

serverUrl: string

The URL endpoint for the provider's server.