blingfire
Python wrapper of lightning fast Finite State Machine based NLP library.
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 blingfireuv
uv add blingfirepoetry
poetry add blingfireInstalling 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
Tags
More Linguistic packages
Detects and normalizes text encoding from…
permissive · top 100 on PyPI
tiktokentiktoken is a fast BPE tokenizer that converts…
permissive · top 1,000 on PyPI
chardetDetects character encoding and language in byte…
permissive · top 1,000 on PyPI
text-unidecodeConverts Unicode text to ASCII by…
copyleft · top 1,000 on PyPI
larkLark is a parsing library that builds abstract…
permissive · top 1,000 on PyPI
tree-sitterPython bindings to the tree-sitter parsing…
permissive · top 1,000 on PyPI
curated-tokenizersProvides BPE, Byte BPE, Unigram, and Wordpiece…
permissive · top 5,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
tokieA fast, Rust-backed tokenizer library that…
permissive · top 15,000 on PyPI
torchtexttorchtext provides text datasets, preprocessing…
permissive · top 15,000 on PyPI
livekit-blingfireProvides BlingFire tokenization bindings for…
permissive · top 5,000 on PyPI
fastokensfastokens is a high-performance BPE tokenizer…
unclear · top 15,000 on PyPI
tokenizerTokenizes Icelandic text into words,…
permissive · top 15,000 on PyPI
snowballstemmerProvides stemming algorithms for 34 languages,…
permissive · top 1,000 on PyPI
tensorflow-textTensorFlow Text provides text preprocessing…
permissive · top 5,000 on PyPI
jieba3kPerforms Chinese word segmentation, breaking…
unclear · top 15,000 on PyPI