Skip to content

Update toolSupport.ts fixes for granite models from HF #4502

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 8, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions core/llm/toolSupport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,18 @@ export const PROVIDER_TOOL_SUPPORT: Record<
},
// https://ollama.com/search?c=tools
ollama: (model) => {
let modelName = "";
// Extract the model name after the last slash to support other registries
if(model.includes("/")) {
let parts = model.split('/');
modelName = parts[parts.length - 1];
} else {
modelName = model;
}

if (
["vision", "math", "guard", "mistrallite", "mistral-openorca"].some(
(part) => model.toLowerCase().includes(part),
(part) => modelName.toLowerCase().includes(part),
)
) {
return false;
Expand All @@ -79,10 +88,11 @@ export const PROVIDER_TOOL_SUPPORT: Record<
"nemotron",
"llama3-groq",
"granite3",
"granite-3",
"aya-expanse",
"firefunction-v2",
"mistral",
].some((part) => model.toLowerCase().startsWith(part))
].some((part) => modelName.toLowerCase().includes(part))
) {
return true;
}
Expand Down
Loading