skillfed

blingfire

Python wrapper of lightning fast Finite State Machine based NLP library.

blingfire v0.1.8 879.9K downloads/30d#4,823 on PyPI1,893
Permissive license DORMANT released

What it is and what it does

Blingfire is a Python wrapper around Microsoft's finite state machine–based NLP library, designed for high-performance text tokenization and linguistic operations. It provides a unified interface across multiple tokenization algorithms (pattern-based, WordPiece, SentencePiece variants, and BPE) and ships with prebuilt models for popular frameworks like BERT, XLNET, GPT-2, and XLM-RoBERTa, as well as multilingual models for 80+ languages.

The library is optimized for low-latency inference and requires no runtime dependencies beyond Python itself. Models are loaded on demand from binary files, and the package includes default models for sentence breaking and word tokenization that work without additional configuration. It's particularly useful when you need fast, production-grade tokenization that outperforms pure-Python alternatives.

Use it for:

  • Tokenizing text for BERT, XLNET, or GPT-2 models in inference pipelines where latency matters
  • Sentence segmentation and word tokenization in high-throughput NLP applications
  • Multilingual text processing using prebuilt models trained on 80+ languages
  • Custom tokenization workflows by loading your own finite state machine models
  • Replacing slower tokenizers (SpaCy, Hugging Face) when speed is critical

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Blingfire provides fast tokenization and text processing using finite state machines, supporting multiple algorithms (pattern-based, WordPiece, SentencePiece Unigram LM, BPE) with prebuilt models for BERT, XLNET, GPT-2, and other NLP frameworks.

Yes, if you need fast tokenization for NLP inference. The package is stable, has no dependencies, and offers significant speed advantages over pure-Python alternatives. However, be aware it is dormant (last release September 2021) and may not receive updates for new Python versions or model formats. Suitable for production use where the existing models and algorithms meet your needs.

Install

blingfire on PyPI

pip

pip install blingfire

uv

uv add blingfire

poetry

poetry add blingfire

Installing blingfire

Before you install

Installation is straightforward with no runtime dependencies. The package is dormant (last release September 2021, no commits since December 2024), but the underlying C++ library is stable and widely used in production at Microsoft.

License in practice

Licensed under MIT (permissive), allowing free use, modification, and distribution with minimal restrictions.

Quickstart

pip install blingfire

from blingfire import text_to_words, text_to_sentences

text = 'Hello world. This is a test.'
print(text_to_sentences(text))
print(text_to_words(text))

Verify before relying

  • Whether the package works with Python versions beyond 3.x (exact version support unspecified in metadata)
  • Current maintenance status and whether dormancy affects compatibility with modern Python tooling

Package facts

License not declared (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance dormant — 1,785 days since the last release
Last repo commit
First released
Downloads 879,860/month — #4,823 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: blingfire-0.1.8-py3-none-any.whl

License :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3

Tags

fast tokenization nlpbert wordpiece tokenizersentence segmentationtext tokenization libraryfinite state machine nlpmultilingual tokenizationsentencepiece alternative
tokenizationnlpperformance-critical

More Linguistic packages