About the project
About the project
TraceOn is an on-device, zero-cloud cold-chain compliance and release auditor for agro-industrial exports. It combines a local 3B Small Language Model (SLM) via QVAC with deterministic Python tools and a SHA-256 cryptographic hash-chain ledger to audit batches in under 2 seconds with 100% data privacy.
- Demo video: https://youtu.be/7xfK4cXa2FA
- Logo: https://github.com/AlemEsv/TraceOn/blob/main/frontend/public/logo-traceon.svg
---
The problem
Agro-export packing plants (e.g., avocados, blueberries, grapes) lose millions due to manual, slow (20–40 min/batch) release verification. Cloud-based LLMs cannot be used due to spotty packing plant connectivity, high recurring API costs, and strict compliance confidentiality concerns.
---
Our resolution
A 100% on-device AI agent architecture. The SLM handles natural language and document extraction with autonomous self-healing Pydantic retries, while deterministic Python tools calculate thermal physics (MKT, degree-minutes) and seal an immutable audit ledger—guaranteeing 0 KB of external network traffic.
---
What we built
- Local Agentic Pipeline: Ingests shipping guides, COAs, and datalogger CSV/JSON files, extracting specs and evaluating compliance deterministically.
- Self-Healing Extraction: Pydantic schema validation loop that feeds schema errors back to the SLM (
RETRY_SUFFIX) for on-device autocorrection. - Tamper-Evident Ledger: SHA-256 hash-chain storing every audit step and instantly detecting database tampering.
- Industrial Terminal UI: High-density dashboard with real-time SSE event streaming, telemetry graphs, and exportable PDF certificates.
---
How it Works
- Ingest: Dispatch guides (PDF/images) and dataloggers (CSV/JSON) are uploaded.
- Extract: Local SLM parses contract limits (temperature, expiry, lot) via structured few-shot prompts.
- Analyze: Python computes Haynes Kinetic Temperature (MKT), degree-minutes, and detects excursions.
- Decide & Seal: Compliance rules issue a deterministic verdict (
APPROVED,QUARANTINE,REJECTED), sealed into the hash-chain ledger.
---
Where the inference happens (permalinks)
---
Models and hardware
| Component | Specification |
|---|---|
| Primary SLM | Qwen/Qwen2.5-3B-Instruct |
| Quantization | Q4_K_M (4-bit integer weights, ~2.5 GB disk footprint) |
| OCR Pipeline | qvac-ocr local vision pipeline (Base64 multimodal) |
| Alternative Drop-ins | Llama-3.2-3B-Instruct (Q4), Phi-3.5-mini-instruct (Q4) |
| Host Hardware | Desktop PC · Intel Core i5-11400F (6C/12T @ 2.60 GHz – 4.40 GHz) |
| GPU / Graphics | AMD Radeon RX 7600 (8 GB GDDR6) |
| Memory (RAM) | 16 GB DDR4 RAM (TraceOn peak usage: ~2.8 GB RAM) |
| Inference Latency | TTFT: ~120 ms | Extraction (P50): 1,602 ms |
| Network Footprint | 0 KB internet traffic (strict 127.0.0.1 loopback invariant) |
---
Limitations
- Document OCR quality drops significantly on extremely crumpled or physical carbon-copy pages below 150 DPI.
- A 3B SLM struggles when numbers are written entirely in verbose natural language without digits (e.g., "dos punto cinco a siete punto ocho").
- The system processes one document batch at a time to stay within low-resource consumer RAM constraints.
---
How to run it
# 1. Initial setup cd backend && make setup cd ../frontend && pnpm install # 2. Run backend cd backend && make dev # 3. Run frontend cd frontend && pnpm dev
Hacki