charmbracelet/crush · error

%s model: model %q found in multiple providers: %s. Please s

Error message

%s model: model %q found in multiple providers: %s. Please specify provider using 'provider/model' format

What it means

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

Source

Thrown at internal/app/provider.go:87

	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. Use the qualified form 'provider/model' in the flag/config (e.g. 'anthropic/claude-sonnet-4')
  2. Remove or disable the duplicate provider from config if unintended
  3. Pick a model ID unique to one provider

Example fix

// before
crush run --model claude-sonnet-4
// after
crush run --model anthropic/claude-sonnet-4
Defensive patterns

Strategy: validation

Validate before calling

if !strings.Contains(modelArg, "/") {
    return fmt.Errorf("model %q is ambiguous across providers; use provider/model", modelArg)
}

Try / catch

if err != nil && strings.Contains(err.Error(), "found in multiple providers") {
    return fmt.Errorf("disambiguate the model: %w", err)
}

Prevention

When it happens

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

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

Related errors


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