Skip to content

Commit 3bcc51a

Browse files
committed
feat(continue-watsonx-ai-provider): filter out models without native tool support
1 parent 65976a0 commit 3bcc51a

2 files changed

Lines changed: 20 additions & 3 deletions

File tree

packages/types/src/providers/ibm-watsonx.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,21 @@ export const WATSONX_NON_INFERENCE_MODELS = [
2020
"ibm/granite-guardian-3-2b",
2121
] as const
2222

23+
/**
24+
* Models that don't support tool_calls (native tools).
25+
*/
26+
export const WATSONX_NON_TOOL_CALLS_MODELS = [
27+
"ibm/granite-3-2-8b-instruct",
28+
"ibm/granite-3-3-8b-instruct",
29+
"ibm/granite-3-3-8b-instruct-np",
30+
"ibm/granite-3-8b-instruct",
31+
"mistral-large-2512",
32+
"mistralai/mistral-medium-2505",
33+
"mistralai/mistral-small-3-1-24b-instruct-2503",
34+
] as const
35+
2336
export type WatsonxAIModelId = keyof typeof watsonxModels
24-
export const watsonxDefaultModelId = "ibm/granite-3-3-8b-instruct"
37+
export const watsonxDefaultModelId = "ibm/granite-4-h-small"
2538

2639
// Common model properties
2740
export const baseModelInfo: ModelInfo = {
@@ -35,7 +48,7 @@ export const baseModelInfo: ModelInfo = {
3548

3649
export const watsonxModels = {
3750
// IBM Granite model
38-
"ibm/granite-3-3-8b-instruct": {
51+
"ibm/granite-4-h-small": {
3952
...baseModelInfo,
4053
},
4154
} as const satisfies Record<string, ModelInfo>

src/api/providers/fetchers/ibm-watsonx.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ModelInfo, REGION_TO_URL, WATSONX_NON_INFERENCE_MODELS } from "@roo-code/types"
1+
import { ModelInfo, REGION_TO_URL, WATSONX_NON_INFERENCE_MODELS, WATSONX_NON_TOOL_CALLS_MODELS } from "@roo-code/types"
22
import { IamAuthenticator, CloudPakForDataAuthenticator, UserOptions } from "ibm-cloud-sdk-core"
33
import { WatsonXAI } from "@ibm-cloud/watsonx-ai"
44
import WatsonxAiMlVml_v1 from "@ibm-cloud/watsonx-ai/dist/watsonx-ai-ml/vml_v1.js"
@@ -99,6 +99,10 @@ export async function getWatsonxModels(
9999
continue
100100
}
101101

102+
if (WATSONX_NON_TOOL_CALLS_MODELS.includes(modelId as any)) {
103+
continue
104+
}
105+
102106
const contextWindow = model.model_limits?.max_sequence_length || 128000
103107
const maxTokens =
104108
model.training_parameters?.max_output_tokens?.max || Math.floor(contextWindow / 16)

0 commit comments

Comments
 (0)