LocalLm types documentation
    Preparing search index...

    Interface LmParams

    Parameters for initializing a Language Model.

    LmParams

    const lmParams: LmParams = {
    providerType: 'koboldcpp',
    serverUrl: 'http://example.com/api',
    onToken: (t) => console.log(t),
    apiKey: 'your-api-key',
    onStartEmit: (data) => console.log(data),
    onEndEmit: (result) => console.log(result),
    onError: (err) => console.error(err)
    };
    interface LmParams {
        apiKey?: string;
        defaults?: LmDefaults;
        onEndEmit?: (result: InferenceResult) => void;
        onError?: (err: string) => void;
        onStartEmit?: (data: IngestionStats) => void;
        onToken?: (t: string) => void;
        providerType: LmProviderType;
        serverUrl: string;
    }
    Index

    Properties

    apiKey?: string

    Optional API key for authentication.

    defaults?: LmDefaults

    Default settings.

    onEndEmit?: (result: InferenceResult) => void

    Callback triggered when inference ends.

    onError?: (err: string) => void

    Callback triggered on errors.

    onStartEmit?: (data: IngestionStats) => void

    Callback triggered when inference starts.

    onToken?: (t: string) => void

    Callback when a new token is received.

    providerType: LmProviderType

    Type of provider ("llamacpp", "koboldcpp", "ollama", "browser").

    serverUrl: string

    The URL endpoint for the LM service.