Instructions to use codesoda/gliner2-onnx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- GLiNER2
How to use codesoda/gliner2-onnx with GLiNER2:
from gliner2 import GLiNER2 model = GLiNER2.from_pretrained("codesoda/gliner2-onnx") # Extract entities text = "Apple CEO Tim Cook announced iPhone 15 in Cupertino yesterday." result = extractor.extract_entities(text, ["company", "person", "product", "location"]) print(result) - Notebooks
- Google Colab
- Kaggle
GLiNER2 and GLiNER2.5 ONNX bundles
Explicit, opt-in model downloads for codesoda/gliner2-rs. Rust build and inference do not require Python. These are fp32, ONNX opset 17 conversions, not Fastino's original safetensors checkpoints.
Bundles
| Directory | Architecture | Original checkpoint revision |
|---|---|---|
gliner2-base-v1 |
legacy span | fastino/gliner2-base-v1@79c3a777abc572b4767922f3916cf63fb5754df2 |
gliner2-large-v1 |
legacy span | fastino/gliner2-large-v1@f32ea6ef6e26d8264fdc72431b4b3b041eadc537 |
gliner2.5-small-v1 |
boundary, encoder width 384 | fastino/gliner2.5-small-v1@f1e4d8fdd6fe328f45dee6aca3e6a07c9db4296e |
gliner2.5-base-v1 |
boundary, encoder width 768 | fastino/gliner2.5-base-v1@78cea040597df251eedefa9d7ee2a756af39fe64 |
gliner2.5-multi-v1 |
multilingual boundary, encoder width 768 | fastino/gliner2.5-multi-v1@235cf92d6d4318da9bfca0d08975c8fa7250d13b |
Each 2.5 directory includes seven graphs: encoder, classifier, boundary
marginals, shared scorer, explicit scorer, records and relations. Config and
tokenizer metadata, the original model card, Apache2 license and conversion
notice are colocated. export_manifest.json records required files, sizes,
SHA-256 hashes, actual graph signatures, source identities and validation.
validation_report.json contains measured checkpoint-specific source/ONNX/native
evidence; export_manifest.unvalidated.json preserves the pre-review inventory.
The existing v2 graph files remain unchanged. The project downloaders also fetch v2 tokenizer/config metadata from the immutable original Fastino revisions above and colocate it with the downloaded graphs.
Validation and runtime
Original GLiNER2 source: d7c727458bf6929bc9ef5ee04e13c3f717a7c455.
The Rust runtime uses direct ort 2.0.0-rc.13 / native ONNX Runtime 1.28.
Development Python validation uses separately pinned ONNX Runtime 1.20.1 and
PyTorch 2.8.0; it is not a Rust runtime dependency.
Each 2.5 checkpoint passed seven source/ONNX stage gates and 32 native cases (30 closed-corpus, one mixed Unicode and one explicit duplicate-span case). Discrete results and original UTF-8 byte coordinates match exactly. Numerical bounds, maximum errors, source hashes and runtime details are in each report. These are bounded CPU/reference results, not a universal bit-identity guarantee across architectures or execution providers. The exported centered sum preserves the pinned AArch64 PyTorch fp32 order; no precision/tolerance relaxation was used.
Unsupported zero-axis native diagnostics are not a supported graph contract; Rust guards reject or bypass those calls. Empty user text is handled by the public preprocessing path. Optional attributes, JointIE and chunk/merge helper APIs are not implied by these bundles.
Download
From a current checkout of codesoda/gliner2-rs, choose this repository's full,
immutable 40-character snapshot commit, not main:
cargo run --release --example download_models -- \
--model 2.5-base --dest ./onnx --revision <snapshot-commit>
# Or, explicitly using the optional development downloader:
python3 scripts/download_models.py \
--model 2.5-base --dest ./onnx --revision <snapshot-commit>
Selectors are base, large, 2.5-small, 2.5-base, 2.5-multi and all.
all downloads all five bundles and several gigabytes. The downloaders reject
partial/unvalidated boundary manifests, unsafe paths and size/hash mismatches.
Do not infer that an older crate tag contains the 2.5 APIs: use the documented
GitHub release or a verified source commit.