Skip to content

Commit 2485df1

Browse files
committed
Add vertex_ai/ prefix to model names for clarity
Models with litellm_provider starting with "vertex_ai" (e.g., "vertex_ai-language-models") now display with the vertex_ai/ prefix when the model name doesn't already include a provider prefix. This helps users understand that these models require GCP/Vertex AI credentials rather than simple API key authentication. Fixes issue where models like "gemini-2.0-flash" appeared without indication that they default to Vertex AI auth.
1 parent 762df40 commit 2485df1

1 file changed

Lines changed: 24 additions & 4 deletions

File tree

src/App.svelte

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,26 @@ We also need to update [${RESOURCE_BACKUP_NAME}](https://github.com/${REPO_FULL_
141141
});
142142
}
143143
144+
/**
145+
* Get the display name for a model, adding provider prefix when needed.
146+
* This helps users understand which auth method is required.
147+
* e.g., "gemini-2.0-flash" with provider "vertex_ai-language-models" -> "vertex_ai/gemini-2.0-flash"
148+
*/
149+
function getDisplayModelName(name: string, litellm_provider: string): string {
150+
// If the model name already has a provider prefix, return as-is
151+
if (name.includes('/')) {
152+
return name;
153+
}
154+
155+
// Add prefix for vertex_ai models so users know they need GCP credentials
156+
// Provider can be "vertex_ai", "vertex_ai-language-models", etc.
157+
if (litellm_provider && litellm_provider.startsWith('vertex_ai')) {
158+
return `vertex_ai/${name}`;
159+
}
160+
161+
return name;
162+
}
163+
144164
function toggleRow(name: string) {
145165
if (expandedRows.has(name)) {
146166
expandedRows.delete(name);
@@ -329,10 +349,10 @@ We also need to update [${RESOURCE_BACKUP_NAME}](https://github.com/${REPO_FULL_
329349
</div>
330350
{/if}
331351
</div>
332-
<span class="model-title">{name}</span>
333-
<button
334-
class="copy-button"
335-
on:click|stopPropagation={() => copyToClipboard(name)}
352+
<span class="model-title">{getDisplayModelName(name, litellm_provider)}</span>
353+
<button
354+
class="copy-button"
355+
on:click|stopPropagation={() => copyToClipboard(getDisplayModelName(name, litellm_provider))}
336356
title="Copy model name"
337357
type="button"
338358
>

0 commit comments

Comments
 (0)