1import { getAllOpenRouterModelIds } from './openRouterF.mts'3const knownBadModels = new Set([4 'black-forest-labs/flux-pro-1.1',5 'black-forest-labs/flux-kontext-pro',6])8import { isModelFailed } from './markModelFailedAI.mts'10const warnedModels = new Set<string>()12export const getValidatedModels = async (modelsA: string[]) => {13 const openRouterModelIds = new Set(await getAllOpenRouterModelIds())14 const validatedA: string[] = []15 for (const model of modelsA) {16 if (knownBadModels.has(model) || isModelFailed(model)) continue17 if (openRouterModelIds.has(model)) {18 validatedA.push(model)19 } else if (!warnedModels.has(model)) {20 console.warn('Model not found in OpenRouter, skipping:', model)21 warnedModels.add(model)22 }23 }24 return validatedA25}