siyuan-note/siyuan · warning

catalog has no providers with API endpoints and valid models

Error message

catalog has no providers with API endpoints and valid models

What it means

After decoding and normalizing the models.dev catalog, no provider entry had both a usable API endpoint (api != "") and at least one valid model context limit, so the constructed catalog would be useless and is rejected. This validates semantic content rather than mere JSON shape.

Source

Thrown at kernel/agent/modelmeta_online.go:250

				suffix = suffix[idx+1:]
			}
			setConsistentModelContextLimit(providerCatalog.suffixes, providerAmbiguousSuffixes, suffix, limit)
			setConsistentModelContextLimit(catalog.models, ambiguousModels, lower, limit)
			setConsistentModelContextLimit(catalog.suffixes, ambiguousSuffixes, suffix, limit)
		}
		if len(providerCatalog.models) == 0 {
			continue
		}
		apis := append([]string{provider.API}, modelsDevAPIAliases[providerID]...)
		for _, providerAPI := range apis {
			api := normalizeModelsDevAPI(providerAPI)
			if api != "" {
				catalog.providers[api] = providerCatalog
			}
		}
	}
	if len(catalog.providers) == 0 {
		return nil, errors.New("catalog has no providers with API endpoints and valid models")
	}
	return catalog, nil
}

func setUniqueModelContextLimit(limits map[string]int, model string, limit int) {
	if existing := limits[model]; existing == 0 || existing == limit {
		limits[model] = limit
		return
	}
	delete(limits, model)
}

func setConsistentModelContextLimit(limits map[string]int, ambiguous map[string]bool, model string, limit int) {
	if ambiguous[model] {
		return
	}
	if existing := limits[model]; existing != 0 && existing != limit {
		delete(limits, model)

View on GitHub (pinned to 8641553a1f)

Solutions

  1. Inspect the raw catalog JSON to confirm the expected 'api' and model context fields are present
  2. Update SiYuan (or the parser) to match the current upstream models.dev schema
  3. Retry later in case upstream is mid-migration and serving degraded data
  4. Continue with the cached catalog or manually specify context lengths for your model if the app supports it
Defensive patterns

Strategy: fallback

Validate before calling

valid := 0
for _, p := range providers { if p.API != "" && len(p.Models) > 0 { valid++ } }
if valid == 0 { return nil, errors.New("catalog payload lacks usable providers") }

Try / catch

catalog, err := fetchModelsDevContextCatalog(ctx)
if err != nil { log.Printf("catalog unusable (%v); keeping previous catalog", err); catalog = cachedCatalog }

Prevention

When it happens

Trigger: The catalog response contains providers but every one lacks an API endpoint field or fails setUniqueModelContextLimit validation for all its models — e.g. a format drift in the upstream models.dev data where fields were renamed (e.g. 'api' or per-model context fields moved).

Common situations: Upstream models.dev schema change renaming the api or context-length fields; partial/degraded catalog data during an upstream migration; an old SiYuan build parsing a newer catalog format.

Related errors


AI-assisted analysis of siyuan-note/siyuan@8641553a1f (2026-09-11). Data as JSON: /api/errors/5f6afddabaca82f4. Report an issue: GitHub.