Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 32 additions & 9 deletions scripts/names.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,16 +189,39 @@ export function generateDisplayName(modelId: string): string {
return DISPLAY_NAMES[modelId];
}

let name = modelId;
if (modelId.indexOf('/') > -1) {
const parts = modelId.split('/');
const last = parts.at(-1) || modelId;
// Handle fine-tuned models (e.g., "ft:gpt-4o-mini-2024-07-18")
let isFineTuned = false;
let baseModelId = modelId;
if (modelId.startsWith('ft:')) {
isFineTuned = true;
baseModelId = modelId.substring(3); // Remove "ft:" prefix
}

let name = baseModelId;

// Check if base model has a display name
if (DISPLAY_NAMES[baseModelId]) {
name = DISPLAY_NAMES[baseModelId];
} else if (baseModelId.indexOf('/') > -1) {
// Handle slash-separated IDs
const parts = baseModelId.split('/');
const last = parts.at(-1) || baseModelId;
name = DISPLAY_NAMES[last] || last;
// Apply title-case transformation to slash-separated IDs
name = name
.split('-')
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
.join(' ')
.replace(/Gpt/gi, 'GPT');
} else {
// Auto-generate name from ID
name = baseModelId
.split('-')
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
.join(' ')
.replace(/Gpt/gi, 'GPT');
}

return name
.split('-')
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
.join(' ')
.replace(/Gpt/gi, 'GPT');
// Add fine-tuned suffix if applicable
return isFineTuned ? `${name} [Fine-tuned]` : name;
}
4 changes: 3 additions & 1 deletion src/data/capabilities.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Auto-generated file - do not edit manually
// Generated at: 2025-09-18T17:31:20.623Z
// Generated at: 2025-10-15T12:44:43.477Z

export const ALL_CAPABILITIES = [
"supports_assistant_prefill",
Expand All @@ -15,6 +15,7 @@ export const ALL_CAPABILITIES = [
"supports_prompt_caching",
"supports_reasoning",
"supports_response_schema",
"supports_service_tier",
"supports_system_messages",
"supports_tool_choice",
"supports_url_context",
Expand All @@ -37,6 +38,7 @@ export const CAPABILITY_FRIENDLY_NAMES = {
"prompt_caching": "supports_prompt_caching",
"reasoning": "supports_reasoning",
"response_schema": "supports_response_schema",
"service_tier": "supports_service_tier",
"system_messages": "supports_system_messages",
"tool_choice": "supports_tool_choice",
"url_context": "supports_url_context",
Expand Down
Loading