charmbracelet/crush · error
default large model %s not found for provider %s
Error message
default large model %s not found for provider %s
What it means
defaultModelSelection resolves fallback large models when no explicit large model is selected. For each enabled provider it looks up the provider's DefaultLargeModelID via Config.GetModel; if the ID is not present in the provider's model catalog (or in known catwalk providers), it warns and throws. If the provider has no models at all to fall back to, the error becomes fatal and bubbles up wrapped by resolveSelectedModels.
Source
Thrown at internal/config/load.go:733
func (c *Config) defaultModelSelection(knownProviders []catwalk.Provider) (largeModel SelectedModel, smallModel SelectedModel, err error) {
if len(knownProviders) == 0 && c.Providers.Len() == 0 {
err = fmt.Errorf("no providers configured, please configure at least one provider")
return largeModel, smallModel, err
}
// Use the first provider enabled based on the known providers order
// if no provider found that is known use the first provider configured
for _, p := range knownProviders {
providerConfig, ok := c.Providers.Get(string(p.ID))
if !ok || providerConfig.Disable {
continue
}
defaultLargeModel := c.GetModel(string(p.ID), p.DefaultLargeModelID)
if defaultLargeModel == nil {
slog.Warn("Default large model %s not found for provider %s", p.DefaultLargeModelID, p.ID)
if len(providerConfig.Models) == 0 {
return largeModel, smallModel, fmt.Errorf("default large model %s not found for provider %s", p.DefaultLargeModelID, p.ID)
}
defaultLargeModel = &providerConfig.Models[0]
}
largeModel = SelectedModel{
Provider: string(p.ID),
Model: defaultLargeModel.ID,
MaxTokens: defaultLargeModel.DefaultMaxTokens,
ReasoningEffort: defaultLargeModel.DefaultReasoningEffort,
}
defaultSmallModel := c.GetModel(string(p.ID), p.DefaultSmallModelID)
if defaultSmallModel == nil {
slog.Warn("Default small model %s not found for provider %s", p.DefaultSmallModelID, p.ID)
if len(providerConfig.Models) == 0 {
return largeModel, smallModel, fmt.Errorf("default small model %s not found for provider %s", p.DefaultSmallModelID, p.ID)
}
defaultSmallModel = &providerConfig.Models[0]
}View on GitHub (pinned to 7944b8e522)
Solutions
- Fix the provider's DefaultLargeModelID in your crush config to an ID that exists in that provider's model list
- Run the models command (crush models) to list valid model IDs for the provider
- Ensure at least one model is defined under the provider's models so the fallback to Models[0] can kick in
- Update the provider catalog so the referenced default model resolves
Example fix
// before
"provider": { "id": "anthropic", "default_model_large": "claude-4-opus" }
// after
"provider": { "id": "anthropic", "default_model_large": "claude-sonnet-4-20250514" } Defensive patterns
Strategy: validation
Validate before calling
for id, p := range cfg.Providers {
if cfg.GetModel(string(p.ID), p.DefaultLargeModelID) == nil {
fmt.Printf("provider %s: unknown default large model %q\n", p.ID, p.DefaultLargeModelID)
}
} Try / catch
if _, _, err := config.Load(ctx, ...); err != nil {
if strings.Contains(err.Error(), "default large model") {
// prompt user to fix default_model_large, then retry
}
} Prevention
- Always pick default_model_large from the IDs listed by crush models
- Keep default model IDs in sync when upgrading a provider's catalog
- Never hand-copy model IDs across providers
When it happens
Trigger: Calling config.Load (or reloadFromDiskLocked) when a provider entry sets default_model_large (or p.DefaultLargeModelID) to an ID that GetModel cannot resolve: the model is missing from providerConfig.Models and is not in the catwalk provider catalog.
Common situations: Typo in the default large model ID in crush.json/crushrc; provider renamed/removed a model so the pinned default no longer exists; catwalk provider catalog out of date; hand-edited config referencing a model from a different provider.
Related errors
- default small model %s not found for provider %s
- coder agent not configured
- coder agent configuration is missing
- failed to initialize config: %w
- provider %s has no models configured
AI-assisted analysis of charmbracelet/crush@7944b8e522 (2026-08-29).
Data as JSON: /api/errors/a9d5c46d8ce23384.
Report an issue: GitHub.