{"record":{"id":"08202eaf1d5586a1","repo":"lfnovo/open-notebook","slug":"no-embedding-model-configured-please-configure-on","errorCode":null,"errorMessage":"No embedding model configured. Please configure one in the Models section.","messagePattern":"No embedding model configured\\. Please configure one in the Models section\\.","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"api/routers/embedding.py","lineNumber":22,"sourceCode":"from api.command_service import CommandService\nfrom api.models import EmbedRequest, EmbedResponse\nfrom open_notebook.ai.models import model_manager\nfrom open_notebook.domain.notebook import Note, Source\nfrom open_notebook.exceptions import (\n    NotFoundError,\n    OpenNotebookError,\n)\n\nrouter = APIRouter()\n\n\n@router.post(\"/embed\", response_model=EmbedResponse)\nasync def embed_content(embed_request: EmbedRequest):\n    \"\"\"Embed content for vector search.\"\"\"\n    try:\n        # Check if embedding model is available\n        if not await model_manager.get_embedding_model():\n            raise HTTPException(\n                status_code=400,\n                detail=\"No embedding model configured. Please configure one in the Models section.\",\n            )\n\n        item_id = embed_request.item_id\n        item_type = embed_request.item_type.lower()\n\n        # Validate item type\n        if item_type not in [\"source\", \"note\"]:\n            raise HTTPException(\n                status_code=400, detail=\"Item type must be either 'source' or 'note'\"\n            )\n\n        # Branch based on processing mode\n        if embed_request.async_processing:\n            # ASYNC PATH: Submit command for background processing\n            logger.info(f\"Using async processing for {item_type} {item_id}\")\n","sourceCodeStart":4,"sourceCodeEnd":40,"githubUrl":"https://github.com/lfnovo/open-notebook/blob/a7de90d38aaf18ee85fd661854d35c11e44613e2/api/routers/embedding.py#L4-L40","documentation":"400 from POST /api/embed when no default embedding model is configured in the Models section. Embedding requires a default embedding model; model_manager.get_embedding_model() returning falsy means none is set, so the request is rejected before any work.","triggerScenarios":"Calling POST /api/embed (e.g. saving a note or triggering vector search) on a fresh install where no embedding model was ever selected, or after the configured embedding model was deleted.","commonSituations":"Fresh Open Notebook setup where the user skipped the Models configuration step, or removed/changed the default embedding model and stale clients still submit embed requests.","solutions":["Open the Models section in the UI (or GET /api/models) and set a default embedding model","If no embedding-capable model exists, add one (built-in or via a configured credential) first","Ensure the embedding model's backing credential is valid (has a working API key)","Retry the embed request after the default is set"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const models = await api.listModels();\nconst hasEmbeddingDefault = models.some(m => m.isDefault && m.type === 'embedding');\nif (!hasEmbeddingDefault) throw new Error('Configure a default embedding model first');","typeGuard":null,"tryCatchPattern":"try {\n  await api.embed({ item_id: id, item_type: 'source', async_processing: true });\n} catch (e) {\n  if (e.status === 400 && /embedding model/i.test(e.detail)) promptModelSetup();\n  throw e;\n}","preventionTips":["Configure a default embedding model as part of first-run setup","Re-check model defaults after deleting or changing embedding models"],"tags":["embedding","model-config","http-400","validation"],"backgroundTag":"missing-embedding-model","analyzedSha":"a7de90d38aaf18ee85fd661854d35c11e44613e2","analyzedAt":"2026-08-27T02:39:58.166Z","schemaVersion":2},"datasetVersion":"2026-08-27T03:17:27.898Z"}