MCPcopy Create free account
hub / github.com/Noumena-Network/code / modelSupportsEffort

Function modelSupportsEffort

src/utils/effort.ts:29–59  ·  view source on GitHub ↗
(model: string)

Source from the content-addressed store, hash-verified

27
28// @[MODEL LAUNCH]: Add the new model to the allowlist if it supports the effort parameter.
29export function modelSupportsEffort(model: string): boolean {
30 const ncodeModel = resolveNCodeManagedModel(model)
31 if (ncodeModel) {
32 return true
33 }
34 const m = model.toLowerCase()
35 if (isEnvTruthy(process.env.CLAUDE_CODE_ALWAYS_ENABLE_EFFORT)) {
36 return true
37 }
38 const supported3P = get3PModelCapabilityOverride(model, 'effort')
39 if (supported3P !== undefined) {
40 return supported3P
41 }
42 // Supported by a subset of Claude 4 models
43 if (m.includes('opus-4-6') || m.includes('sonnet-4-6')) {
44 return true
45 }
46 // Exclude any other known legacy models (haiku, older opus/sonnet variants)
47 if (m.includes('haiku') || m.includes('sonnet') || m.includes('opus')) {
48 return false
49 }
50
51 // IMPORTANT: Do not change the default effort support without notifying
52 // the model launch DRI and research. This is a sensitive setting that can
53 // greatly affect model quality and bashing.
54
55 // Default to true for unknown model strings on 1P.
56 // Do not default to true for 3P as they have different formats for their
57 // model strings (ex. anthropics/claude-code#30795)
58 return getAPIProvider() === 'firstParty'
59}
60
61// @[MODEL LAUNCH]: Add the new model to the allowlist if it supports 'max' effort.
62// Per API docs, 'max' is Opus 4.6 only for public models — other models return an error.

Callers 7

ModelPickerFunction · 0.85
getDefaultEffortForModelFunction · 0.85
runHeadlessStreamingFunction · 0.85
configureEffortParamsFunction · 0.85
tipRegistry.tsFile · 0.85

Calls 3

isEnvTruthyFunction · 0.90
resolveNCodeManagedModelFunction · 0.85
getAPIProviderFunction · 0.85

Tested by

no test coverage detected