Rust smoke harness for running a GLiNER relex ONNX bundle and decoding both entities and relations.
This is the TinyHumans-side proof harness for:
- loading an exported
gliner-relexONNX model - building the joint
<<ENT>>+<<REL>>prompt - decoding entity spans
- decoding
rel_idx/rel_logits/rel_maskdirectly
It does not rely on the stock gline-rs relation pipeline, because the exported relex model uses a different output shape than the token-mode relation helper.
The CLI now resolves the bundle in this order:
--model-dirorGLINER_RELEX_MODEL_DIR- shared managed cache at
~/.openhuman/models/gliner-relex-large-v0.5-onnx - local dev export at
_tmp/gliner-export/artifacts/gliner-relex-large-v0.5-onnx - automatic download from the TinyHumans GLiNER release into the shared managed cache
That means most developers can just pull the repo and run the command. Manual model setup is only needed if you want to override the bundle location.
The managed bundle contains:
model_quantized.onnxormodel.onnxtokenizer.jsontokenizer_config.jsongliner_config.json- platform runtime library when available (
onnxruntime.dllon Windows,libonnxruntime.dylibon macOS)
cargo run --release -- `
--text "Bill Gates co-founded Microsoft in 1975." `
--entity-label person `
--entity-label company `
--relation-label co-founded `
--relation-label foundedJSON output:
cargo run --release -- `
--text "Bill Gates co-founded Microsoft in 1975." `
--entity-label person `
--entity-label company `
--relation-label co-founded `
--relation-label founded `
--jsonOverride knobs:
GLINER_RELEX_MODEL_DIRGLINER_RELEX_CACHE_DIRGLINER_RELEX_BASE_URLORT_DYLIB_PATHORT_LIB_LOCATION
On Windows, the binary will also try to discover onnxruntime.dll from the local UV cache if ORT_DYLIB_PATH is not already set.
- This repo is meant to stay small and reproducible.
- The ONNX model bundle is intentionally not committed to this repo.
- The upstream GLiNER exporter needed a small GCN normalization patch for the relex model to export cleanly to ONNX.