run-llama/llama_index · error · ValueError

{spacy_model} model is not matching your language: {language

Error message

{spacy_model} model is not matching your language: {language}

What it means

Error "{spacy_model} model is not matching your language: {language}" thrown in run-llama/llama_index.

Source

Thrown at llama-index-core/llama_index/core/node_parser/text/semantic_double_merging_splitter.py:41

    "german": ["de_core_news_md", "de_core_news_lg"],
    "spanish": ["es_core_news_md", "es_core_news_lg"],
}


class LanguageConfig:
    def __init__(
        self,
        language: str = "english",
        spacy_model: str = "en_core_web_md",
        model_validation: bool = True,
    ):
        if language not in LANGUAGES:
            raise ValueError(
                f"{language} language is not supported yet! Available languages: {LANGUAGES}"
            )

        if spacy_model not in LANGUAGE_MODELS[language] and model_validation:
            raise ValueError(
                f"{spacy_model} model is not matching your language: {language}"
            )

        self.language = language
        self.spacy_model = spacy_model
        self.nlp = None
        self.stopwords: List[str] = []

    def load_model(self) -> None:
        try:
            import spacy
        except ImportError:
            raise ImportError(
                "Spacy is not installed, please install it with `pip install spacy`."
            )
        self.nlp = spacy.load(self.spacy_model)  # type: ignore
        self.stopwords = set(globals_helper.stopwords)  # type: ignore

View on GitHub (pinned to afd0fef371)

Solutions

  1. Use a spacy model whose language matches the configured language, e.g. en_core_web_md for English.
  2. Change the language parameter to match the installed spacy model.

When it happens

Trigger: Thrown at llama-index-core/llama_index/core/node_parser/text/semantic_double_merging_splitter.py:41 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of run-llama/llama_index@afd0fef371 (2026-08-15). Data as JSON: /api/errors/7816d9144ee33aba. Report an issue: GitHub.