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

Function describeModel

packages/core/src/describe.ts:24–96  ·  view source on GitHub ↗
(model: DescriptionInput)

Source from the content-addressed store, hash-verified

22}
23
24export function describeModel(model: DescriptionInput) {
25 const id = model.id ?? "";
26 const name = model.name ?? humanizeID(id);
27 const lab = labID(id, model.providerId);
28 const target = `${id} ${name} ${model.family ?? ""}`.toLowerCase();
29 const input = model.modalities?.input ?? [];
30 const output = model.modalities?.output ?? [];
31 const multimodal = input.some((value) => value !== "text");
32 const fast = has(target, /\b(flash|lite|mini|nano|small|fast|highspeed|ultraspeed|instant|turbo|micro)\b/);
33 const frontier = has(target, /\b(pro|opus|max|ultra|premier|large|frontier|maverick|behemoth|5\.5|5\.4|5\.3|4\.8|4\.7|4\.6|m3)\b/);
34 const free = has(target, /(^|[^a-z])free([^a-z]|$)|:free\b/);
35 const preview = model.status === "beta" || has(target, /\b(preview|beta|experimental)\b/);
36
37 if (model.status === "deprecated") {
38 return "Legacy model retained for compatibility with older integrations";
39 }
40
41 const special = specialDescription({
42 id,
43 lab,
44 name,
45 target,
46 input,
47 output,
48 multimodal,
49 fast,
50 frontier,
51 free,
52 preview,
53 model,
54 });
55 if (special !== undefined) return special;
56
57 if (free) {
58 return "Free provider route for experiments, demos, and cost-sensitive chat workloads";
59 }
60
61 if (preview) {
62 return "Preview model for early access evaluation, prototyping, and compatibility testing";
63 }
64
65 if (model.reasoning === true) {
66 if (fast) {
67 return "Efficient reasoning model for fast analysis, coding help, and agent workflows";
68 }
69 if (frontier) {
70 return "Flagship reasoning model for complex planning, coding, math, and tool use";
71 }
72 return "Reasoning model for deliberate analysis, multi-step problem solving, and tool use";
73 }
74
75 if (multimodal) {
76 return "Multimodal model for analyzing text, images, documents, and rich media";
77 }
78
79 if (model.open_weights === true) {
80 return "Open-weight instruction model for adaptable chat and self-hosted production workloads";
81 }

Callers 10

buildHuggingFaceModelFunction · 0.85
buildXAIModelFunction · 0.85
buildBasetenModelFunction · 0.85
buildVercelModelFunction · 0.85
buildOvhcloudModelFunction · 0.85
buildOpenRouterModelFunction · 0.85
buildLLMGatewayModelFunction · 0.85
buildVeniceModelFunction · 0.85
buildChutesModelFunction · 0.85
buildGoogleModelFunction · 0.85

Calls 4

humanizeIDFunction · 0.85
labIDFunction · 0.85
hasFunction · 0.85
specialDescriptionFunction · 0.85

Tested by

no test coverage detected