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

Function getDefaultEffortForModel

src/utils/effort.ts:302–358  ·  view source on GitHub ↗
(
  model: string,
)

Source from the content-addressed store, hash-verified

300
301// @[MODEL LAUNCH]: Update the default effort levels for new models
302export function getDefaultEffortForModel(
303 model: string,
304): EffortValue | undefined {
305 const ncodeModel = resolveNCodeManagedModel(model)
306 if (ncodeModel) {
307 return ncodeModel.defaultEffortLevel
308 }
309
310 if (isInternalBuild()) {
311 const config = getAntModelOverrideConfig()
312 const isDefaultModel =
313 config?.defaultModel !== undefined &&
314 model.toLowerCase() === config.defaultModel.toLowerCase()
315 if (isDefaultModel && config?.defaultModelEffortLevel) {
316 return config.defaultModelEffortLevel
317 }
318 const antModel = resolveAntModel(model)
319 if (antModel) {
320 if (antModel.defaultEffortLevel) {
321 return antModel.defaultEffortLevel
322 }
323 if (antModel.defaultEffortValue !== undefined) {
324 return antModel.defaultEffortValue
325 }
326 }
327 // Always default ants to undefined/high
328 return undefined
329 }
330
331 // IMPORTANT: Do not change the default effort level without notifying
332 // the model launch DRI and research. Default effort is a sensitive setting
333 // that can greatly affect model quality and bashing.
334
335 // Default effort on Opus 4.6 to medium for Pro.
336 // Max/Team also get medium when the ncode_grey_step2 config is enabled.
337 if (model.toLowerCase().includes('opus-4-6')) {
338 const session = getCurrentSubscriptionSessionState()
339 if (session.isProSubscriber) {
340 return 'medium'
341 }
342 if (
343 getOpusDefaultEffortConfig().enabled &&
344 (session.isMaxSubscriber || session.isTeamSubscriber)
345 ) {
346 return 'medium'
347 }
348 }
349
350 // When ultrathink feature is on, default effort to medium (ultrathink bumps to high)
351 if (isUltrathinkEnabled() && modelSupportsEffort(model)) {
352 return 'medium'
353 }
354
355 // Fallback to undefined, which means we don't set an effort level. This
356 // should resolve to high effort level in the API.
357 return undefined
358}

Callers 4

EffortCalloutFunction · 0.85
resolveAppliedEffortFunction · 0.85

Calls 8

resolveNCodeManagedModelFunction · 0.85
isInternalBuildFunction · 0.85
resolveAntModelFunction · 0.85
isUltrathinkEnabledFunction · 0.85
modelSupportsEffortFunction · 0.85

Tested by

no test coverage detected