OpenViSTAI · Agents · Blockchain · Crypto
Menu
AI Developer Tools & SDKs

Spacy LLM

Spacy LLM is a Python library that integrates large language models into spaCy pipelines through configurable components for prompting, parsing and structured NLP tasks.

Independent OpenViST project profile, based on linked sources.

Spacy LLM — OpenViST project profile in AI Developer Tools & SDKs.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use it when an NLP workflow needs an LLM-backed task inside spaCy, especially for prompt-based prototyping or a task that benefits from flexible language understanding. The project suggests considering supervised models for well-defined production tasks where efficiency, reliability, control and accuracy are priorities.

Who it is for

  • Python developers building NLP workflows with spaCy.
  • Teams prototyping language-processing tasks with LLM prompts.
  • Developers combining LLM-based steps with rule-based or supervised components.

Documented uses

  • Add an LLM-backed component to an existing or new spaCy pipeline.
  • Prototype named-entity recognition, classification or other supported NLP tasks.
  • Define task prompts and parsing separately from the selected model.
  • Combine prompted processing with other spaCy pipeline components.
Before you choose

Requirements & limits

The project is distributed as an MIT-licensed Python package. Its README documents installation with pip in an environment where spaCy is installed; the OpenAI quickstart uses an API key stored in environment variables.

  • The library provides built-in tasks including entity recognition, text classification, lemmatization, relationship extraction, sentiment analysis, span categorization, summarization, entity linking, translation and raw p
  • Model integrations listed include OpenAI, Cohere, Anthropic, Google PaLM, Microsoft Azure AI and Hugging Face-hosted open models; the README also describes LangChain integration.
  • Task prompting and parsing are modular, and custom functions can be registered through spaCy's registry.
  • A map-reduce approach is described for splitting prompts that exceed an LLM context window and combining results.
  • The project warns that the interface is experimental and may have breaking changes in minor releases.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Install Spacy LLM in a spaCy environment

Add the library to the Python virtual environment where spaCy is already installed.

Before you start

  • Python environment with spaCy installed
  • pip

Steps

  1. Activate the virtual environment that contains spaCy.

  2. Run the command below.

    Documented command
    python -m pip install spacy-llm

Expected outcome

The package is installed in the environment alongside spaCy.

Guide limitations

  • The project describes the interface as experimental and warns that minor releases may include breaking changes.
Source-based practical guide

Configure a text-classification pipeline with an OpenAI model

Define and assemble a spaCy pipeline for LLM-backed text classification.

Before you start

  • spaCy and spacy-llm installed in the same Python environment
  • An OpenAI API key set as an environment variable
  • A spaCy config file defining the language, llm component, text-classification task and model

Steps

  1. Create a config file with an llm pipeline component and a spacy.TextCat.v3 task.

  2. Set the classification labels and specify the spacy.GPT-4.v2 model in the config.

  3. Use spacy_llm.util.assemble to load the config and create the pipeline.

  4. Pass text to the pipeline and read the classification values from doc.cats.

Expected outcome

A configured pipeline returns text-classification scores for the labels in the config.

Guide limitations

  • The example depends on an OpenAI API key.
  • The package interface is experimental and may change in minor version updates.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
13 October 2026
Original website title
explosion/spacy-llm · Official homepage title · retained in its source language