Skip to content

@capgo/capacitor-llm

LLM Plugin interface for interacting with on-device language models.

LLM Plugin interface for interacting with on-device language models.

  • 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).
MethodDescription
createChatCreates a new chat session.
sendMessageSends a message to the AI in a specific chat session.
getReadinessGets the readiness status of the LLM.
setModelSets 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).
downloadModelDownloads 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.
addListenerAdds a listener for text received from AI.
addListenerAdds a listener for AI completion events.
addListenerAdds a listener for model download progress events.
addListenerAdds a listener for readiness status changes.
getPluginVersionGet the native Capacitor plugin version.

This reference is synced from src/definitions.ts in capacitor-llm.