continue-custom/extensions/cli/src/utils/modelCapability.ts
Aaron Lippold 528a8abceb
fix(cli): expand model capability detection to include Llama, Nemotron, and Mistral (#8845)
* fix(cli): expand model capability detection to include Llama, Nemotron, and Mistral models

The isModelCapable function was showing false warnings for Llama, Nemotron,
and Mistral models, claiming they had "limited reasoning and tool calling
capabilities" when they actually have excellent capabilities.

**Changes:**
- Added /llama/, /nemotron/, /mistral/ patterns to capability detection regex
- Updated tests to reflect that these model families ARE capable
- All tests passing (26/26)

**Research validation:**
- Llama 3.3/Nemotron: #1 on alignment benchmarks, Arena Hard 85.0
- Mistral: 81.2% MMLU, supports function calling and JSON mode
- Both families widely used for agent workflows with proven tool calling

**Impact:**
- Removes false warnings for users of these popular model families
- Enables proper multiEdit tool usage for capable models
- Aligns detection with real-world model capabilities

Tested with nvidia/Llama-3_3-Nemotron-Super-49B-v1 on MITRE AIP endpoints.

Authored by: Aaron Lippold <lippold@gmail.com>

* fix: missing comma after grok

---------

Co-authored-by: Dallin Romney <dallinromney@gmail.com>
2025-12-05 12:14:00 -08:00

36 lines
752 B
TypeScript

/**
* Determines if a model is recommended for use with `cn`
*/
export function isModelCapable(
provider: string,
name: string,
model?: string,
): boolean {
// Check both name and model properties
const normalizedName = name.toLowerCase();
const normalizedModel = model ? model.toLowerCase() : "";
const patterns = [
/gemini/,
/claude/,
/gpt/,
/o\d/,
/kimi/,
/qwen/,
/llama/,
/nemotron/,
/grok/,
/mistral/,
];
// If either name OR model matches any of the patterns, consider it capable
if (patterns.some((pattern) => pattern.test(normalizedName))) {
return true;
}
if (model && patterns.some((pattern) => pattern.test(normalizedModel))) {
return true;
}
return false;
}