invokePluginStream( )
Invoke a streaming plugin handler.
function invokePluginStream(options: InvokePluginOptions, rpcOptions?: { forceNewConnection?: boolean; profiling?: { enabled?: boolean; includeServerBreakdown?: boolean; mode?: "summary" | "verbose" }; timeout?: number }): AsyncGeneratorParameters
| Name | Type | Required? | Description |
|---|---|---|---|
options | InvokePluginOptions | ✓ | Plugin invocation options containing modelId (the loaded plugin model), handler (the handler name to call), and params (the request payload) |
rpcOptions | `{ forceNewConnection?: boolean; profiling?: { enabled?: boolean; includeServerBreakdown?: boolean; mode?: "summary" | "verbose" }; timeout?: number }` | ✗ |
Returns
AsyncGeneratorinvokePlugin( )
Invoke a non-streaming plugin handler.
loadModel( )
Loads a machine learning model from a local path, remote URL, or Hyperdrive key. This function supports multiple model types: LLM (Large Language Model), Whisper (speech recognition), embeddings, NMT (translation), and TTS. It can handle both local file paths and Hyperdrive URLs (pear://). When `onProgress` is provided, the function uses streaming to provide real-time download progress. Otherwise, it uses a simple request-response pattern for faster execution.