{"id":20980868,"url":"https://github.com/cap-go/capacitor-llm","last_synced_at":"2026-05-06T22:12:29.143Z","repository":{"id":309544810,"uuid":"1000598569","full_name":"Cap-go/capacitor-llm","owner":"Cap-go","description":"Capacitor SDK to run LLM models locally in IOS and Android, also enable AppleInteligence","archived":false,"fork":false,"pushed_at":"2025-09-12T10:50:42.000Z","size":960,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-12T12:35:08.156Z","etag":null,"topics":["capacitor","capgo","ionic"],"latest_commit_sha":null,"homepage":"https://capgo.app","language":"Vue","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Cap-go.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"Cap-go","patreon":null,"open_collective":"capgo","ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2025-06-12T03:23:26.000Z","updated_at":"2025-09-12T10:50:46.000Z","dependencies_parsed_at":"2025-08-16T06:23:38.694Z","dependency_job_id":null,"html_url":"https://github.com/Cap-go/capacitor-llm","commit_stats":null,"previous_names":["cap-go/apple-intelligence","cap-go/capacitor-llm"],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/Cap-go/capacitor-llm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cap-go%2Fcapacitor-llm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cap-go%2Fcapacitor-llm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cap-go%2Fcapacitor-llm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cap-go%2Fcapacitor-llm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Cap-go","download_url":"https://codeload.github.com/Cap-go/capacitor-llm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cap-go%2Fcapacitor-llm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275130639,"owners_count":25410746,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-14T02:00:10.474Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["capacitor","capgo","ionic"],"created_at":"2024-11-19T05:31:01.706Z","updated_at":"2026-05-06T22:12:29.129Z","avatar_url":"https://github.com/Cap-go.png","language":"Vue","funding_links":["https://github.com/sponsors/Cap-go","https://opencollective.com/capgo"],"categories":[],"sub_categories":[],"readme":"# @capgo/capacitor-llm\n\n\u003ca href=\"https://capgo.app/\"\u003e\u003cimg src='https://raw.githubusercontent.com/Cap-go/capgo/main/assets/capgo_banner.png' alt='Capgo - Instant updates for capacitor'/\u003e\u003c/a\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003ch2\u003e\u003ca href=\"https://capgo.app/?ref=plugin_llm\"\u003e ➡️ Get Instant updates for your App with Capgo 🚀\u003c/a\u003e\u003c/h2\u003e\n  \u003ch2\u003e\u003ca href=\"https://capgo.app/consulting/?ref=plugin_llm\"\u003e Fix your annoying bug now, Hire a Capacitor expert 💪\u003c/a\u003e\u003c/h2\u003e\n\u003c/div\u003e\n\nAdds support for LLM locally run for Capacitor\n\nIt uses Apple Intelligence for the iOS system model, MediaPipe for existing `.task` models, and ExecuTorch `.pte` models on both iOS and Android.\n\n**Mac Catalyst:** Native iOS functionality is disabled for Mac Catalyst builds. MediaPipe pods are skipped and native calls will return an unsupported response; use an iOS/iPadOS target for native features.\n\n## Documentation\n\nThe most complete doc is available here: https://capgo.app/docs/plugins/llm/\n\n## Compatibility\n\n| Plugin version | Capacitor compatibility | Maintained |\n| -------------- | ----------------------- | ---------- |\n| v8.\\*.\\*       | v8.\\*.\\*                | ✅          |\n| v7.\\*.\\*       | v7.\\*.\\*                | On demand   |\n| v6.\\*.\\*       | v6.\\*.\\*                | ❌          |\n| v5.\\*.\\*       | v5.\\*.\\*                | ❌          |\n\n\u003e **Note:** The major version of this plugin follows the major version of Capacitor. Use the version that matches your Capacitor installation (e.g., plugin v8 for Capacitor 8). Only the latest major version is actively maintained.\n\n## Installation\n\n```bash\nbun add @capgo/capacitor-llm\nbunx cap sync\n```\n\n### iOS Additional Setup for Custom Models\n\nApple Intelligence works without bundled model files on supported iOS versions. For custom models, the plugin supports MediaPipe through CocoaPods and ExecuTorch when the host app links ExecuTorch with Swift Package Manager. The plugin package remains iOS 15 compatible; iOS ExecuTorch requires an iOS 17 or newer app target because ExecuTorch requires iOS 17.\n\n**Using CocoaPods:**\nThe MediaPipe dependencies are already configured in the podspec. Make sure to run `pod install` after adding the plugin.\n\nExecuTorch is not provided by the CocoaPods integration. CocoaPods installs MediaPipe only. CocoaPods builds reject `engine: 'executorch'` with a clear runtime error unless the app also links ExecuTorch separately.\n\n**Note about Static Framework Warning:**\nWhen running `pod install`, you may see a warning about transitive dependencies with statically linked binaries. To fix this, update your Podfile:\n\n```ruby\n# Change this:\nuse_frameworks!\n\n# To this:\nuse_frameworks! :linkage =\u003e :static\n\n# And add this to your post_install hook:\npost_install do |installer|\n  assertDeploymentTarget(installer)\n\n  # Fix for static framework dependencies\n  installer.pods_project.targets.each do |target|\n    target.build_configurations.each do |config|\n      config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'\n    end\n\n    # Specifically for MediaPipe pods\n    if target.name.include?('MediaPipeTasksGenAI')\n      target.build_configurations.each do |config|\n        config.build_settings['ENABLE_BITCODE'] = 'NO'\n      end\n    end\n  end\nend\n```\n\n**Using Swift Package Manager:**\nThe plugin's `Package.swift` does not link ExecuTorch directly because that would force every Swift Package Manager user onto iOS 17 or newer, even when they only use Apple Intelligence or MediaPipe.\n\nTo use ExecuTorch on iOS, add it to your app target:\n\n1. Set the app target deployment version to iOS 17 or newer.\n2. In Xcode, open the app project, select **Package Dependencies**, and add `https://github.com/pytorch/executorch.git`.\n3. Use the `swiftpm-1.2.0` branch, or the ExecuTorch branch that matches the runtime version you want.\n4. Add these products to the app target: `executorch_llm`, `backend_xnnpack`, `kernels_llm`, `kernels_optimized`, `kernels_quantized`, and `kernels_torchao`.\n5. Add the `.pte` model and tokenizer file to the app target's Copy Bundle Resources, or download them at runtime.\n\nIf those ExecuTorch products are not linked into the app target, `setModel({ engine: 'executorch' })` rejects with a clear runtime error. MediaPipe GenAI still does not officially support SPM, so use CocoaPods for MediaPipe `.task` models.\n\n## Adding a Model to Your App\n\nThe simplest cross-platform custom model path is ExecuTorch. It uses the same kind of `.pte` model file on iOS and Android, plus a tokenizer file.\n\n### ExecuTorch Models (iOS and Android)\n\niOS uses ExecuTorch only when the host app links the ExecuTorch Swift Package products. It is not included by CocoaPods or by the plugin's `Package.swift`, so an app without those products can use Apple Intelligence or MediaPipe but will refuse `engine: 'executorch'`. Android uses the ExecuTorch Maven package.\n\nBundle the model files:\n\n- iOS: add the `.pte` model and tokenizer file to your app target's Copy Bundle Resources.\n- Android: place the `.pte` model and tokenizer file under `android/app/src/main/assets/`, then reference them with `/android_asset/...`.\n\n```typescript\nimport { Capacitor } from '@capacitor/core';\nimport { CapgoLLM } from '@capgo/capacitor-llm';\n\nconst isAndroid = Capacitor.getPlatform() === 'android';\n\nawait CapgoLLM.setModel({\n  engine: 'executorch',\n  path: isAndroid ? '/android_asset/model.pte' : 'model.pte',\n  tokenizerPath: isAndroid ? '/android_asset/tokenizer.model' : 'tokenizer.model',\n  maxTokens: 2048,\n  sequenceLength: 2048,\n  temperature: 0.8,\n});\n\nconst { id: chatId } = await CapgoLLM.createChat();\n```\n\n`engine: 'auto'` also selects ExecuTorch when the model path ends in `.pte` or when `tokenizerPath` is provided. Passing `engine: 'executorch'` is recommended when loading ExecuTorch models so failures are explicit.\n\n### MediaPipe Models\n\nMediaPipe remains available for existing `.task` models. Android models usually need both `.task` and `.litertlm` files. iOS MediaPipe support is available through CocoaPods and remains experimental for some `.task` files.\n\n```typescript\nawait CapgoLLM.setModel({\n  path: '/android_asset/gemma-3-270m-it-int8.task',\n  modelType: 'task',\n  maxTokens: 2048,\n  topk: 40,\n  temperature: 0.8,\n});\n```\n\n### Apple Intelligence\n\nOn supported iOS devices, Apple Intelligence can be used without bundling a model.\n\n```typescript\nawait CapgoLLM.setModel({\n  path: 'Apple Intelligence',\n  engine: 'apple',\n});\n```\n\n### Downloading Models at Runtime\n\nUse `downloadModel` to keep large model files out of the app bundle. For ExecuTorch, `companionUrl` can point at the tokenizer file.\n\n```typescript\nconst result = await CapgoLLM.downloadModel({\n  url: 'https://your-server.com/models/model.pte',\n  companionUrl: 'https://your-server.com/models/tokenizer.model',\n  filename: 'model.pte',\n});\n\nawait CapgoLLM.setModel({\n  engine: 'executorch',\n  path: result.path,\n  tokenizerPath: result.companionPath,\n  sequenceLength: 2048,\n});\n```\n\n## Usage Example\n\n```typescript\nimport { CapgoLLM } from '@capgo/capacitor-llm';\n\nconst { readiness } = await CapgoLLM.getReadiness();\nconsole.log('LLM readiness:', readiness);\n\nconst { id: chatId } = await CapgoLLM.createChat();\n\nCapgoLLM.addListener('textFromAi', (event) =\u003e {\n  console.log('AI:', event.text);\n});\n\nCapgoLLM.addListener('aiFinished', (event) =\u003e {\n  console.log('AI finished responding to chat:', event.chatId);\n});\n\nawait CapgoLLM.sendMessage({\n  chatId,\n  message: 'Hello! How are you today?',\n});\n```\n\n## API\n\n\u003cdocgen-index\u003e\n\n* [`createChat()`](#createchat)\n* [`sendMessage(...)`](#sendmessage)\n* [`getReadiness()`](#getreadiness)\n* [`setModel(...)`](#setmodel)\n* [`downloadModel(...)`](#downloadmodel)\n* [`addListener('textFromAi', ...)`](#addlistenertextfromai-)\n* [`addListener('aiFinished', ...)`](#addlisteneraifinished-)\n* [`addListener('downloadProgress', ...)`](#addlistenerdownloadprogress-)\n* [`addListener('readinessChange', ...)`](#addlistenerreadinesschange-)\n* [`getPluginVersion()`](#getpluginversion)\n* [Interfaces](#interfaces)\n\n\u003c/docgen-index\u003e\n\n\u003cdocgen-api\u003e\n\u003c!--Update the source file JSDoc comments and rerun docgen to update the docs below--\u003e\n\nLLM Plugin interface for interacting with on-device language models\n\n### createChat()\n\n```typescript\ncreateChat() =\u003e Promise\u003c{ id: string; instructions?: string; }\u003e\n```\n\nCreates a new chat session\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;{ id: string; instructions?: string; }\u0026gt;\u003c/code\u003e\n\n--------------------\n\n\n### sendMessage(...)\n\n```typescript\nsendMessage(options: { chatId: string; message: string; }) =\u003e Promise\u003cvoid\u003e\n```\n\nSends a message to the AI in a specific chat session\n\n| Param         | Type                                              | Description                       |\n| ------------- | ------------------------------------------------- | --------------------------------- |\n| **`options`** | \u003ccode\u003e{ chatId: string; message: string; }\u003c/code\u003e | - The chat id and message to send |\n\n--------------------\n\n\n### getReadiness()\n\n```typescript\ngetReadiness() =\u003e Promise\u003c{ readiness: string; }\u003e\n```\n\nGets the readiness status of the LLM\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;{ readiness: string; }\u0026gt;\u003c/code\u003e\n\n--------------------\n\n\n### setModel(...)\n\n```typescript\nsetModel(options: ModelOptions) =\u003e Promise\u003cvoid\u003e\n```\n\nSets the model configuration\n- iOS: Use \"Apple Intelligence\" as path for system model, provide a MediaPipe model, or set engine to \"executorch\"\n- Android: Path to a MediaPipe or ExecuTorch model file (in assets or files directory)\n\n| Param         | Type                                                  | Description               |\n| ------------- | ----------------------------------------------------- | ------------------------- |\n| **`options`** | \u003ccode\u003e\u003ca href=\"#modeloptions\"\u003eModelOptions\u003c/a\u003e\u003c/code\u003e | - The model configuration |\n\n--------------------\n\n\n### downloadModel(...)\n\n```typescript\ndownloadModel(options: DownloadModelOptions) =\u003e Promise\u003cDownloadModelResult\u003e\n```\n\nDownloads a model from a URL and saves it to the appropriate location\n- iOS: Downloads to the app's documents directory\n- Android: Downloads to the app's files directory\n\n| Param         | Type                                                                  | Description                  |\n| ------------- | --------------------------------------------------------------------- | ---------------------------- |\n| **`options`** | \u003ccode\u003e\u003ca href=\"#downloadmodeloptions\"\u003eDownloadModelOptions\u003c/a\u003e\u003c/code\u003e | - The download configuration |\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;\u003ca href=\"#downloadmodelresult\"\u003eDownloadModelResult\u003c/a\u003e\u0026gt;\u003c/code\u003e\n\n--------------------\n\n\n### addListener('textFromAi', ...)\n\n```typescript\naddListener(eventName: 'textFromAi', listenerFunc: (event: TextFromAiEvent) =\u003e void) =\u003e Promise\u003c{ remove: () =\u003e Promise\u003cvoid\u003e; }\u003e\n```\n\nAdds a listener for text received from AI\n\n| Param              | Type                                                                            | Description                         |\n| ------------------ | ------------------------------------------------------------------------------- | ----------------------------------- |\n| **`eventName`**    | \u003ccode\u003e'textFromAi'\u003c/code\u003e                                                       | - Event name 'textFromAi'           |\n| **`listenerFunc`** | \u003ccode\u003e(event: \u003ca href=\"#textfromaievent\"\u003eTextFromAiEvent\u003c/a\u003e) =\u0026gt; void\u003c/code\u003e | - Callback function for text events |\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;{ remove: () =\u0026gt; Promise\u0026lt;void\u0026gt;; }\u0026gt;\u003c/code\u003e\n\n--------------------\n\n\n### addListener('aiFinished', ...)\n\n```typescript\naddListener(eventName: 'aiFinished', listenerFunc: (event: AiFinishedEvent) =\u003e void) =\u003e Promise\u003c{ remove: () =\u003e Promise\u003cvoid\u003e; }\u003e\n```\n\nAdds a listener for AI completion events\n\n| Param              | Type                                                                            | Description                           |\n| ------------------ | ------------------------------------------------------------------------------- | ------------------------------------- |\n| **`eventName`**    | \u003ccode\u003e'aiFinished'\u003c/code\u003e                                                       | - Event name 'aiFinished'             |\n| **`listenerFunc`** | \u003ccode\u003e(event: \u003ca href=\"#aifinishedevent\"\u003eAiFinishedEvent\u003c/a\u003e) =\u0026gt; void\u003c/code\u003e | - Callback function for finish events |\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;{ remove: () =\u0026gt; Promise\u0026lt;void\u0026gt;; }\u0026gt;\u003c/code\u003e\n\n--------------------\n\n\n### addListener('downloadProgress', ...)\n\n```typescript\naddListener(eventName: 'downloadProgress', listenerFunc: (event: DownloadProgressEvent) =\u003e void) =\u003e Promise\u003c{ remove: () =\u003e Promise\u003cvoid\u003e; }\u003e\n```\n\nAdds a listener for model download progress events\n\n| Param              | Type                                                                                        | Description                             |\n| ------------------ | ------------------------------------------------------------------------------------------- | --------------------------------------- |\n| **`eventName`**    | \u003ccode\u003e'downloadProgress'\u003c/code\u003e                                                             | - Event name 'downloadProgress'         |\n| **`listenerFunc`** | \u003ccode\u003e(event: \u003ca href=\"#downloadprogressevent\"\u003eDownloadProgressEvent\u003c/a\u003e) =\u0026gt; void\u003c/code\u003e | - Callback function for progress events |\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;{ remove: () =\u0026gt; Promise\u0026lt;void\u0026gt;; }\u0026gt;\u003c/code\u003e\n\n--------------------\n\n\n### addListener('readinessChange', ...)\n\n```typescript\naddListener(eventName: 'readinessChange', listenerFunc: (event: ReadinessChangeEvent) =\u003e void) =\u003e Promise\u003c{ remove: () =\u003e Promise\u003cvoid\u003e; }\u003e\n```\n\nAdds a listener for readiness status changes\n\n| Param              | Type                                                                                      | Description                              |\n| ------------------ | ----------------------------------------------------------------------------------------- | ---------------------------------------- |\n| **`eventName`**    | \u003ccode\u003e'readinessChange'\u003c/code\u003e                                                            | - Event name 'readinessChange'           |\n| **`listenerFunc`** | \u003ccode\u003e(event: \u003ca href=\"#readinesschangeevent\"\u003eReadinessChangeEvent\u003c/a\u003e) =\u0026gt; void\u003c/code\u003e | - Callback function for readiness events |\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;{ remove: () =\u0026gt; Promise\u0026lt;void\u0026gt;; }\u0026gt;\u003c/code\u003e\n\n--------------------\n\n\n### getPluginVersion()\n\n```typescript\ngetPluginVersion() =\u003e Promise\u003c{ version: string; }\u003e\n```\n\nGet the native Capacitor plugin version.\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;{ version: string; }\u0026gt;\u003c/code\u003e\n\n**Since:** 1.0.0\n\n--------------------\n\n\n### Interfaces\n\n\n#### ModelOptions\n\nModel configuration options\n\n| Prop                 | Type                                                          | Description                                                                                                                                                                                                                                                                                                                       |\n| -------------------- | ------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **`path`**           | \u003ccode\u003estring\u003c/code\u003e                                           | Model path or \"Apple Intelligence\" for iOS system model                                                                                                                                                                                                                                                                           |\n| **`engine`**         | \u003ccode\u003e'auto' \\| 'apple' \\| 'mediapipe' \\| 'executorch'\u003c/code\u003e | Runtime engine to use. - \"auto\": uses Apple Intelligence on iOS when path is \"Apple Intelligence\", ExecuTorch for `.pte` or tokenizerPath, otherwise MediaPipe - \"apple\": iOS Foundation Models / Apple Intelligence - \"mediapipe\": MediaPipe GenAI `.task` models - \"executorch\": ExecuTorch `.pte` models with a tokenizer file |\n| **`modelType`**      | \u003ccode\u003estring\u003c/code\u003e                                           | Model file type/extension (e.g., \"task\", \"bin\", \"litertlm\"). If not provided, will be extracted from path.                                                                                                                                                                                                                        |\n| **`tokenizerPath`**  | \u003ccode\u003estring\u003c/code\u003e                                           | Tokenizer path for ExecuTorch models. Required when engine is \"executorch\".                                                                                                                                                                                                                                                       |\n| **`specialTokens`**  | \u003ccode\u003estring[]\u003c/code\u003e                                         | Optional special tokens passed to iOS ExecuTorch tokenizers.                                                                                                                                                                                                                                                                      |\n| **`maxTokens`**      | \u003ccode\u003enumber\u003c/code\u003e                                           | Maximum number of tokens the model handles                                                                                                                                                                                                                                                                                        |\n| **`sequenceLength`** | \u003ccode\u003enumber\u003c/code\u003e                                           | Sequence length for ExecuTorch generation. Defaults to maxTokens when omitted.                                                                                                                                                                                                                                                    |\n| **`topk`**           | \u003ccode\u003enumber\u003c/code\u003e                                           | Number of tokens the model considers at each step                                                                                                                                                                                                                                                                                 |\n| **`temperature`**    | \u003ccode\u003enumber\u003c/code\u003e                                           | Amount of randomness in generation (0.0-1.0)                                                                                                                                                                                                                                                                                      |\n| **`randomSeed`**     | \u003ccode\u003enumber\u003c/code\u003e                                           | Random seed for generation                                                                                                                                                                                                                                                                                                        |\n\n\n#### DownloadModelResult\n\nResult of model download\n\n| Prop                | Type                | Description                                             |\n| ------------------- | ------------------- | ------------------------------------------------------- |\n| **`path`**          | \u003ccode\u003estring\u003c/code\u003e | Path where the model was saved                          |\n| **`companionPath`** | \u003ccode\u003estring\u003c/code\u003e | Path where the companion file was saved (if applicable) |\n\n\n#### DownloadModelOptions\n\nOptions for downloading a model\n\n| Prop               | Type                | Description                                                   |\n| ------------------ | ------------------- | ------------------------------------------------------------- |\n| **`url`**          | \u003ccode\u003estring\u003c/code\u003e | URL of the model file to download                             |\n| **`companionUrl`** | \u003ccode\u003estring\u003c/code\u003e | Optional: URL of companion file (e.g., .litertlm for Android) |\n| **`filename`**     | \u003ccode\u003estring\u003c/code\u003e | Optional: Custom filename (defaults to filename from URL)     |\n\n\n#### TextFromAiEvent\n\nEvent data for text received from AI\n\n| Prop          | Type                 | Description                                                                |\n| ------------- | -------------------- | -------------------------------------------------------------------------- |\n| **`text`**    | \u003ccode\u003estring\u003c/code\u003e  | The text content from AI - this is an incremental chunk, not the full text |\n| **`chatId`**  | \u003ccode\u003estring\u003c/code\u003e  | The chat session ID                                                        |\n| **`isChunk`** | \u003ccode\u003eboolean\u003c/code\u003e | Whether this is a complete chunk (true) or partial streaming data (false)  |\n\n\n#### AiFinishedEvent\n\nEvent data for AI completion\n\n| Prop         | Type                | Description                       |\n| ------------ | ------------------- | --------------------------------- |\n| **`chatId`** | \u003ccode\u003estring\u003c/code\u003e | The chat session ID that finished |\n\n\n#### DownloadProgressEvent\n\nEvent data for download progress\n\n| Prop                  | Type                | Description                              |\n| --------------------- | ------------------- | ---------------------------------------- |\n| **`progress`**        | \u003ccode\u003enumber\u003c/code\u003e | Percentage of download completed (0-100) |\n| **`totalBytes`**      | \u003ccode\u003enumber\u003c/code\u003e | Total bytes to download                  |\n| **`downloadedBytes`** | \u003ccode\u003enumber\u003c/code\u003e | Bytes downloaded so far                  |\n\n\n#### ReadinessChangeEvent\n\nEvent data for readiness status changes\n\n| Prop            | Type                | Description          |\n| --------------- | ------------------- | -------------------- |\n| **`readiness`** | \u003ccode\u003estring\u003c/code\u003e | The readiness status |\n\n\u003c/docgen-api\u003e\n\n## Example App Model Setup\n\nThe example app can use either the older MediaPipe assets or the new ExecuTorch assets.\n\n### Recommended Custom Path: ExecuTorch\n\n1. Export or download an ExecuTorch `.pte` model and matching tokenizer file.\n2. Add both files to the iOS app bundle, or place both files in `example-app/android/app/src/main/assets/` for Android.\n3. Call `setModel` with `engine: 'executorch'`, `path`, and `tokenizerPath`.\n\n### Legacy MediaPipe Path\n\nAndroid still supports Gemma 3 LiteRT assets from Kaggle. Download both files and place them in `example-app/android/app/src/main/assets/`:\n\n- `gemma-3-270m-it-int8.task`\n- `gemma-3-270m-it-int8.litertlm`\n\niOS MediaPipe remains experimental because some `.task` models can fail during prefill. Apple Intelligence or ExecuTorch is preferred on iOS.\n\n## Known Issues\n\n- ExecuTorch is native-only and is not available on web.\n- iOS ExecuTorch requires linking the ExecuTorch SwiftPM products in the app target, and that app target must support iOS 17 or newer.\n- Apple Intelligence requires iOS 26.0 or later and a supported device.\n- Android requires minSdkVersion 24 or higher.\n- Model files are large, so production apps should usually download them after install.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcap-go%2Fcapacitor-llm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcap-go%2Fcapacitor-llm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcap-go%2Fcapacitor-llm/lists"}