docs(iOS): add LoRA adapters usage section#51
Closed
iamstuffed wants to merge 1 commit into
Closed
Conversation
Document the LoRA adapter API in the iOS examples README: load-at-init via LiquidInferenceEngineOptions, runtime swap/clear via setLoraAdapters, independent per-adapter scales (need not sum to 1), and the memory/caching lifecycle (adapters stay resident per loaded model until unload; clearing only deactivates).
Contributor
Author
|
Deferring until a LeapSDK release ships the LoRA adapter API — the examples pin an exact published SDK version, so this would reference an API not yet in any release. Will reopen/re-add after the version that includes leap-android-sdk #274 is published. |
There was a problem hiding this comment.
Pull request overview
Adds documentation to the iOS examples README describing how to use LoRA (Low-Rank Adaptation) adapters with LeapSDK model runners.
Changes:
- Documented loading LoRA adapters at model initialization via
LiquidInferenceEngineOptions(loraAdapters:). - Documented runtime adapter replacement/clearing via
setLoraAdapters([...])/setLoraAdapters([]). - Added guidance on per-adapter scaling and adapter memory/caching behavior.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+237
to
+238
| > LoRA is supported on the llama.cpp backend (`.gguf` checkpoints). The ExecuTorch (`.bundle`) and | ||
| > LFM2-audio backends do not support adapter swaps. |
Comment on lines
+240
to
+248
| **Load adapters when the model loads** (sideloaded GGUF via `LiquidInferenceEngineOptions`): | ||
|
|
||
| ```swift | ||
| let options = LiquidInferenceEngineOptions( | ||
| bundlePath: modelURL.path, | ||
| loraAdapters: [LoraAdapterConfig(path: adapterURL.path, scale: 1.0)] | ||
| ) | ||
| let runner = try await LiquidInferenceEngineRunner.create(options: options) | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a LoRA Adapters section to the iOS examples README (see leap-android-sdk PR #274 for the API).
LiquidInferenceEngineOptions(loraAdapters:)setLoraAdapters([...])/setLoraAdapters([])unload(); clearing only deactivates