This repository was archived by the owner on Jan 17, 2026. It is now read-only.
small change#11
Merged
Merged
Conversation
Contributor
Author
|
@coderabbitai please review |
sanchitmonga22
approved these changes
Jan 7, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Greptile Summary
Enhanced the
llamacpp_vtable_get_infofunction to populate thecontext_lengthfield with the actual context size from the loaded model. Previously, this field was always set to 0.Changes:
#include <nlohmann/json.hpp>header for JSON parsingis_ready), retrieves model info JSON viarac_llm_llamacpp_get_model_infocontext_sizefield to populateout_info->context_lengthConfidence Score: 5/5
rac_llm_llamacpp_get_model_infoAPI.Important Files Changed
context_lengthfrom model info when model is loadedSequence Diagram
sequenceDiagram participant Client participant VTable as llamacpp_vtable_get_info participant Backend as rac_llm_llamacpp participant Model as LlamaCppTextGeneration participant JSON as nlohmann::json Client->>VTable: get_info(impl, out_info) VTable->>VTable: Check null pointer VTable->>Backend: is_model_loaded(impl) Backend-->>VTable: is_ready status VTable->>VTable: Set is_ready, supports_streaming VTable->>VTable: Set default context_length = 0 alt Model is loaded VTable->>Backend: get_model_info(impl, &json_str) Backend->>Model: get_model_info() Model-->>Backend: nlohmann::json object Backend->>Backend: dump() to string Backend->>Backend: strdup(json_str) Backend-->>VTable: RAC_SUCCESS + json_str VTable->>JSON: parse(json_str) alt JSON parse successful JSON-->>VTable: parsed json object VTable->>VTable: Check contains("context_size") VTable->>VTable: Check is_number() VTable->>VTable: Extract int32_t value VTable->>VTable: Set out_info->context_length else JSON parse error VTable->>VTable: Catch exception VTable->>VTable: Keep context_length = 0 end VTable->>VTable: free(json_str) end VTable-->>Client: RAC_SUCCESS