export function buildProviderScopedModel(model: string, provider?: string | null): string { if (!provider) { return model; } const trimmedProvider = provider.trim(); if (!trimmedProvider) { return model; } const colonIndex = model.indexOf(":"); const baseModel = colonIndex === -1 ? model : model.slice(0, colonIndex); return `${baseModel}:${trimmedProvider}`; }