MCPcopy
hub / github.com/anomalyco/models.dev / inferFamily

Function inferFamily

packages/core/script/generate-digitalocean.ts:313–326  ·  view source on GitHub ↗
(modelId: string, modelName: string)

Source from the content-addressed store, hash-verified

311}
312
313function inferFamily(modelId: string, modelName: string): string | undefined {
314 const kimiFamily = inferKimiFamily(modelId, modelName);
315 if (kimiFamily !== undefined) return kimiFamily;
316
317 const sorted = [...ModelFamilyValues].sort((a, b) => b.length - a.length);
318 const targets = [modelId.toLowerCase(), modelName.toLowerCase()];
319 for (const family of sorted) {
320 const f = family.toLowerCase();
321 for (const t of targets) {
322 if (t.includes(f)) return family;
323 }
324 }
325 return undefined;
326}
327
328function getExistingLongContextCost(existing: ExistingModel | null) {
329 const tier = existing?.cost?.tiers?.find(

Callers 1

mergeModelFunction · 0.70

Calls 1

inferKimiFamilyFunction · 0.85

Tested by

no test coverage detected