charmbracelet/crush · error
no providers configured, please configure at least one provi
Error message
no providers configured, please configure at least one provider
What it means
defaultModelSelection picks default large/small models when none are explicitly selected. If there are no known catalog providers AND no configured custom providers, there is nothing to choose from, so it returns this error which propagates through resolveSelectedModels and Load.
Source
Thrown at internal/config/load.go:718
}
if len(cfg.RootMarkers) == 0 {
cfg.RootMarkers = base.RootMarkers
}
cfg.Command = cmp.Or(cfg.Command, base.Command)
if len(cfg.Args) == 0 {
cfg.Args = base.Args
}
if len(cfg.Env) == 0 {
cfg.Env = base.Environment
}
// Update the config in the map
c.LSP[name] = cfg
}
}
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]
}View on GitHub (pinned to 7944b8e522)
Solutions
- Configure at least one provider (custom or via login/models command)
- Check network access / catwalk catalog sync if known providers should exist
- Restore the providers section in crush.json/crushrc
- Run `crush models` to configure a provider and selected models explicitly
Example fix
// before
crush // no crush.json, catalog unavailable -> error
// after (crush.json)
{"providers": {"anthropic": {"api_key": "$ANTHROPIC_API_KEY"}}, "options": {"preferred_model": {"large": "anthropic/claude-sonnet-4-20250514", "small": "anthropic/claude-haiku-4-20250514"}}} Defensive patterns
Strategy: fallback
Validate before calling
if len(knownProviders) == 0 {
hasCustom := false
raw, _ := os.ReadFile("crush.json")
var c map[string]json.RawMessage
if json.Unmarshal(raw, &c) == nil {
if p, ok := c["providers"]; ok && string(p) != "{}" && string(p) != "null" {
hasCustom = true
}
}
if !hasCustom {
return errors.New("no providers available: configure one or restore network/catalog access")
}
} Try / catch
store, err := config.Load(ctx, opts)
if err != nil {
if strings.Contains(err.Error(), "no providers configured") {
// fallback: guide user to run `crush login` / `crush models`
return fmt.Errorf("run `crush models` to configure a provider: %w", err)
}
return err
} Prevention
- Run `crush models` right after install to configure a provider
- Ensure network access or a cached provider catalog on offline machines
- Always keep at least one provider entry in config
- Pin selected large/small models so bootstrap selection isn't required
When it happens
Trigger: resolveSelectedModels -> defaultModelSelection with len(knownProviders) == 0 && c.Providers.Len() == 0 — e.g. empty providers section, catwalk catalog empty/unavailable, or all providers disabled.
Common situations: Fresh install with no crush.json and the provider catalog failed to load; user deleted the providers section; offline environment where catwalk provider list can't be fetched and nothing is locally configured.
Related errors
- no providers found
- no providers found matching %q
- failed to configure selected models: %w
- model configuration not found
- no providers configured - please run 'crush' to set up a pro
AI-assisted analysis of charmbracelet/crush@7944b8e522 (2026-08-29).
Data as JSON: /api/errors/55e7a25aacb3832f.
Report an issue: GitHub.