{"record":{"id":"5cb0a4919c0996ee","repo":"charmbracelet/crush","slug":"s-model-model-q-found-in-multiple-providers-s","errorCode":null,"errorMessage":"%s model: model %q found in multiple providers: %s. Please specify provider using 'provider/model' format","messagePattern":"(.+?) model: model %q found in multiple providers: (.+?)\\. Please specify provider using 'provider/model' format","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/app/provider.go","lineNumber":87,"sourceCode":"\treturn largeMatches, smallMatches, nil\n}\n\nfunc filter(modelFilter, providerFilter, model, provider string) bool {\n\treturn modelFilter != \"\" && strings.EqualFold(model, modelFilter) &&\n\t\t(providerFilter == \"\" || strings.EqualFold(provider, providerFilter))\n}\n\n// Validate and return a single match.\nfunc validateMatches(matches []modelMatch, modelID, label string) (modelMatch, error) {\n\tswitch {\n\tcase len(matches) == 0:\n\t\treturn modelMatch{}, fmt.Errorf(\"%s model %q not found\", label, modelID)\n\tcase len(matches) > 1:\n\t\tnames := make([]string, len(matches))\n\t\tfor i, m := range matches {\n\t\t\tnames[i] = m.provider\n\t\t}\n\t\treturn modelMatch{}, fmt.Errorf(\n\t\t\t\"%s model: model %q found in multiple providers: %s. Please specify provider using 'provider/model' format\",\n\t\t\tlabel,\n\t\t\tmodelID,\n\t\t\txstrings.EnglishJoin(names, true),\n\t\t)\n\t}\n\treturn matches[0], nil\n}\n","sourceCodeStart":69,"sourceCodeEnd":96,"githubUrl":"https://github.com/charmbracelet/crush/blob/7944b8e52225d8805e31eacbf7ef24856b0dfb7a/internal/app/provider.go#L69-L96","documentation":"When a bare model ID (without 'provider/' prefix) matches models in more than one configured provider, the resolver cannot disambiguate and refuses to guess. It lists all matching providers and asks the user to qualify the model as 'provider/model'.","triggerScenarios":"Calling overrideModelsForNonInteractive with a model filter like 'claude-sonnet-4' that exists under two configured providers (e.g. both 'anthropic' and 'bedrock' expose the same ID); validateMatches gets len(matches) > 1.","commonSituations":"Same model ID served by multiple providers configured simultaneously (Anthropic direct vs Bedrock vs Copilot); running non-interactive scripts that omit the provider prefix the TUI would normally disambiguate.","solutions":["Use the qualified form 'provider/model' in the flag/config (e.g. 'anthropic/claude-sonnet-4')","Remove or disable the duplicate provider from config if unintended","Pick a model ID unique to one provider"],"exampleFix":"// before\ncrush run --model claude-sonnet-4\n// after\ncrush run --model anthropic/claude-sonnet-4","handlingStrategy":"validation","validationCode":"if !strings.Contains(modelArg, \"/\") {\n    return fmt.Errorf(\"model %q is ambiguous across providers; use provider/model\", modelArg)\n}","typeGuard":null,"tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"found in multiple providers\") {\n    return fmt.Errorf(\"disambiguate the model: %w\", err)\n}","preventionTips":["Always prefix model IDs with provider in non-interactive invocations","Avoid configuring multiple providers that expose the same model IDs unless needed","Default scripts to fully qualified model names"],"tags":["config","model","ambiguity"],"backgroundTag":"ambiguous-model-id","analyzedSha":"7944b8e52225d8805e31eacbf7ef24856b0dfb7a","analyzedAt":"2026-08-29T12:48:59.079Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}