Token Classification
GLiNER2
Core AI
multilingual
English
named-entity-recognition
relation-extraction
text-classification
information-extraction
apple
ios
on-device
fp16
Run this model with HF Jobs
Run smdesai/GLiNER25-Multi-FP16-CoreAI on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/smdesai/GLiNER25-Multi-FP16-CoreAI. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/smdesai/GLiNER25-Multi-FP16-CoreAI on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use smdesai/GLiNER25-Multi-FP16-CoreAI with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- GLiNER2
How to use smdesai/GLiNER25-Multi-FP16-CoreAI with GLiNER2:
from gliner2 import AutoExtractor extractor = AutoExtractor.from_pretrained("smdesai/GLiNER25-Multi-FP16-CoreAI") # 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
Add a 1024-token bucket (a_t1024..d_t1024)
Browse filesSame weights; texts up to 1024 tokens run in one pass. Validated on Mac and iPhone 17 Pro.
Files changed (5)
1��<�ؓ��qT�j�g�G�<$2�u}aN�9�1�)�x�m���Ґx����poq�������6�/
123version https://git-lfs.github.com/spec/v1oid sha256:eaed8f3c9cd893edf2715413d26ab567a747b43c241a32f4757d614e821339ecsize 576333147123version https://git-lfs.github.com/spec/v1oid sha256:e129f978d56d830cac87d29078bcbab791706f71bc03b3afd6d7ccc13602882fsize 577210165
12345678{"author" : "fastino (weights); Core AI port","producer" : "coreai-core 1.0.0b3","license" : "apache-2.0","description" : "GLiNER2.5-Multi v1 (fastino\/gliner2.5-multi-v1@12fc40399dae672ce840c5e3c50a92340bff3c8c) Core AI port: a=encoder+marginals, b=pool scorer+records, c=relations, d=explicit spans; buckets 128,256,512","creationDate" : "20260927T010956Z","assetVersion" : "2.0"}12345678{"author" : "fastino (weights); Core AI port","producer" : "coreai-core 1.0.0b3","creationDate" : "20260928T045752Z","assetVersion" : "2.0","description" : "GLiNER2.5-Multi v1 (fastino\/gliner2.5-multi-v1@12fc40399dae672ce840c5e3c50a92340bff3c8c) Core AI port: a=encoder+marginals, b=pool scorer+records, c=relations, d=explicit spans; buckets 128,256,512,1024","license" : "apache-2.0"}
37 unmodified lines3839404142434420 unmodified lines6566676869707147 unmodified lines11912012112212312412510 unmodified lines13613713813914014114214314414514614714814915015115215315415537 unmodified lines| File | Purpose ||---|---|| `GLiNER25-Multi-FP16.aimodel/` | Core AI source asset, FP16 (550 MB). Twelve functions share one set of weights || `tokenizer.json`, `tokenizer_config.json` | Checkpoint tokenizer: SentencePiece Unigram, 250k vocabulary, GLiNER2 special tokens || `constants.json` | Weights and settings used by the decoder: `RecordHead.null_embed` and the checkpoint's `boundary_head` settings || `functions.json` | Input and output names, shapes and dtypes of every function |20 unmodified linesGLiNER2.5's boundary architecture has data-dependent steps between its neural parts, so the modelis exported as four stages. The host runs the logic between them. For each sequence bucketT ∈ {128, 256, 512} tokens, the functions are `a_t<T>`, `b_t<T>`, `c_t<T>` and `d_t<T>`:| Function | Computes | Main inputs → outputs ||---|---|---|47 unmodified linesmulti-label classification, relations, legacy structures, natural/latent/anchorless records,exclusive fields, choice fields, entity attributes, joint tasks.- Ten languages.- All three buckets.**Boundary items:** the iPhone GPU's FP16 kernels differ slightly from the Mac's, by up to about0.03 on boundary logits. Items that sit at a decision boundary can therefore flip on device. "FP3210 unmodified lines| ≤128 tokens | 13.4 ms || ≤256 tokens | 19.6 ms || ≤512 tokens | 39.3 ms || 18-chunk long document | 684 ms |**Memory:** process footprint is about 200 MB after load and about 310 MB after the first run of all12 functions. The weights are memory-mapped.**Load time:** about 4 s the first time (on-device specialization), about 1 s from the system cache.## Limitations- A single call handles up to 512 tokens. Longer texts need chunking. Upstream `extract_long`splits into overlapping word windows; with this model, windows of 256 words and 48 words ofoverlap, shrunk to fit 512 tokens, work well.- Constrained classification (`Classifier`) and `JointIE` from the upstream card are separatedecoders and are not covered by this port.- Weight compression was evaluated and not adopted:- int8 word embeddings (384 MB) kept every decision, but lowered on-device PSNR to 53 dB and raisedpeak memory, because the GPU keeps a dequantized copy.37 unmodified lines3839404142434420 unmodified lines656667686970717247 unmodified lines12012112212312412512612712810 unmodified lines13914014114214314414514614714814915015115215315415515615715815937 unmodified lines| File | Purpose ||---|---|| `GLiNER25-Multi-FP16.aimodel/` | Core AI source asset, FP16 (550 MB). Sixteen functions share one set of weights || `tokenizer.json`, `tokenizer_config.json` | Checkpoint tokenizer: SentencePiece Unigram, 250k vocabulary, GLiNER2 special tokens || `constants.json` | Weights and settings used by the decoder: `RecordHead.null_embed` and the checkpoint's `boundary_head` settings || `functions.json` | Input and output names, shapes and dtypes of every function |20 unmodified linesGLiNER2.5's boundary architecture has data-dependent steps between its neural parts, so the modelis exported as four stages. The host runs the logic between them. For each sequence bucketT ∈ {128, 256, 512, 1024} tokens, the functions are `a_t<T>`, `b_t<T>`, `c_t<T>` and `d_t<T>`. Theencoder uses only relative positions, so the 1024 bucket runs the same weights:| Function | Computes | Main inputs → outputs ||---|---|---|47 unmodified linesmulti-label classification, relations, legacy structures, natural/latent/anchorless records,exclusive fields, choice fields, entity attributes, joint tasks.- Ten languages.- The 128, 256 and 512 buckets. The 1024 bucket was checked separately: stage A against eager FP32at 991 tokens (60.9 dB and above on the Mac), and a 991-token clinical note end to end on theiPhone (the same 16 items as upstream, max confidence error 0.0033).**Boundary items:** the iPhone GPU's FP16 kernels differ slightly from the Mac's, by up to about0.03 on boundary logits. Items that sit at a decision boundary can therefore flip on device. "FP3210 unmodified lines| ≤128 tokens | 13.4 ms || ≤256 tokens | 19.6 ms || ≤512 tokens | 39.3 ms || ≤1024 tokens (991-token note) | 117 ms || 18-chunk long document | 684 ms |**Memory:** process footprint is about 360 MB after load and about 460 MB after the first run of all16 functions (about 200 and 310 MB without the 1024 bucket). The weights are memory-mapped.**Load time:** about 4 s the first time (on-device specialization), about 1 s from the system cache.## Limitations- A single call handles up to 1024 tokens. Longer texts need chunking. Upstream `extract_long`splits into overlapping word windows; with this model, windows of 256 words and 48 words ofoverlap, shrunk to fit 512 tokens, work well and keep every chunk in the faster 512 bucket.- Constrained classification (`Classifier`) and `JointIE` from the upstream card are separatedecoders on top of the same stages; the Swift runtime ports both.- Weight compression was evaluated and not adopted:- int8 word embeddings (384 MB) kept every decision, but lowered on-device PSNR to 53 dB and raisedpeak memory, because the GPU keeps a dequantized copy.
894 unmodified lines895896897898899894 unmodified lines"outputs": ["explicit_logits"]}}894 unmodified lines8958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198894 unmodified lines"outputs": ["explicit_logits"]},"a_t1024": {"inputs": {"input_ids": [[1,1024],"int32"],"attention_mask": [[1,1024],"int32"],"word_idx": [[1,1024],"int32"],"word_mask": [[1,1024],"int32"],"query_idx": [[1,32],"int32"],"query_mask": [[1,32],"int32"],"cls_idx": [[1,32],"int32"]},"outputs": ["text_states","query_states","cls_logits","boundary_states","start_logits","end_logits","inside_logits","pool_start","pool_end","null_logits","count_logits","record_field"]},"b_t1024": {"inputs": {"boundary_states": [[1,1025,128],"float16"],"query_states": [[1,32,768],"float16"],"text_states": [[1,1024,768],"float16"],"word_mask": [[1,1024],"int32"],"query_mask": [[1,32],"int32"],"start_logits": [[1,32,1025],"float16"],"end_logits": [[1,32,1025],"float16"],"inside_logits": [[1,32,1024],"float16"],"pool_idx": [[1,192,2],"int32"],"pool_mask": [[1,192],"int32"],"pool_prior": [[1,192],"float16"]},"outputs": ["pair_logits","record_cand","record_inst","latent_seed","anchorless_inst","anchorless_object"]},"c_t1024": {"inputs": {"text_states": [[1,1024,768],"float16"],"word_mask": [[1,1024],"int32"],"relation_query": [[1,8,1536],"float16"],"pairs": [[1,512,4],"int32"],"pair_relation": [[1,512],"int32"],"pair_mask": [[1,512],"int32"]},"outputs": ["relation_logits"]},"d_t1024": {"inputs": {"boundary_states": [[1,1025,128],"float16"],"query_states": [[1,32,768],"float16"],"text_states": [[1,1024,768],"float16"],"word_mask": [[1,1024],"int32"],"query_mask": [[1,32],"int32"],"start_logits": [[1,32,1025],"float16"],"end_logits": [[1,32,1025],"float16"],"inside_logits": [[1,32,1024],"float16"],"spans": [[1,64,2],"int32"],"span_mask": [[1,64],"int32"]},"outputs": ["explicit_logits"]}}
GLiNER25-Multi-FP16.aimodel/main.hash+1-1
GLiNER25-Multi-FP16.aimodel/main.mlirb+2-2
GLiNER25-Multi-FP16.aimodel/metadata.json+4-4
README.md+12-8
functions.json+299