Documentation
    Preparing search index...

    Function createHttpLlmProvider

    • Create a fetch provider for the supported dialects, buffered by default or streaming with stream: true.

      The credential travels only in the configured header of the single POST to the endpoint's base URL. Transport failures, non-2xx statuses, stream error events and streams that end without a completion marker become provider-error with the status code at most; response bodies are never echoed into NAP-LLM errors. Aborts propagate, and cancel a stream in flight, so the service can settle a cancelled or timed-out generation.

      Parameters

      Returns HttpLlmProvider

      A provider function for LlmConnectionHost.generate.

      const generate = createHttpLlmProvider({ stream: true });
      const host = { …, generate: (_ctx, connection, request, hooks) => generate(endpointFor(connection), request, hooks.signal, hooks.onDelta) };