@capgo/capacitor-llm
LLM Plugin interface for interacting with on-device language models.
Overview
Section titled “Overview”LLM Plugin interface for interacting with on-device language models.
Core Capabilities
Section titled “Core Capabilities”createChat- Creates a new chat session.sendMessage- Sends a message to the AI in a specific chat session.getReadiness- Gets the readiness status of the LLM.setModel- Sets the model configuration - iOS: Use “Apple Intelligence” as path for system model, or provide path to MediaPipe model - Android: Path to a MediaPipe model file (in assets or files directory).
Public API
Section titled “Public API”| Method | Description |
|---|---|
createChat | Creates a new chat session. |
sendMessage | Sends a message to the AI in a specific chat session. |
getReadiness | Gets the readiness status of the LLM. |
setModel | Sets the model configuration - iOS: Use “Apple Intelligence” as path for system model, or provide path to MediaPipe model - Android: Path to a MediaPipe model file (in assets or files directory). |
downloadModel | Downloads a model from a URL and saves it to the appropriate location - iOS: Downloads to the app’s documents directory - Android: Downloads to the app’s files directory. |
addListener | Adds a listener for text received from AI. |
addListener | Adds a listener for AI completion events. |
addListener | Adds a listener for model download progress events. |
addListener | Adds a listener for readiness status changes. |
getPluginVersion | Get the native Capacitor plugin version. |
Source Of Truth
Section titled “Source Of Truth”This reference is synced from src/definitions.ts in capacitor-llm.