Broker's laptop
Full extraction pipeline on a standard CPU — batch a day's B/Ls over lunch.
Open-source Logistics NER
Your Data. Your Model. Your Hardware.
Eight trained encoder and document models that read B/Ls, air waybills, commercial invoices, packing lists and customs declarations, validate the codes that matter (ISO 6346, IMO, HS, UN/LOCODE), and de-identify pricing & PII on-prem with a signed audit trail — no document ever leaves your network. ONNX/edge exports included. Apache-2.0, hosted on Hugging Face.
$ pip install git+https://github.com/flowx-ai/openner
from openner import analyze result = analyze(document, profile="customs") print(result.entities) # CONTAINER_NO, HS_CODE, PORT, INCOTERM … edi = result.to_edifact() # structured output, validated on-device
The largest model is under 400 MB. No GPU, no cloud account, no callbacks.
Full extraction pipeline on a standard CPU — batch a day's B/Ls over lunch.
Gate-in OCR and container validation on an edge gateway, air-gapped if you like.
Embed as a Python or Java library — extraction becomes just another function call.
Quantized ONNX builds run client-side — nothing uploads, even in a web app.
One container image serves your whole team behind your own firewall.
Rates, supplier lists and routings are your competitive edge. Customs data is regulated. OpenFreight is built so neither has to leave the building — even when you want an LLM downstream.
Each model does one job well, stays small enough for a CPU, and is published on Hugging Face under Apache-2.0. Compose them through profiles or call them individually.
Extracts and ISO-6346-validates container numbers, seals and size/type codes.
Classifies a goods description into its HS chapter (~20 chapters) for chapter-level customs routing — trained on a synthetic factory; retrain on real CBP CROSS rulings before it drives binding tariff determinations.
Detects Incoterms 2020 rules and the named place that goes with them.
Full bill-of-lading field extraction, from shipper block to cargo description.
Resolves UN/LOCODEs, vessel and IMO numbers, voyage references, ETA/ETD.
Flags UN numbers, IMDG/IATA hazard classes and packing groups.
Disambiguates shipper, consignee, notify party and carrier — with SCAC lookup.
PII and commercial de-identification: names, contacts, banking, unit prices.
The models are the foundation. These are the applications teams build on top — all of them running on-prem, all of them open.
Reads the B/L, commercial invoice and packing list together, drafts the customs declaration, proposes HS codes with a written rationale, and flags export-control and dangerous-goods risk — entirely on-prem.
Turns scanned and emailed shipping documents into structured EDIFACT and X12 messages, with every code validated against the official lists before it hits your message queue.
Locally indexes your whole document archive and answers questions like "where is PO 44821, what's the ETA, any hazmat on board?" — de-identifying with TradeRedact before any LLM call.
Extraction is only useful if it lands in the frameworks your compliance team already works in.
We benchmarked our small on-device models head-to-head against the latest cost-effective frontier LLMs — same documents, same entity types. N=30 per task, against Claude Haiku 4.5, GPT-5.4-mini, GPT-5.4-nano, Gemini 3.5-flash and Gemini 3.1-flash-lite (OpenAI models via the Responses API).
| Extraction — invoices · PII · trade fields | F1 | Latency / doc | Cost / 1k docs | Egress |
|---|---|---|---|---|
| OpenFreight(8 models, on-device) | 1.000 | ~150 ms | $0 | 0 bytes |
| Frontier tier(Haiku 4.5 · GPT-5.4-mini/nano · Gemini 3.5-flash / 3.1-flash-lite) | ≤ 1.000 | 850–3,700 ms | $0.03–0.84 | full document |
Honest footnote: frontier LLMs win at open-ended reasoning — not structured, convention-bound extraction. That's where small on-device encoders win.
An open-source toolkit of small, task-specific NER and document-understanding models for logistics and trade paperwork — bills of lading, air waybills, commercial invoices, packing lists and customs declarations. It extracts and validates the entities those documents carry, and de-identifies the sensitive ones, entirely on your own hardware.
Encoder models (BERT-family) are excellent at token classification, run in milliseconds on a CPU, produce deterministic spans with confidences, and don't hallucinate container numbers. For a well-defined extraction task on regulated documents, a 100–400 MB model you can audit beats a remote multi-billion-parameter one you can't. LLMs still have a place — downstream, after TradeRedact.
No. Inference is fully local, there is no telemetry, and the library makes no network calls at runtime. The only download is the model weights themselves, once, from Hugging Face — and you can mirror those internally for air-gapped sites.
Two paths: layout-aware models in the LayoutLMv3 family that combine OCR text with page geometry, and OCR-free Donut-style models that read the page image directly. Profiles pick the right path automatically based on whether the input is digital text or an image/PDF scan. Our DocFormNER model (LayoutLMv3: text + 2D layout + page image, published on Hugging Face) now reads scanned and photographed bills of lading and arrival notices on-prem — it's a preview trained on synthetic rendered forms, so validate it on your own OCR'd scans before production.
Yes — that's the intended workflow for house formats. Every model ships with its training configuration, and the openfreight.finetune module wraps Hugging Face Transformers so a few hundred annotated examples of your own B/L layout are usually enough to specialize a model. Your fine-tuned weights stay yours.
Apache-2.0 across code, weights and training recipes — commercial use included. On data, an honest note: there is no large public logistics-NER corpus. Training combines public document-KIE datasets (DocILE, SROIE, CORD, FUNSD), official trade code lists (CBP CROSS rulings, the HS nomenclature, UN/LOCODE, the BIC container register) and large-scale synthetic document generation. Dataset cards document the mix per model.
openfreight.life — an open-source concept. Code, weights and recipes under Apache-2.0. Modeled on the OpenMed approach (openmed.life).