Billionmail/BillionMail · error
models file does not exist for supplier:
Error message
models file does not exist for supplier:
What it means
SetModelTitle requires the supplier's models.json to exist, since it edits entries in that file. If SUPPLIER_CONFIG_PATH/<supplierName>/models.json is missing, it aborts with this error naming the supplier.
Source
Thrown at core/internal/service/askai/supplier.go:647
if public.FileExists(templatePath) {
return errors.New("Cannot delete the system's built-in model supplier.")
}
err := os.RemoveAll(supplierPath)
if err != nil {
return err
}
return nil
}
// SetModelTitle updates the title of a model in the supplier's models.json file.
// It reads the existing models, modifies the title of the specified model, and saves the updated list back to the file.
// If the model is not found, it returns an error indicating that the model does not exist.
func SetModelTitle(supplierName string, modelId string, title string) error {
modelsFile := SUPPLIER_CONFIG_PATH + "/" + supplierName + "/models.json"
if !public.FileExists(modelsFile) {
return errors.New("models file does not exist for supplier: " + supplierName)
}
// Read existing models
existingModels := GetModelList(supplierName)
// Update the model title
for i, model := range existingModels {
if model.ModelId == modelId {
existingModels[i].Title = title
return saveModelsToFile(modelsFile, existingModels)
}
}
return errors.New("model not found")
}
// SetModelCapability updates the capability of a specific model in the supplier's models.json file.
// It reads the existing models, modifies the capability of the specified model, and saves the updated list back to the file.View on GitHub (pinned to fc36c76c05)
Solutions
- Call GetModelList / the supplier's model-fetch routine to create models.json before editing titles
- Verify the supplierName is correct and its config directory contains models.json
- If the models file was deleted, re-fetch models from the supplier API to regenerate it
Example fix
// before
err := SetModelTitle("mycust", "gpt-4o", "My GPT") // no models.json yet
// after
if !public.FileExists(SUPPLIER_CONFIG_PATH + "/mycust/models.json") {
RefreshModelList("mycust") // create models.json first
}
err := SetModelTitle("mycust", "gpt-4o", "My GPT") Defensive patterns
Strategy: validation
Validate before calling
modelsFile := SUPPLIER_CONFIG_PATH + "/" + supplierName + "/models.json"
if !public.FileExists(modelsFile) {
return errors.New("run model list sync for " + supplierName + " first")
}
return SetModelTitle(supplierName, modelId, title) Try / catch
if err := SetModelTitle(supplier, id, title); err != nil {
if strings.Contains(err.Error(), "models file does not exist") {
// trigger model-list refresh then retry once
} else { return err }
} Prevention
- Always initialize a supplier's models.json right after AddSupplier
- Gate model-edit operations behind a models-file existence check
- Monitor for suppliers with missing models.json
When it happens
Trigger: Calling SetModelTitle for a supplier whose config directory exists but has no models.json — e.g. a freshly created supplier whose model list was never fetched/saved.
Common situations: Calling model-update APIs before the model list has been initialized; supplier name typo pointing at a non-existent/empty config dir; models.json deleted manually or lost during a failed sync.
Related errors
- configuration file does not exist: %s
- supplier configuration is incomplete, cannot set status
- model not found
- supplier already exists
- supplier does not exist
AI-assisted analysis of Billionmail/BillionMail@fc36c76c05 (2026-09-05).
Data as JSON: /api/errors/85bcabe0f285ff5d.
Report an issue: GitHub.