lfnovo/open-notebook · error · ConfigurationError
No model configured for {selection_reason}. Please go to Set
Error message
No model configured for {selection_reason}. Please go to Settings → Models and configure a default model for '{default_type}'. What it means
provision_langchain_model() resolves a model by id or default_type and found none — no LanguageModel row matches. It means the requested default model slot (e.g. 'language' or a specific override) is unconfigured or points to a deleted model, so no LLM can be provisioned for the AI call.
Source
Thrown at open_notebook/ai/provision.py:45
)
model = await model_manager.get_default_model("large_context", **kwargs)
elif model_id:
selection_reason = f"explicit model_id={model_id}"
model = await model_manager.get_model(model_id, **kwargs)
else:
selection_reason = f"default for type={default_type}"
model = await model_manager.get_default_model(default_type, **kwargs)
logger.debug(f"Using model: {model}")
if model is None:
logger.error(
f"Model provisioning failed: No model found. "
f"Selection reason: {selection_reason}. "
f"model_id={model_id}, default_type={default_type}. "
f"Please check Settings → Models and ensure a default model is configured for '{default_type}'."
)
raise ConfigurationError(
f"No model configured for {selection_reason}. "
f"Please go to Settings → Models and configure a default model for '{default_type}'."
)
if not isinstance(model, LanguageModel):
logger.error(
f"Model type mismatch: Expected LanguageModel but got {type(model).__name__}. "
f"Selection reason: {selection_reason}. "
f"model_id={model_id}, default_type={default_type}."
)
raise ConfigurationError(
f"Model is not a LanguageModel: {model}. "
f"Please check that the model configured for '{default_type}' is a language model, not an embedding or speech model."
)
return model.to_langchain()
View on GitHub (pinned to a7de90d38a)
Solutions
- Go to Settings → Models and set a default language model for the '{default_type}' slot
- If a default is set but stale, re-select a valid model (the referenced id may have been deleted)
- Verify the model's provider has valid API credentials so it appears as available
Defensive patterns
Strategy: validation
Validate before calling
from open_notebook.ai.models import model_manager
m = await model_manager.get_default_model('language')
if m is None:
raise HTTPException(409, 'Configure a default language model in Settings → Models') Try / catch
try:
model = await provision_langchain_model(...)
except ConfigurationError as e:
return JSONResponse(status_code=409, content={'detail': str(e), 'hint': 'Settings → Models'}) Prevention
- On first-run onboarding, require models to be configured before enabling chat features
- Audit defaults after deleting any model row
- Surface a preflight 'models configured' check in the UI before long-running AI jobs
When it happens
Trigger: Calling any chat/answer endpoint (provide_answer, call_model, write_final_answer, content_process) when Settings → Models has no default language model set, or when the configured default model id was deleted from the database while still referenced.
Common situations: Fresh setup where the user imported content but never configured models; a model was deleted via the Models settings page leaving a dangling default_model id; multi-provider setups where the default points at a provider whose credentials were removed.
Related errors
- Model is not a LanguageModel: {model}. Please check that the
- Failed to load default models configuration
- Error fetching models: {str(e)}
- Invalid model type. Must be one of: {valid_types}
- Model '{model_data.name}' already exists for provider '{mode
AI-assisted analysis of lfnovo/open-notebook@a7de90d38a (2026-08-27).
Data as JSON: /api/errors/55a59dde1889f45a.
Report an issue: GitHub.