stanford-oval/storm · error · ValueError
Please provide an embedding model.
Error message
Please provide an embedding model.
What it means
VectorRM's __init__ requires an embedding model because it builds a langchain HuggingFaceEmbeddings instance (self.model) used to embed queries against the Qdrant vector store. Without an embedding model, vectors cannot be compared to stored embeddings. The check raises ValueError immediately at construction time.
Source
Thrown at knowledge_storm/rm.py:214
k: int = 3,
):
from langchain_huggingface import HuggingFaceEmbeddings
"""
Params:
collection_name: Name of the Qdrant collection.
embedding_model: Name of the Hugging Face embedding model.
device: Device to run the embeddings model on, can be "mps", "cuda", "cpu".
k: Number of top chunks to retrieve.
"""
super().__init__(k=k)
self.usage = 0
# check if the collection is provided
if not collection_name:
raise ValueError("Please provide a collection name.")
# check if the embedding model is provided
if not embedding_model:
raise ValueError("Please provide an embedding model.")
model_kwargs = {"device": device}
encode_kwargs = {"normalize_embeddings": True}
self.model = HuggingFaceEmbeddings(
model_name=embedding_model,
model_kwargs=model_kwargs,
encode_kwargs=encode_kwargs,
)
self.collection_name = collection_name
self.client = None
self.qdrant = None
def _check_collection(self):
from langchain_qdrant import Qdrant
"""
Check if the Qdrant collection exists and create it if it does not.View on GitHub (pinned to fb951af774)
Solutions
- Pass embedding_model explicitly, e.g. embedding_model='sentence-transformers/all-MiniLM-L6-v2'
- Ensure the same embedding model was used to build the stored collection, otherwise retrieval quality degrades
- Pre-download the model (huggingface) if running in an offline/sandboxed environment
Example fix
// before rm = VectorRM(collection_name='my_docs', source='offline', vector_store_path='./qdrant') // after rm = VectorRM(collection_name='my_docs', source='offline', vector_store_path='./qdrant', embedding_model='sentence-transformers/all-MiniLM-L6-v2')
Defensive patterns
Strategy: validation
Validate before calling
from knowledge_storm.rm import VectorRM
EMBED_MODEL = 'sentence-transformers/all-MiniLM-L6-v2'
if not EMBED_MODEL:
raise SystemExit('embedding_model is required')
rm = VectorRM(collection_name='docs', source='offline', vector_store_path='./qdrant', embedding_model=EMBED_MODEL) Type guard
def valid_vectorrm_config(collection_name: str, embedding_model: str | None) -> bool:
return bool(collection_name) and bool(embedding_model) Try / catch
try:
rm = VectorRM(collection_name='docs', source='offline', vector_store_path='./qdrant', embedding_model=MODEL)
except ValueError as e:
if 'embedding model' in str(e):
raise SystemExit(f'Config error: {e}')
raise Prevention
- Centralize the embedding model name in one config constant used for both ingestion and retrieval
- Pin the same model that built the collection to avoid dimension mismatches
When it happens
Trigger: Constructing VectorRM(...) without passing embedding_model (e.g. VectorRM(collection_name='docs', source='offline', vector_store_path='./qdrant')). The parameter defaults to None, so any call omitting it fails.
Common situations: Copying a minimal example that only sets collection_name and vector_store_path; upgrading knowledge-storm where older examples omitted embedding_model; assuming the model is stored in the vector store and not needed at query time.
Understand the failure class
Background: Missing required parameter errors: what 'X is required' and 'the required X param is missing' mean, and how to fix them — this error's family across 27 libraries.
Related errors
- Qdrant client is not initialized.
- Collection {self.collection_name} does not exist. Please cre
- Please provide a url for the Qdrant server.
- Please provide an api key.
- Error occurs when connecting to the server: {e}
AI-assisted analysis of stanford-oval/storm@fb951af774 (2026-08-28).
Data as JSON: /api/errors/b76082b85c159380.
Report an issue: GitHub.