Skip to content

sync_models: Handle model name collisions#418

Open
aswink wants to merge 2 commits intomainfrom
aswin/03-16-sync_models_handle_model_name_collisions
Open

sync_models: Handle model name collisions#418
aswink wants to merge 2 commits intomainfrom
aswin/03-16-sync_models_handle_model_name_collisions

Conversation

@aswink
Copy link
Contributor

@aswink aswink commented Mar 16, 2026

This is particularly important for the available_providers list, where we want
to list all of the matching providers if there are multiple. For example,
"gemini-flash" from vertex and "gemini/gemini-flash" would be collapsed into a
single entry, but we want both providers in available_providers.

This doesn't handle different pricing or parameters for the same model on
different providers, but is at least more deterministic than previously. For
now we always choose the provider that is alphabetically first.

This is particularly important for the available_providers list, where we want
to list all of the matching providers if there are multiple. For example,
"gemini-flash" from vertex and "gemini/gemini-flash" would be collapsed into a
single entry, but we want both providers in available_providers.

This doesn't handle different pricing or parameters for the same model on
different providers, but is at least more deterministic than previously. For
now we always choose the provider that is alphabetically first.
@vercel
Copy link

vercel bot commented Mar 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ai-proxy Ready Ready Preview, Comment Mar 16, 2026 11:25pm

Request Review

Copy link
Contributor Author

aswink commented Mar 16, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 416af553ee

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "Codex (@codex) review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".

Comment on lines +753 to +756
const resolvedRemote = resolveRemoteModels(remoteModels, argv.provider);

if (argv.provider) {
const lowerArgProvider = argv.provider.toLowerCase();
const modelProvider = modelDetail.litellm_provider?.toLowerCase();
const modelNameProviderPart = remoteModelName
.split("/")[0]
.toLowerCase();

if (
!modelProvider?.includes(lowerArgProvider) &&
!modelNameProviderPart.includes(lowerArgProvider) &&
!(modelProvider === lowerArgProvider) &&
!(modelNameProviderPart === lowerArgProvider)
) {
continue;
}
}
consideredRemoteModels[remoteModelName] = modelDetail;
}

const remoteModelNamesFiltered = new Set(
Object.keys(consideredRemoteModels),
);

for (const modelName of remoteModelNamesFiltered) {
const translatedModelName = translateToBraintrust(
modelName,
consideredRemoteModels[modelName]?.litellm_provider,
);
for (const [translatedName, { remoteModelName, remoteModel }] of resolvedRemote) {
consideredRemoteModels[remoteModelName] = remoteModel;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve per-provider counts in find-missing summary

Iterating over resolveRemoteModels(...) here collapses collisions down to a single primary provider before consideredRemoteModels is built, so find-missing --summarize no longer reports accurate totals for secondary providers. In collision cases (the commit message’s gemini/vertex example), those provider entries are dropped from the summary entirely, which can hide missing coverage for that provider and mislead follow-up sync work.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant