alt.freeweights.text / LightOnOCR-2-1B-ONNX
From: onnx-community <huggingface.co/onnx-community>Newsgroups: alt.freeweights.textSubject:

LightOnOCR-2-1B-ONNX

Date: 2026-11-15Commit: 2e2ecebSigned: 2DC28CC7B26A283B ✓

Image text to text model. Onnx weights, 9.78 GB in all. Published by onnx-community under Apache-2.0.

text9.78GBLightOnOCR-2-1B-ONNXonnxpermissive
FactsParamsnot statedSize9.78 GBFormatsonnxTaskimage text to textLicenseApache-2.0From sourcepermissive
$ fw get onnx-community/LightOnOCR-2-1B-ONNX
# manifest sha256 30a340dc837b… · 9.78 GB · 40 files
$ fw verify ./LightOnOCR-2-1B-ONNX onnx-community/LightOnOCR-2-1B-ONNX
From sourceHosted (signed)onnx-community/LightOnOCR-2-1B-ONNXLast check: 2026-11-15 05:20 UTC

Get help: custom fine-tune or private deploy. We review your setup before we quote.

Quantized of LightOnOCR-2-1B.

Works with

Runs with

Ranked by fit to this model (onnx), then by GitHub stars.

Convert with

Overview

Size
9.78 GB
Weights
89.9 MB (smallest of 15 ONNX variants)
Parameters
not stated
Formats
onnx
Task
image text to text
License
Apache-2.0 (permissive)
Files
40, each with a sha256
Publisher
onnx-community
Added
2026-11-15
Section
alt.freeweights.text
Lineage

Original release from the publisher.

Base model: lightonai/LightOnOCR-2-1B

Where these bytes come from
Publisher at the pinned commit→You

Sources are tried in order. A file counts only when its size and sha256 match the manifest. Sources are checked when you ask for them, not on a timer.

Sources
BadgeHostLast checkResult
From sourcehuggingface.co2026-11-15 05:20 UTCpassed

Model card

From the publisher at commit 2e2eceb. Shown as plain text with links; images open at the publisher.

Usage#

ONNXRuntime#
from transformers import AutoConfig, AutoProcessor, GenerationConfig
import onnxruntime as ort
import numpy as np
from huggingface_hub import snapshot_download

# 1. Load config, processor, and model
model_id = "onnx-community/LightOnOCR-2-1B-ONNX"
config = AutoConfig.from_pretrained(model_id)
processor = AutoProcessor.from_pretrained(model_id)
generation_config = GenerationConfig.from_pretrained(model_id)

vision_model = "onnx/vision_encoder_q4.onnx"
embed_model = "onnx/embed_tokens_q4.onnx"
decoder_model = "onnx/decoder_model_merged_q4.onnx"

folder_path = snapshot_download(
    repo_id=model_id,
    allow_patterns=[f"{vision_model}*", f"{embed_model}*", f"{decoder_model}*"],
)
vision_model_path = f"{folder_path}/{vision_model}"
embed_model_path = f"{folder_path}/{embed_model}"
decoder_model_path = f"{folder_path}/{decoder_model}"

## Load sessions
providers = ['CPUExecutionProvider']
vision_session = ort.InferenceSession(vision_model_path, providers=providers)
embed_session = ort.InferenceSession(embed_model_path, providers=providers)
decoder_session = ort.InferenceSession(decoder_model_path, providers=providers)

## Set config values
text_config = config.text_config
hidden_size = text_config.hidden_size

num_key_value_heads = text_config.num_key_value_heads
head_dim = text_config.head_dim
num_hidden_layers = text_config.num_hidden_layers
eos_token_id = generation_config.eos_token_id
image_token_id = config.image_token_id

# 2. Prepare inputs
url = "https://huggingface.co/datasets/hf-internal-testing/fixtures_ocr/resolve/main/SROIE-receipt.jpeg"
messages = [{"role": "user", "content": [{"type": "image", "url": url}]}]
inputs = processor.apply_chat_template(
    messages,
    add_generation_prompt=True,
    return_tensors="pt",
    return_dict=True,
    tokenize=True,
)

input_ids = inputs['input_ids'].numpy()
attention_mask = inputs['attention_mask'].numpy()
has_vision_inputs = 'pixel_values' in inputs
pixel_values = inputs['pixel_values'].numpy() if has_vision_inputs else None

batch_size = input_ids.shape[0]
past_cache_values = {}
for i in range(num_hidden_layers):
  for kv in ('key', 'value'):
    past_cache_values[f'past_key_values.{i}.{kv}'] = np.zeros([batch_size, num_key_value_heads, 0, head_dim], dtype=np.float32)

# 3. Generation loop
max_new_tokens = 1024
generated_tokens = np.array([[]], dtype=np.int64)
image_features = None
for i in range(max_new_tokens):
  inputs_embeds = embed_session.run(None, {'input_ids': input_ids})[0]

  if has_vision_inputs and image_features is None:
    ## Only compute vision features if not already computed
    image_features = vision_session.run(None, dict(
        pixel_values=pixel_values,
    ))[0]

    ## Merge text and vision embeddings
    inputs_embeds[input_ids == image_token_id] = image_features.reshape(-1, image_features.shape[-1])

  logits, *present_cache_values = decoder_session.run(None, dict(
      inputs_embeds=inputs_embeds,
      attention_mask=attention_mask,
      **past_cache_values,
  ))

  ## Update values for next generation loop
  input_ids = logits[:, -1].argmax(-1, keepdims=True)
  attention_mask = np.concatenate([attention_mask, np.ones((batch_size, 1), dtype=attention_mask.dtype)], axis=-1)
  for j, key in enumerate(past_cache_values):
    past_cache_values[key] = present_cache_values[j]

  generated_tokens = np.concatenate([generated_tokens, input_ids], axis=-1)
  if np.isin(input_ids, eos_token_id).any():
    break

  ## (Optional) Streaming
  print(processor.decode(input_ids[0], skip_special_tokens=False), end='', flush=True)
print()

# 4. Output result
print(processor.batch_decode(generated_tokens, skip_special_tokens=True)[0])

See example output

Document No : TD01167104  
Date : 25/12/2018 8:13:39 PM  
Cashier : MANIS  
Member :  

# CASH BILL

<table>
  <thead>
    <tr>
      <th>CODE/DESC</th>
      <th>PRICE</th>
      <th>Disc</th>
      <th>AMOUNT</th>
    </tr>
    <tr>
      <th>QTY</th>
      <th>RM</th>
      <th></th>
      <th>RM</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>9556939040118</td>
      <td>KF MODELLING CLAY KIDDY FISH</td>
      <td></td>
      <td></td>
    </tr>
    <tr>
      <td>1 PC *</td>
      <td>9.000</td>
      <td>0.00</td>
      <td>9.00</td>
    </tr>
    <tr>
      <td colspan="3">Total :</td>
      <td>9.00</td>
    </tr>
    <tr>
      <td colspan="3">Rounding Adjustment :</td>
      <td>0.00</td>
    </tr>
    <tr>
      <td colspan="3">Rounded Total (RM):</td>
      <td>9.00</td>
    </tr>
  </tbody>
</table>

Files

40 files · 9.78 GBWeights 89.9 MB (smallest of 15 ONNX variants). Sizes and sha256 from the signed manifest.
Show all 40 files with their sha256
FileSizesha256
.gitattributes2.67 KBe5164b50693b01139079774a3ee928d99210b43228a358495958621258ddde8f
README.md4.86 KBb1ac32cdb8c6fa99c0da14baeb44a6ef4d43ce61fba2539f508c012d1f82bbcf
chat_template.jinja720 B0942a43ee0ba48a608814e0b40ac9cb70bcc29ea72f19c84b1bf2597f05aa2bd
config.json3.13 KBf38fb6f90cbc809049e9d1ad59373f00dc64c36c20bd3d860d23dbd43c2e4741
generation_config.json246 Bffbc4687e0fcedfa25317d90cc80f17a1f799db34f4da5e62c742d94eec35fe3
onnx/decoder_model_merged.onnx285 KBe610568375c12a03a865a4de60a2edf1a448c2d77cca773c2dd67b4c4f550183
onnx/decoder_model_merged.onnx_data1.77 GBc5e94925d04f009ef0a46e0cfb48bc38da4edf86c65929e8b27d0c7cf412578f
onnx/decoder_model_merged.onnx_data_1622 MBec6e0712b967a98e66d61395180615c691c2d8e884b6a40148dfb25abfd2bdbc
onnx/decoder_model_merged_fp16.onnx272 KB84c0553f8f3a4df4d30e2ee0bba0a77d6aec26d04a12673fc481ef0f8ec1278b
onnx/decoder_model_merged_fp16.onnx_data1.20 GB573c282f28faa5a38d13ea946ebe1f5a7e43a329c2f15e9e2f914694eba1a3df
onnx/decoder_model_merged_q4.onnx380 KBbb6773d33f6eb543d5c1f8d29f8a9d816baac6f0e1122a3361eec802dea966d7
onnx/decoder_model_merged_q4.onnx_data390 MBf4d756a524e348093bf13601dde1abbf606cc91f6bb532f0c97cd463426ea9cc
onnx/decoder_model_merged_q4f16.onnx368 KBc5cdbcdfa06f31f0d226723a895ab04d823648443e8f6892c5c2c681d7c9ae1e
onnx/decoder_model_merged_q4f16.onnx_data349 MBf1b58abdc81e29a2bdacae3467345c9ce0632858f454f281fb0a3ac777954bcc
onnx/decoder_model_merged_quantized.onnx384 KB4815140128817e80aa340a0cbb737fbf505cb88daa1658ee1a6540abe8e188ed
onnx/decoder_model_merged_quantized.onnx_data698 MBe9ed2ea52232e4b456da2df727ad8703b8524534af27e051f9958bfc61116633
onnx/embed_tokens.onnx434 B0498c1c2c68f3ef891554c70c18aa2284fd88e16e160e4914d38d64a07d9e8d8
onnx/embed_tokens.onnx_data622 MBd205746ce9aadc197dacccc3428521f325b0a84a40247d2f9ceb50c5e65edf6d
onnx/embed_tokens_fp16.onnx637 Bfa185a4f1fa95ea0e4252814b5871b24cb52351972ff6a1812225f9b61bf0f1d
onnx/embed_tokens_fp16.onnx_data311 MB9994cecc7bc054d04c9f7c3794fde4d7b5f8b287c5e0d0cec35b16e8fa590486
onnx/embed_tokens_q4.onnx854 Bb83a841f8699a02a7104521d676b2d64f2aa7c11c0572b7fc45c6e3f94dde329
onnx/embed_tokens_q4.onnx_data99.7 MBb88c4c463005375722e17bab1aa0a3b41c3c396a40ab074f23d9fb170c233b51
onnx/embed_tokens_q4f16.onnx1.06 KB40c59364c716a369e52e427fb8f929f1a8103d01bd5807907723d79014be3902
onnx/embed_tokens_q4f16.onnx_data89.9 MB60b9a3dcbaa0d752a20896daedbc92ac66d59471afd1ce38bcf082228539a3ef
onnx/embed_tokens_quantized.onnx879 B06444bdab2cc5ce698e007fc5666de337548053d52b81d9cb913fc0130cde5af
onnx/embed_tokens_quantized.onnx_data180 MB783372ae89c67d83469238e12aa32b480302d703a981f5a15b64859fcef8f0d9
onnx/vision_encoder.onnx251 KBc2ebf46ca5422048167fd3d6d61c4e9756dee60c0fb1cb28a91f739399848fac
onnx/vision_encoder.onnx_data1.64 GB1a276d2c5dc08184e99bf076bab745f077200b5b8e8072c4fae2ee51e9d851ee
onnx/vision_encoder_fp16.onnx253 KB33b4d8d2c937ea72b62bc1e3738b62112a17aaef7ce5713dbdd6df17e583b920
onnx/vision_encoder_fp16.onnx_data819 MBee2e3986b9ef0f0f8fee08d555e377f845026f90b7d17508cd7c994bcab31048
onnx/vision_encoder_q4.onnx332 KB025631caf02fbb6fee404d8bb233adf3cb102d12cdd1b5a3e727c994917bc908
onnx/vision_encoder_q4.onnx_data265 MBdcb27f3c4072a948f907b3ca4e9f49c2266b77b2ef0218788a09a0f3827c45b7
onnx/vision_encoder_q4f16.onnx334 KB670744beee528b26e9cf037f646870a45c1d2da982c8d81eda5ca96b5d547c8b
onnx/vision_encoder_q4f16.onnx_data238 MB4530388df9476af0f7e2923fe11675d4b8ab2d8baf5edc7fa67e893c763bddbe
onnx/vision_encoder_quantized.onnx336 KB3b4934069a0e017ba7008025d2899cf83eda77e5883e9521f445071c323ec4d3
onnx/vision_encoder_quantized.onnx_data475 MB39b56d2641f33ad17445c6f9897270b4f84cbdd0494059efc27dae094a272373
preprocessor_config.json675 Bd15ddb45afe77407d87d9062ea135bc7a4027766e496f8bbf6d8a0db4a79a2da
processor_config.json748 B181ad4baf491d35c78f9a6e91ebb9c5800a3999994557da310550f2fbd473bcf
tokenizer.json9.12 MBe77c3c8550ffd5acb4a2cd682d0f8e6075727565607c7999212f1c20acf8c611
tokenizer_config.json1.54 KBce1a7985304d09409cbc2c198f6757e08671518c518877986cc76f701f85fcfc
VersionsEach time the pinned upstream commit or file list changed in this repo. Newest first.
Upstream commitDateContents
2e2ecebebd pinned now2026-11-15 05:20 UTC40 files · 9.78 GB

Use it

$ fw get onnx-community/LightOnOCR-2-1B-ONNX
# manifest sha256 30a340dc837b… · 9.78 GB · 40 files
$ fw verify ./LightOnOCR-2-1B-ONNX onnx-community/LightOnOCR-2-1B-ONNX
fw.pyChecks the signature and every sha256, tries each source in order, resumes.
$ python3 fw.py get https://freeweights.allternit.com/manifests/onnx-community/LightOnOCR-2-1B-ONNX.json --dir ./LightOnOCR-2-1B-ONNX $ python3 fw.py verify ./LightOnOCR-2-1B-ONNX ./onnx-community__LightOnOCR-2-1B-ONNX.json
hfThe Hugging Face CLI with one setting. Same repo id.
$ HF_ENDPOINT=https://freeweights.allternit.com hf download onnx-community/LightOnOCR-2-1B-ONNX --revision 2e2ecebebd69beaa3c38822c2927611eba811bd2 --local-dir ./LightOnOCR-2-1B-ONNX

License

Name
Apache License 2.0
Id
Apache-2.0
Class
Permissive
Redistribution
yes
Listing
Hosted (signed)
Decided
License as declared by the publisher. No person read it. 2026-11-15
Text in
README.md
Text sha256
b1ac32cdb8c6fa99c0da14baeb44a6ef4d43ce61fba2539f508c012d1f82bbcf
Terms gate
No extra terms beyond the license.

Read the license text

Licenses are checked against the license table. A custom license passes only after a person reads it.

Provenance

From: onnx-community <huggingface.co/onnx-community>Newsgroups: alt.freeweights.textSubject: LightOnOCR-2-1B-ONNXDate: 2026-11-15Commit: 2e2ecebSigned: 2DC28CC7B26A283B ✓
Upstream
onnx-community/LightOnOCR-2-1B-ONNX
Pinned commit
2e2ecebebd69beaa3c38822c2927611eba811bd2
Manifest
LightOnOCR-2-1B-ONNX.json · .minisig
Manifest sha256
30a340dc837bf0af8fb206563f0a782099e1ccaa285422bb0b38d15442c5042c
Signature
minisign, Ed25519, key 2DC28CC7B26A283B
Created
2026-11-15 05:20 UTC
Generator
freeweights-manifest/0.1.0
Takedowns
None.

How to verify

$ curl -O https://freeweights.allternit.com/manifests/onnx-community/LightOnOCR-2-1B-ONNX.json $ curl -O https://freeweights.allternit.com/manifests/onnx-community/LightOnOCR-2-1B-ONNX.json.minisig $ minisign -Vm LightOnOCR-2-1B-ONNX.json -P RWQ7KGqyx4zCLXtUFOqvfv8L3g+8fpKJ1FsuxPyOYMF+4KufbUxKq1Oq $ shasum -a 256 <file> # compare with the Files tab

A manifest whose signature fails must be rejected. A file whose size or sha256 does not match must be discarded. Verify a download

Model tree

Parent

lightonai/LightOnOCR-2-1B · this model is a quantization of it

No model in the catalog names this one as its parent.

Get it
Download
$ HF_ENDPOINT=https://freeweights.allternit.com hf download onnx-community/LightOnOCR-2-1B-ONNX
Open in Freeweights Studio

Pull, verify and run it in the Allternit app on Desktop, web or phone.

Signed manifest
minisign, key 2DC28CC7B26A283B. LightOnOCR-2-1B-ONNX.json. Provenance. Takedown history: none.
From: laion <huggingface.co/laion>Subject: a2-rl-e2egit_large-50-32B
From: laion <huggingface.co/laion>Subject: a3-rl-DCAgent_exp_rpt_e2egit-large-15-8B
From: laion <huggingface.co/laion>Subject: a3-rl-DCAgent_exp_rpt_e2egit-v2-10-8B
From: laion <huggingface.co/laion>Subject: a3-rl-DCAgent_exp_rpt_pymethods2test-large-80-8B
From: laion <huggingface.co/laion>Subject: a3-rl-DCAgent_exp_rpt_unitsyn-python-large-10-8B
From: laion <huggingface.co/laion>Subject: a3-rl-DCAgent_mix_h2_language_proportional-65-8B