Update c0c7e147e7efa6c5858754b47259ba4880f8a906#1392
Open
martindevans wants to merge 4 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates LLamaSharp’s native interop layer to match llama.cpp commit c0c7e147e7efa6c5858754b47259ba4880f8a906, including new context parameters and updated MTMD interop signatures.
Changes:
- Added support for new
llama_context_paramsfields (n_rs_seqrollback snapshots andcontext_type/ MTP support) and surfaced them throughIContextParamsand conversions. - Updated MTMD decoder position ABI (adds
zcomponent and introducespos_0argument in relevant P/Invokes). - Removed the
llama_params_fitP/Invoke (and its status enum) and updated binary release ID to the new upstream snapshot.
Reviewed changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| LLama/Native/SafeLLamaContextHandle.cs | Exposes llama_n_rs_seq via a new managed property; adds minor ReSharper suppressions. |
| LLama/Native/NativeApi.Mtmd.cs | Updates MTMD ABI: mtmd_decoder_pos gains z; decoder-pos APIs now take pos_0. |
| LLama/Native/NativeApi.cs | Removes llama_params_fit P/Invoke. |
| LLama/Native/LLamaParamsFitStatus.cs | Deletes the managed enum used by the removed llama_params_fit API. |
| LLama/Native/LLamaModelParams.cs | Formatting/alignment changes in model param bool fields block (ABI-related structure). |
| LLama/Native/LLamaContextType.cs | Introduces managed enum for llama_context_type (Default/Mtp). |
| LLama/Native/LLamaContextParams.cs | Adds n_rs_seq and context_type to managed llama_context_params struct. |
| LLama/LLamaSharp.csproj | Updates BinaryReleaseId for native runtime download. |
| LLama/Extensions/IContextParamsExtensions.cs | Plumbs ContextType and RecurrentRollbackSnapshots into native LLamaContextParams. |
| LLama/Common/ModelParams.cs | Adds ContextType; introduces RecurrentRollbackSnapshots property (currently non-configurable). |
| LLama/Abstractions/IContextParams.cs | Adds new required interface members (ContextType, RecurrentRollbackSnapshots). |
| LLama.Web/Common/ModelOptions.cs | Implements new interface members (ContextType currently hard-coded to Default). |
| LLama.Unittest/NativeAbiTests.cs | Updates ABI size expectations for new context params fields; adjusts offset checks. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Contributor
|
My tests are running fine on:
|
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.
Updated to llama.cpp c0c7e147e7efa6c5858754b47259ba4880f8a906.
Testing: