React Native RAG - v0.2.0
    Preparing search index...

    ExecuTorch-based implementation of LLM for React Native.

    Implements

    Index

    Constructors

    • Creates a new ExecuTorch LLM instance.

      Parameters

      • params: ExecuTorchLLMParams

        Parameters for the instance.

        • modelSource

          Source of the LLM model.

        • tokenizerSource

          Source of the tokenizer.

        • tokenizerConfigSource

          Source of the tokenizer config.

        • onDownloadProgress

          Download progress callback (0-1).

        • responseCallback

          Callback invoked with final full response string.

        • chatConfig

          Chat configuration forwarded to ExecuTorch.

      Returns ExecuTorchLLM

    Methods

    • Generates a completion from a list of messages, streaming tokens to callback.

      Parameters

      • messages: Message[]

        Conversation history for the model.

      • callback: (token: string) => void

        Token-level streaming callback.

      Returns Promise<string>

      Promise that resolves to the full generated string.

    • Interrupts current generation. Note: current ExecuTorch interrupt is synchronous. Awaiting this method will not guarantee completion.

      Returns Promise<void>

    • Loads the model and config via react-native-executorch, and applies configuration.

      Returns Promise<ExecuTorchLLM>

      Promise that resolves to the same instance.

    • Unloads the underlying module. Note: current ExecuTorch unload is synchronous. Awaiting this method will not guarantee completion.

      Returns Promise<void>