Skip to content

Commit 46b7dd9

Browse files
committed
Combine the Features and Capabilities data into just Features
1 parent 375d9b8 commit 46b7dd9

6 files changed

Lines changed: 82 additions & 192 deletions

File tree

apps/webapp/app/presenters/v3/ModelRegistryPresenter.server.ts

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,12 @@ export type ModelCatalogItem = {
6464
description: string | null;
6565
contextWindow: number | null;
6666
maxOutputTokens: number | null;
67-
capabilities: string[];
67+
/** Combined capabilities (from DB) and boolean feature flags (from catalog) as slug strings. */
68+
features: string[];
6869
inputPrice: number | null;
6970
outputPrice: number | null;
7071
/** When the model was publicly released (from startDate on LlmModel). */
7172
releaseDate: string | null;
72-
supportsStructuredOutput: boolean;
73-
supportsParallelToolCalls: boolean;
74-
supportsStreamingToolCalls: boolean;
7573
/** Dated variants of this model (only populated on base models). */
7674
variants: ModelVariant[];
7775
};
@@ -98,6 +96,17 @@ export type ModelDetail = ModelCatalogItem & {
9896
}>;
9997
};
10098

99+
function buildFeatures(
100+
capabilities: string[],
101+
catalogEntry: { supportsStructuredOutput: boolean; supportsParallelToolCalls: boolean; supportsStreamingToolCalls: boolean } | undefined
102+
): string[] {
103+
const features = [...capabilities];
104+
if (catalogEntry?.supportsStructuredOutput) features.push("structured_output");
105+
if (catalogEntry?.supportsParallelToolCalls) features.push("parallel_tool_calls");
106+
if (catalogEntry?.supportsStreamingToolCalls) features.push("streaming_tool_calls");
107+
return features;
108+
}
109+
101110
export type ModelMetricsPoint = {
102111
minute: string;
103112
callCount: number;
@@ -214,13 +223,10 @@ export class ModelRegistryPresenter extends BasePresenter {
214223
description: m.description,
215224
contextWindow: m.contextWindow,
216225
maxOutputTokens: m.maxOutputTokens,
217-
capabilities: m.capabilities,
226+
features: buildFeatures(m.capabilities, catalogEntry),
218227
inputPrice: inputPrice ? Number(inputPrice.price) : null,
219228
outputPrice: outputPrice ? Number(outputPrice.price) : null,
220229
releaseDate: m.startDate ? m.startDate.toISOString().split("T")[0] : null,
221-
supportsStructuredOutput: catalogEntry?.supportsStructuredOutput ?? false,
222-
supportsParallelToolCalls: catalogEntry?.supportsParallelToolCalls ?? false,
223-
supportsStreamingToolCalls: catalogEntry?.supportsStreamingToolCalls ?? false,
224230
variants: [],
225231
_baseModelName: m.baseModelName,
226232
};
@@ -331,13 +337,10 @@ export class ModelRegistryPresenter extends BasePresenter {
331337
description: model.description,
332338
contextWindow: model.contextWindow,
333339
maxOutputTokens: model.maxOutputTokens,
334-
capabilities: model.capabilities,
340+
features: buildFeatures(model.capabilities, catalogEntry),
335341
inputPrice: inputPrice ? Number(inputPrice.price) : null,
336342
outputPrice: outputPrice ? Number(outputPrice.price) : null,
337343
releaseDate: model.startDate ? model.startDate.toISOString().split("T")[0] : null,
338-
supportsStructuredOutput: catalogEntry?.supportsStructuredOutput ?? false,
339-
supportsParallelToolCalls: catalogEntry?.supportsParallelToolCalls ?? false,
340-
supportsStreamingToolCalls: catalogEntry?.supportsStreamingToolCalls ?? false,
341344
variants: [],
342345
matchPattern: model.matchPattern,
343346
source: model.source,

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.models.$modelId/route.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ import {
4242
formatModelPrice,
4343
formatTokenCount,
4444
formatModelCost,
45-
formatCapability,
45+
formatFeature,
4646
formatProviderName,
4747
} from "~/utils/modelFormatters";
4848

@@ -312,14 +312,14 @@ function OverviewTab({
312312
</Property.Value>
313313
</Property.Item>
314314
)}
315-
{model.capabilities.length > 0 && (
315+
{model.features.length > 0 && (
316316
<Property.Item>
317-
<Property.Label>Capabilities</Property.Label>
317+
<Property.Label>Features</Property.Label>
318318
<Property.Value>
319319
<div className="flex flex-wrap gap-1">
320-
{model.capabilities.map((cap) => (
321-
<Badge key={cap} variant="outline-rounded">
322-
{formatCapability(cap)}
320+
{model.features.map((f) => (
321+
<Badge key={f} variant="outline-rounded">
322+
{formatFeature(f)}
323323
</Badge>
324324
))}
325325
</div>

0 commit comments

Comments
 (0)