Fix Llama model fallback logic in modelCapabilities.ts #935
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.
This pull request updates the fallback logic for Llama models in
modelCapabilities.ts.Llama 3
The current fallback logic for Llama3 behaves as follows (in order):
modelNameincludesllama3→ usellama3modelNameincludesllama3.1→ usellama3.1modelNameincludesllama3.2→ usellama3.2modelNameincludesllama3.3→ usellama3.3With this order, any
modelNamethat includesllama3.1,llama3.2orllama3.3matches clause (1), and is captured by the genericllama3before it can fall back to the more specificllama3.1,llama3.2, orllama3.3variants as intended.This PR fixes the issue by moving clause (1) to the end, so that the specific
llama3.1/llama3.2/llama3.3take precedence over the genericllama3match.Llama 4
Currently a
modelNamematchingllama4-maverickincorrectly falls back tollama4-scout. This PR also fixes this issue.