{"record":{"id":"d50dab9bfb5eb254","repo":"charmbracelet/crush","slug":"s-model-q-not-found","errorCode":null,"errorMessage":"%s model %q not found","messagePattern":"(.+?) model %q not found","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/app/provider.go","lineNumber":81,"sourceCode":"\t\t\tif filter(smallModelID, smallProviderFilter, m.ID, name) {\n\t\t\t\tsmallMatches = append(smallMatches, modelMatch{provider: name, modelID: m.ID})\n\t\t\t}\n\t\t}\n\t}\n\n\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":63,"sourceCodeEnd":96,"githubUrl":"https://github.com/charmbracelet/crush/blob/7944b8e52225d8805e31eacbf7ef24856b0dfb7a/internal/app/provider.go#L63-L96","documentation":"After filtering, validateMatches expects exactly one model matching the requested model ID within the provider. Zero matches means the requested model does not exist in the resolved provider's model list (from catwalk/provider data).","triggerScenarios":"overrideModelsForNonInteractive finds no model whose ID equals the requested modelID for the given label (large/small); e.g. a model string like 'openai/gpt-99' or a model ID that changed upstream.","commonSituations":"Deprecated/renamed model IDs; provider updated its catalog and the local snapshot lacks the model; typo in model name; using an internal alias that isn't in the provider catalog.","solutions":["Run 'crush models' to list valid model IDs and pick a matching one","Correct the model ID spelling or use the current upstream name","Update crush/config data (catwalk snapshot) so the provider catalog includes the model"],"exampleFix":"// before\ncrush run --model openai/gpt-4-32k  # removed upstream\n// after\ncrush run --model openai/gpt-4o","handlingStrategy":"validation","validationCode":"models := config.ModelsForProvider(provider)\nfound := false\nfor _, m := range models {\n    if m.ID == requestedModel {\n        found = true\n        break\n    }\n}\nif !found {\n    return fmt.Errorf(\"model %q not available for provider %q\", requestedModel, provider)\n}","typeGuard":null,"tryCatchPattern":"if _, _, err := overrideModelsForNonInteractive(...); err != nil {\n    if strings.Contains(err.Error(), \"not found\") {\n        return fmt.Errorf(\"unknown model: %w (run 'crush models')\", err)\n    }\n    return err\n}","preventionTips":["Refresh model catalogs (catwalk data) regularly","Pin model IDs in scripts and update them when providers deprecate","List valid models with 'crush models' before upgrading"],"tags":["config","model","cli"],"backgroundTag":"model-not-found","analyzedSha":"7944b8e52225d8805e31eacbf7ef24856b0dfb7a","analyzedAt":"2026-08-29T12:48:59.079Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}