charmbracelet/crush · error

%s model %q not found

Error message

%s model %q not found

What it means

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).

Source

Thrown at internal/app/provider.go:81

			if filter(smallModelID, smallProviderFilter, m.ID, name) {
				smallMatches = append(smallMatches, modelMatch{provider: name, modelID: m.ID})
			}
		}
	}

	return largeMatches, smallMatches, nil
}

func filter(modelFilter, providerFilter, model, provider string) bool {
	return modelFilter != "" && strings.EqualFold(model, modelFilter) &&
		(providerFilter == "" || strings.EqualFold(provider, providerFilter))
}

// Validate and return a single match.
func validateMatches(matches []modelMatch, modelID, label string) (modelMatch, error) {
	switch {
	case len(matches) == 0:
		return modelMatch{}, fmt.Errorf("%s model %q not found", label, modelID)
	case len(matches) > 1:
		names := make([]string, len(matches))
		for i, m := range matches {
			names[i] = m.provider
		}
		return modelMatch{}, fmt.Errorf(
			"%s model: model %q found in multiple providers: %s. Please specify provider using 'provider/model' format",
			label,
			modelID,
			xstrings.EnglishJoin(names, true),
		)
	}
	return matches[0], nil
}

View on GitHub (pinned to 7944b8e522)

Solutions

  1. Run 'crush models' to list valid model IDs and pick a matching one
  2. Correct the model ID spelling or use the current upstream name
  3. Update crush/config data (catwalk snapshot) so the provider catalog includes the model

Example fix

// before
crush run --model openai/gpt-4-32k  # removed upstream
// after
crush run --model openai/gpt-4o
Defensive patterns

Strategy: validation

Validate before calling

models := config.ModelsForProvider(provider)
found := false
for _, m := range models {
    if m.ID == requestedModel {
        found = true
        break
    }
}
if !found {
    return fmt.Errorf("model %q not available for provider %q", requestedModel, provider)
}

Try / catch

if _, _, err := overrideModelsForNonInteractive(...); err != nil {
    if strings.Contains(err.Error(), "not found") {
        return fmt.Errorf("unknown model: %w (run 'crush models')", err)
    }
    return err
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of charmbracelet/crush@7944b8e522 (2026-08-29). Data as JSON: /api/errors/d50dab9bfb5eb254. Report an issue: GitHub.