OpenVINO Tokenizers provides utilities to convert pre-trained tokenizers, primarily from the Hugging Face `transformers` library, into OpenVINO models. These converted tokenizers can then be compiled and run efficiently on various hardware using the OpenVINO runtime, preparing text inputs for OpenVINO-optimized Large Language Models (LLMs). The current version is 2026.1.0.0, and releases typically align with major OpenVINO toolkit releases, often on a quarterly or yearly cadence.
pip install openvino-tokenizersVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to load a standard Hugging Face tokenizer and convert it into an OpenVINO model. The resulting `ov.Model` object can then be compiled and run by the OpenVINO runtime. Note that `transformers` is a common prerequisite for obtaining the initial tokenizer object.
Ensure the tokenizer object passed to `convert_tokenizer` is a standard Hugging Face tokenizer instance (e.g., from `AutoTokenizer.from_pretrained`). If using a custom tokenizer, verify it implements all necessary attributes and methods expected by OpenVINO Tokenizers.
Always install `openvino-tokenizers` and `openvino` packages with matching major version numbers (e.g., both 2024.2.x or both 2026.1.x) to ensure full compatibility.
Consult the release notes for both `openvino-tokenizers` and the main `openvino` toolkit when upgrading across major versions. Re-convert tokenizers with the new `openvino-tokenizers` version if you upgrade your `openvino` runtime.
Install the Hugging Face `transformers` library: `pip install transformers`.
Ensure you are using a standard Hugging Face tokenizer (e.g., from `AutoTokenizer.from_pretrained`). If using a custom tokenizer, verify it adheres to the interface expected by `openvino-tokenizers`, possibly by inspecting the source code for expected tokenizer properties.
Verify that the input to `convert_tokenizer` is a tokenizer object, and inputs to the compiled OpenVINO tokenizer model are in the expected format, typically a `str` or `List[str]`.
No resource links recorded.