MCPcopy Create free account
hub / github.com/CopilotKit/aimock / isReasoningModel

Function isReasoningModel

src/model-utils.ts:118–137  ·  view source on GitHub ↗
(model: string | undefined)

Source from the content-addressed store, hash-verified

116 * (assume capable) — see the policy note above.
117 */
118export function isReasoningModel(model: string | undefined): boolean {
119 if (!model) return true;
120
121 const normalized = normalizeModelName(model)?.toLowerCase() ?? "";
122 const id = stripProviderPrefix(normalized);
123
124 // Env overrides win, parsed fresh so they remain test-stubbable.
125 const envNon = parseEnvList(process.env.AIMOCK_NONREASONING_MODELS);
126 if (matchesAny(id, envNon)) return false;
127 const envReasoning = parseEnvList(process.env.AIMOCK_REASONING_MODELS);
128 if (matchesAny(id, envReasoning)) return true;
129
130 // Built-in denylist is the active guard.
131 if (matchesAny(id, NONREASONING_FAMILIES)) return false;
132 // Built-in reasoning list short-circuits to capable.
133 if (matchesAny(id, REASONING_FAMILIES)) return true;
134
135 // Unknown → assume reasoning-capable (fail open).
136 return true;
137}

Callers 3

resolveReasoningForModelFunction · 0.85

Calls 4

normalizeModelNameFunction · 0.85
stripProviderPrefixFunction · 0.85
parseEnvListFunction · 0.85
matchesAnyFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…