MCPcopy Create free account
hub / github.com/codeaashu/claude-code / modelBelongsToFamily

Function modelBelongsToFamily

src/utils/model/modelAllowlist.ts:10–20  ·  view source on GitHub ↗

* Check if a model belongs to a given family by checking if its name * (or resolved name) contains the family identifier.

(model: string, family: string)

Source from the content-addressed store, hash-verified

8 * (or resolved name) contains the family identifier.
9 */
10function modelBelongsToFamily(model: string, family: string): boolean {
11 if (model.includes(family)) {
12 return true
13 }
14 // Resolve aliases like "best" → "claude-opus-4-6" to check family membership
15 if (isModelAlias(model)) {
16 const resolved = parseUserSpecifiedModel(model).toLowerCase()
17 return resolved.includes(family)
18 }
19 return false
20}
21
22/**
23 * Check if a model name starts with a prefix at a segment boundary.

Callers 1

isModelAllowedFunction · 0.85

Calls 2

isModelAliasFunction · 0.85
parseUserSpecifiedModelFunction · 0.85

Tested by

no test coverage detected