You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
deepseek_formatter_for is unconditionally called, so models like inkling end up falling back to jinja
Key Changes
There is already support for InklingFormatter, but it is only used in native_formatter_for, which would fall back to deepseek_formatter_for in case the model is not "inkling_mm_model"
Validation
Running an inkling model.
Before the change Jinja template is used
After the change native inkling formatter is used, which emits the compact tool JAON
Summary by CodeRabbit
Updates
Prompt formatting now considers both model type and display name when selecting a native formatter. Existing Kimi-specific formatting and the Hugging Face template fallback remain unchanged. Models handled by the native formatter selection may receive different prompt formatting as a result.
The prompt formatter selection now uses native_formatter_for instead of deepseek_formatter_for. The existing Kimi selector and Hugging Face template fallback remain.
Changes
Prompt formatter selection
Layer / File(s)
Summary
Use the native formatter selector lib/llm/src/preprocessor/prompt.rs
The renderer imports native_formatter_for and uses it in prompt_formatter_from_mdc instead of deepseek_formatter_for.
Inkling models now use the native formatter, which is the stated goal of the PR. Deployments that supply a custom chat template for Inkling will no longer have it applied. Owners should confirm that this is acceptable before merge.
Pre-merge checks: 5
Check name
Status
Explanation
Title check
The title clearly and concisely identifies the main change: handling the Inkling formatter.
Description check
The description includes Overview, Key Changes, and Validation sections. It explains the Inkling formatter issue and the observed behavior before and after the change. The Issues and Ongoing Work sect…
Docstring Coverage
Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Description check
Explanation
The description includes Overview, Key Changes, and Validation sections. It explains the Inkling formatter issue and the observed behavior before and after the change. The Issues and Ongoing Work section and checklist are missing, but the description is otherwise sufficiently complete.
Full details: Docstring Coverage
Explanation
Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 1 files.
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Tip
🎯 Customize your risk assessments
Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.
✅ Automatic approvals, with your rules
Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.
CodeRabbit Verify
Run CodeRabbit Verify to test the changes in this pull request.
The reason will be displayed to describe this comment to others. Learn more.
Additional comments: 1
lib/llm/src/preprocessor/prompt.rs-418-418: 1
418-418: Major · Functional Correctness · Quick win
Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.
Preserve explicit custom templates for Inkling.
native_formatter_for returns an Inkling formatter from model_type alone. This return occurs before mdc.chat_template_file is read. The model-card loader accepts an optional custom template, so an Inkling deployment with a custom template now bypasses that template and uses the native formatter instead. (raw.githubusercontent.com)
Skip native selection when mdc.chat_template_file is custom. Then let the existing fallback load the custom artifact.
Proposed fix
+ let has_custom_template = mdc+ .chat_template_file+ .as_ref()+ .is_some_and(|artifact| artifact.is_custom());+- if let Some(formatter) = native_formatter_for(&model_type_lower, &display_name_lower) {- return Ok(formatter);+ if !has_custom_template {+ if let Some(formatter) = native_formatter_for(&model_type_lower, &display_name_lower) {+ return Ok(formatter);+ }
}
As per coding guidelines, preserve explicit prompt semantics through the preprocessing path.
Reviewing files that changed from the base of the PR and between 3aafbef and 419ec25.
Files selected for processing: 1
lib/llm/src/preprocessor/prompt.rs
Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.
👋 Hi gshtrasberg! Thank you for contributing to ai-dynamo/dynamo.
Just a reminder: The NVIDIA Test Github Validation CI runs an essential subset of the testing framework to quickly catch errors.Your PR reviewers may elect to test the changes comprehensively before approving your changes.
Nothing in lib/llm checks which formatter this call returns for a native-formatter model_type, so a revert of this line would go unnoticed. This test passes at this head and fails with the old deepseek_formatter_for call, where the mock card renders its Llama template.
Follow-up idea: this returns before chat_template_file is read, so --custom-jinja-template no longer applies to Inkling, though its help promises precedence (DeepSeek and Kimi K3 already do this). Worth a warning in a separate PR? Happy to leave it as-is.
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
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.
Overview
deepseek_formatter_for is unconditionally called, so models like inkling end up falling back to jinja
Key Changes
There is already support for InklingFormatter, but it is only used in native_formatter_for, which would fall back to deepseek_formatter_for in case the model is not "inkling_mm_model"
Validation
Running an inkling model.
Before the change Jinja template is used
After the change native inkling formatter is used, which emits the compact tool JAON
Summary by CodeRabbit