LocalLm types documentation
    Preparing search index...

    Interface LmParams

    Parameters for initializing a Language Model.

    LmParams

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

    The URL endpoint for the LM service.

    Callback when a new token is received.

    Optional API key for authentication.

    Callback triggered when inference starts.

    Callback triggered when inference ends.

    Callback triggered on errors.

    Default settings.

    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
    defaults?: LmDefaults
    onEndEmit?: (result: InferenceResult) => void
    onError?: (err: string) => void
    onStartEmit?: (data: IngestionStats) => void
    onToken?: (t: string) => void
    providerType: LmProviderType
    serverUrl: string