lfnovo/open-notebook · warning · HTTPException

Ask feature requires an embedding model. Please configure on

Error message

Ask feature requires an embedding model. Please configure one in the Models section.

What it means

400 from /api/search/ask: the ask pipeline requires embeddings for retrieval, and no default embedding model is configured. Even though chat models are set, the embedding model is a separate configuration.

Source

Thrown at api/routers/search.py:150

        if not strategy_model:
            raise HTTPException(
                status_code=400,
                detail=f"Strategy model {ask_request.strategy_model} not found",
            )
        if not answer_model:
            raise HTTPException(
                status_code=400,
                detail=f"Answer model {ask_request.answer_model} not found",
            )
        if not final_answer_model:
            raise HTTPException(
                status_code=400,
                detail=f"Final answer model {ask_request.final_answer_model} not found",
            )

        # Check if embedding model is available
        if not await model_manager.get_embedding_model():
            raise HTTPException(
                status_code=400,
                detail="Ask feature requires an embedding model. Please configure one in the Models section.",
            )

        # For streaming response
        return StreamingResponse(
            stream_ask_response(
                ask_request.question, strategy_model, answer_model, final_answer_model
            ),
            media_type="text/event-stream",
            headers={
                "Cache-Control": "no-cache",
                "Connection": "keep-alive",
                "X-Accel-Buffering": "no",
            },
        )

    except HTTPException:

View on GitHub (pinned to a7de90d38a)

Solutions

  1. Configure a default embedding model in Settings → Models
  2. Verify provider credentials are saved and the model shows as available
  3. Retry the ask request after configuration
Defensive patterns

Strategy: validation

Validate before calling

const hasEmbedding = models.some(m => m.type === 'embedding' && m.is_default);
if (!hasEmbedding) promptModelSetup();

Prevention

When it happens

Trigger: POST /api/search/ask (or /ask/simple) when model_manager.get_embedding_model() returns None.

Common situations: Fresh setup where only chat models were added, embedding model removed, or provider key invalid so the model never loaded.

Related errors


AI-assisted analysis of lfnovo/open-notebook@a7de90d38a (2026-08-27). Data as JSON: /api/errors/aef05f986344a84e. Report an issue: GitHub.