{ "schema_version": "5.1", "name": "paddleocr-vl", "tt_metal_version": "0.65.2.dev11169+g44d66500520", "arch": "blackhole", "device_count": 1, "producer": { "tt_kernel_version": "0.1.0", "created_at": "2026-12-01T13:19:36.979009+00:00", "hostname": "hchang-bh" }, "weights": { "repo_id": "PaddlePaddle/PaddleOCR-VL-1.6", "revision": "132c45f52c0a26ed5a6b2f6bd8e3985794cc27dd", "allow_patterns": [ "model.safetensors", "config.json", "generation_config.json", "preprocessor_config.json", "tokenizer.json", "tokenizer_config.json", "added_tokens.json", "special_tokens_map.json", "chat_template.jinja", "LICENSE", "README.md" ], "ignore_patterns": null, "repo_type": "model" }, "auxiliary_weights": [ { "repo_id": "PaddlePaddle/PaddleOCR-VL-1.5", "revision": "1e5216083435c7851caad5d691ef55aab81b5949", "allow_patterns": [ "model.safetensors", "config.json", "generation_config.json", "preprocessor_config.json", "tokenizer.json", "tokenizer_config.json", "added_tokens.json", "special_tokens_map.json", "chat_template.jinja", "LICENSE", "README.md" ], "ignore_patterns": null, "repo_type": "model" }, { "repo_id": "PaddlePaddle/PaddleOCR-VL", "revision": "dae2996584399c9fb7eabfeecf8acd2c7cae95b7", "allow_patterns": [ "model.safetensors", "config.json", "generation_config.json", "preprocessor_config.json", "tokenizer.json", "tokenizer_config.json", "added_tokens.json", "special_tokens_map.json", "chat_template.jinja", "LICENSE", "README.md" ], "ignore_patterns": null, "repo_type": "model" } ], "mesh": null, "entrypoint": null, "resources": null, "capabilities": null, "env": {}, "bundled": null, "deps": null, "container": { "image": { "registry": "hf", "repository": "paddleocr-vl", "tag": "tt-model/paddleocr-vl:972521bcce20", "digest": "sha256:972521bcce2001321524c2da7b43c4a78083740a9338908236eda4febc00a006" }, "kind": "tt-dit-server", "runtime": { "app": "tt_paddleocr.server.app:app", "mesh_shape_env": "TT_MESH_SHAPE", "packages": [ "numpy>=1.24.4,<2", "safetensors==0.8.0", "huggingface_hub==1.16.1", "tokenizers==0.22.2", "pillow==12.3.0", "fastapi==0.142.2", "uvicorn==0.54.0" ], "lock": "requirements.lock" }, "serve": { "hardware": "p150", "mesh_device": "P150", "port": 20000, "max_model_len": null, "max_num_seqs": null, "block_size": null, "server_timeout": null, "capabilities": null, "additional_config": {}, "args": [], "env": { "TT_WEIGHTS_REVISION": "132c45f52c0a26ed5a6b2f6bd8e3985794cc27dd", "TT_METAL_VISIBLE_DEVICES": "0", "TT_DEVICE_ID": "0", "HF_HUB_DISABLE_IMPLICIT_TOKEN": "1", "PADDLEOCR_DISPATCH": "eth", "PADDLEOCR_PROFILE": "1.6", "PADDLEOCR_ENGINE": "vis=ttnn,pre=ttnn,dec=mk", "PADDLEOCR_PRECISION": "", "PADDLEOCR_MAX_PIXELS": "", "PADDLEOCR_MAX_NEW_TOKENS": "4096", "PADDLEOCR_MAX_PROMPT_TOKENS": "64", "PADDLEOCR_K_MAX": "64", "PADDLEOCR_POLL_TOKENS": "8", "PADDLEOCR_TRACE": "1", "PADDLEOCR_TTNN_FALLBACK": "auto", "PADDLEOCR_WARMUP": "all", "PADDLEOCR_QUEUE_DEPTH": "8", "PADDLEOCR_QUEUE_TIMEOUT_S": "300", "PADDLEOCR_MAX_BODY_MB": "64", "PADDLEOCR_MAX_IMAGE_MPIX": "64", "PADDLEOCR_ALLOW_URLS": "0", "PADDLEOCR_TORCH_THREADS": "2", "PADDLEOCR_CACHE_DIR": "/weight-cache" } }, "serve_profiles": [ { "hardware": null, "mesh_device": null, "port": null, "max_model_len": null, "max_num_seqs": null, "block_size": null, "server_timeout": null, "capabilities": null, "additional_config": {}, "args": [], "env": { "PADDLEOCR_PROFILE": "1.6", "PADDLEOCR_DISPATCH": "eth" }, "name": "1.6", "description": "PaddleOCR-VL-1.6: the most accurate (the default); OCR, table, formula, chart, spotting, seal" }, { "hardware": null, "mesh_device": null, "port": null, "max_model_len": null, "max_num_seqs": null, "block_size": null, "server_timeout": null, "capabilities": null, "additional_config": {}, "args": [], "env": { "PADDLEOCR_PROFILE": "1.5", "PADDLEOCR_DISPATCH": "eth" }, "name": "1.5", "description": "PaddleOCR-VL-1.5: OCR, table, formula, chart, spotting, seal" }, { "hardware": null, "mesh_device": null, "port": null, "max_model_len": null, "max_num_seqs": null, "block_size": null, "server_timeout": null, "capabilities": null, "additional_config": {}, "args": [], "env": { "PADDLEOCR_PROFILE": "vl", "PADDLEOCR_DISPATCH": "eth" }, "name": "vl", "description": "PaddleOCR-VL (first version): OCR, table, formula, chart; images up to 2.8 megapixels" } ], "default_profile": "1.6", "code_dir": "code", "verify": [ "assert 'single_chip_arch_1cq_no_dispatch_s' in open('/opt/tt-metal/tt_metal/impl/dispatch/topology.cpp').read()", "assert 'dual_kernel_min_dram_dest_page_bytes' in open('/opt/tt-metal/ttnn/cpp/ttnn/operations/data_movement/reshape_view/device/reshape_rm_program_factory.cpp').read()", "from tt_paddleocr.ttaw.device import eth_dispatch_patch_present as p; assert p(), 'the ETH patch is not visible'", "import sys, tt_paddleocr.server.app as a; assert a.app and 'ttnn' not in sys.modules and 'torch' not in sys.modules, 'the server module must import without ttnn / torch'", "from tt_paddleocr.server.app import parse_mesh_shape as p; assert p('1x1') == p('(1, 1)') == p('1,1') == (1, 1)", "from tt_paddleocr.server.app import load_config; c = load_config({'PADDLEOCR_PROFILE': '1.6', 'PADDLEOCR_ENGINE': 'vis=ttnn,pre=ttnn,dec=mk', 'PADDLEOCR_DISPATCH': 'eth', 'TT_MODEL_WEIGHTS_REVISION': '132c45f52c0a26ed5a6b2f6bd8e3985794cc27dd', 'TT_DIT_CACHE_DIR': '/weight-cache'}); assert (c.profile, c.revision, c.max_pixels, c.vis_buckets[-1], c.dispatch, c.cache_dir) == ('1.6', '132c45f52c0a26ed5a6b2f6bd8e3985794cc27dd', 1605632, 8192, 'eth', '/weight-cache'), c; assert c.engine == {'vis': 'ttnn', 'pre': 'ttnn', 'dec': 'mk'}", "from tt_paddleocr.server.app import load_config as L\nfor p in ('vl', '1.5', '1.6'):\n assert L({'PADDLEOCR_PROFILE': p}).profile == p\nassert L({'PADDLEOCR_PROFILE': 'vl'}).max_pixels == 2822400\nfor bad in ({'PADDLEOCR_PROFILE': '2.0'}, {'PADDLEOCR_ENGINE': 'dec=gpu'}, {'PADDLEOCR_DISPATCH': 'pcie'}, {'PADDLEOCR_MAX_NEW_TOKENS': '5'}, {'PADDLEOCR_VIS_BUCKETS': '1000'}, {'TT_MESH_SHAPE': '1x2'}):\n try:\n L(bad)\n except RuntimeError:\n continue\n raise AssertionError(bad)", "from tt_paddleocr.config import WEIGHTS; assert WEIGHTS == {'vl': ('PaddlePaddle/PaddleOCR-VL', 'dae2996584399c9fb7eabfeecf8acd2c7cae95b7'), '1.5': ('PaddlePaddle/PaddleOCR-VL-1.5', '1e5216083435c7851caad5d691ef55aab81b5949'), '1.6': ('PaddlePaddle/PaddleOCR-VL-1.6', '132c45f52c0a26ed5a6b2f6bd8e3985794cc27dd')}", "from tt_paddleocr import serve_config as S; from tt_paddleocr.api import PaddleOCRVL\nfor p in ('vl', '1.5', '1.6'):\n m = PaddleOCRVL.from_config(S.resolve_config({'PADDLEOCR_PROFILE': p, 'PADDLEOCR_BACKEND': 'fake'}))\n r = m.recognize('/opt/tt-metal/tt_paddleocr/samples/table_simple.png', task='table'); assert r['stop'] == 'eos' and r['result']['html'].startswith(''), r\n assert ''.join(m.stream('/opt/tt-metal/tt_paddleocr/samples/text_zh_line.png')) == m.last_result['text']", "import tokenizers, PIL, safetensors; assert (tokenizers.__version__, PIL.__version__, safetensors.__version__) == ('0.22.2', '12.3.0', '0.8.0')", "from tt_paddleocr.tt.model import DevicePipeline as D; miss = [n for n in ('run', 'info', 'limits', 'close') if not callable(getattr(D, n, None))]; assert not miss, miss", "import os; from tt_paddleocr.tt.mk_dec import geometry as G, arena as A; assert (G.N_LAYERS_FULL, G.VOCAB, G.dims_of(1024).hc) == (18, 103424, 101); assert all(os.path.isfile(os.path.join(G.KDIR, f)) for f in ('md_brisc.cpp', 'md_ncrisc.cpp', 'md_trisc.cpp', 'md_defs.hpp', 'md_dm.hpp', 'sampler.hpp')); assert not A.CACHE_DIR.startswith(('/home/ubuntu/experiments', '/mnt/')), A.CACHE_DIR", "import hashlib, json; from pathlib import Path\nd = Path('/opt/tt-metal/tt_paddleocr/samples'); m = json.loads((d / 'samples.json').read_text())['samples']\nassert len(m) == 4 and (d / 'ATTRIBUTION.md').is_file()\nfor s in m.values():\n assert hashlib.sha256((d / s['file']).read_bytes()).hexdigest() == s['sha256'], s['file']", "from pathlib import Path; d = Path('/opt/tt-metal/tt_paddleocr/licenses'); assert 'Apache License' in (d / 'LICENSE-APACHE-2.0.txt').read_text() and 'PaddlePaddle' in (d / 'NOTICE.md').read_text()", "from pathlib import Path; assert all(Path('/opt/tt-metal', p).is_file() for p in ('tt_paddleocr/server/smoke_test.py', 'tt_paddleocr/server/client.py', 'scripts/container_smoke.sh', 'PYTHON.md'))", "import numpy; assert int(numpy.__version__.split('.')[0]) < 2, numpy.__version__", "import torch; assert torch.__version__.startswith('2.11.0'), torch.__version__", "import ttnn; assert all(hasattr(ttnn, a) for a in ('DispatchCoreConfig', 'begin_trace_capture', 'end_trace_capture', 'execute_trace', 'release_trace', 'copy_host_to_device_tensor', 'generic_op'))" ], "built": { "image": "tt-model/paddleocr-vl:972521bcce20", "repo": "changh95/PaddleOCR-VL", "tt_model_version": "0.1.0", "created_at": "2026-12-01T12:28:04+00:00", "tt_metal": { "sha": "44d66500520fda9f2c7060c0f6b41ec48f7ab37e", "describe": "v0.80.0-dev20261006-78-g44d6650052-dirty", "dirty": true, "scm_version": "0.65.2.dev11169+g44d66500520", "mode": "local", "remote": "https://github.com/tenstorrent/tt-metal.git", "branch": "main", "pushed": true }, "code_sha256": "bc06eccad85db606c272195a7f9c109492b7e194c37ef95d914c8ae61e0cd977", "image_digest": "sha256:972521bcce2001321524c2da7b43c4a78083740a9338908236eda4febc00a006" }, "card": { "description": "PaddleOCR-VL-0.9B is the element recognizer of PaddlePaddle's document parser: a NaViT-style vision encoder (27 layers, width 1152, 2-D rotary positions) that reads an image at its own resolution (up to about one megapixel for 1.5 / 1.6, 2.8 megapixels for the first version), a projector that merges 2 x 2 patches into one token, and the ERNIE-4.5-0.3B language model that writes the answer. Prompted with a task, it recognizes text (109 languages), tables (as an OTSL cell sequence, converted to HTML by this package), formulas (LaTeX) and charts; 1.5 and 1.6 add text spotting (lines with their polygons) and seal recognition. Three checkpoints are served from one image as serve profiles: `1.6` (default), `1.5` and `vl`. The package includes the official image pre-processing, chat template and task presets; the vision encoder and the prefill run on the device as traced tt-nn graphs (bfloat16 weights) and every decoded token as one launch of a decoder megakernel (block-float-8 weights) with on-device greedy decoding / sampling. The page layout stage of the official pipeline (PP-DocLayout) is not included: send element crops, or whole pages with the `ocr` / `spotting` tasks.", "attribution": "Derived from PaddlePaddle's PaddleOCR-VL ([PaddlePaddle/PaddleOCR-VL-1.6](https://huggingface.co/PaddlePaddle/PaddleOCR-VL-1.6), [PaddlePaddle/PaddleOCR-VL-1.5](https://huggingface.co/PaddlePaddle/PaddleOCR-VL-1.5), [PaddlePaddle/PaddleOCR-VL](https://huggingface.co/PaddlePaddle/PaddleOCR-VL)), with unmodified weights downloaded from PaddlePaddle's repositories. Official code: [PaddlePaddle/PaddleOCR](https://github.com/PaddlePaddle/PaddleOCR) and the repositories' `trust_remote_code` files. This is a third-party port, not affiliated with or endorsed by Baidu or the PaddlePaddle team. See the original model cards for training details.", "prerequisites": "- About 2 GB of free disk per served profile for its checkpoint (fetched once into the Hugging Face cache, 5.8 GB for all three), plus the container image\n- The first start of a profile compiles the device programs of every bucket (about 1 500 kernels: ~18 minutes for\n `1.6` on a busy 8-core host) and packs the decoder megakernel's weights (~20 s); both are kept in tt-model's\n cache, so later starts are ready in about a minute (`1.6`: 66 s). Fewer buckets (`PADDLEOCR_VIS_BUCKETS`,\n `PADDLEOCR_MAX_PIXELS`) shorten it\n- Images as PNG, JPEG, WebP, BMP, TIFF or GIF (first frame), sent as base64 / data URLs\n", "quickstart": "Default profile (`1.6`), on the port `tt serve` reported:\n\n```bash\ncurl -sLO https://huggingface.co/changh95/PaddleOCR-VL/resolve/main/code/tt_paddleocr/samples/table_simple.png\ncurl -s localhost:20000/ocr -H 'Content-Type: application/json' \\\n -d \"{\\\"image\\\": \\\"$(base64 -w0 table_simple.png)\\\", \\\"task\\\": \\\"table\\\"}\"\n# {\"text\": \"ModelParamsLatency (ms)Score...\", \"result\": {\"html\": \"
...\", ...}, ...}\ncurl -s localhost:20000/ocr -F file=@table_simple.png -F task=table -F stream=true # SSE text deltas\n```\n", "architecture": null, "status": null, "intended_use": "Low-latency recognition of document elements on one Tenstorrent p150, one request at a time: text lines and paragraphs, tables, formulas, charts, seals, and text spotting on whole pages; the recognition stage behind a layout detector of your choice. Not included: the page-layout stage of the official PaddleOCR-VL pipeline (PP-DocLayout finds and orders the elements of a page; its weights are published only in PaddlePaddle's own format, so it is a separate port), hence no full-document parsing endpoint.", "out_of_scope_use": null, "usage": "The model's own server implements `POST /v1/chat/completions` in the OpenAI shape (the generic line above is\ntt-model's note for this kind of package; it is not a tt-model-provided chat front end): one user message with\none image and a task prompt; the OpenAI Python client works against it:\n\n```python\nimport base64\nfrom openai import OpenAI\nclient = OpenAI(base_url=\"http://localhost:20000/v1\", api_key=\"unused\")\nurl = \"data:image/png;base64,\" + base64.b64encode(open(\"table_simple.png\", \"rb\").read()).decode()\nr = client.chat.completions.create(model=\"paddleocr-vl\", messages=[{\"role\": \"user\", \"content\": [\n {\"type\": \"image_url\", \"image_url\": {\"url\": url}}, {\"type\": \"text\", \"text\": \"Table Recognition:\"}]}])\nprint(r.choices[0].message.content)\n```\n\n| task | prompt (chat text) | output | profiles |\n| --- | --- | --- | --- |\n| `ocr` | `OCR:` | text (lines, paragraphs, whole pages) | all |\n| `table` | `Table Recognition:` | OTSL cells (``, ``, ``, ``, ...); `/ocr` adds `result.html` | all |\n| `formula` | `Formula Recognition:` | LaTeX; `/ocr` adds `result.latex` without the delimiters | all |\n| `chart` | `Chart Recognition:` | the chart's data as a pipe-separated table; `/ocr` adds `result.rows` | all |\n| `spotting` | `Spotting:` | text lines, each with its location tokens (coordinates 0..1000); `/ocr` adds `result.items` with polygons in pixels | 1.5, 1.6 |\n| `seal` | `Seal Recognition:` | the text of a seal / stamp | 1.5, 1.6 |\n\n| request field | default | meaning |\n| --- | --- | --- |\n| image | required | chat: an `image_url` part (data URL; http(s) URLs only with `PADDLEOCR_ALLOW_URLS=1`); `/ocr`: `image` (base64 or data URL), a multipart `file`, or the raw body (`image/*`) |\n| task / prompt | `ocr` | chat: the text part is a task prompt or a task name, or a custom prompt; `/ocr`: `task` and / or `prompt` |\n| `max_tokens` (chat) / `max_new_tokens` (`/ocr`) | 512 (1.5, 1.6), 1024 (vl) | generated-token limit, up to `PADDLEOCR_MAX_NEW_TOKENS` (4096) and the room the prompt leaves: on 1.5 / 1.6 prompt + output <= 4,096 tokens (longer requests are cut to that silently, `finish_reason` `length`); on `vl` up to 7,808 positions, beyond 4,096 on the tt-nn decode engine (~6 ms per token) |\n| `temperature` | 0 | 0 = greedy (the official decoding); > 0 samples on the device (with `top_k` <= 64, `top_p`, `seed`) |\n| `top_k`, `top_p`, `seed` | 0, 1, random | sampling controls (extensions to the OpenAI fields); on the device sampler `top_k` 0 = the 64 most likely tokens |\n| `repetition_penalty` | 1 (off) | 1 .. 2 (HF's rule over prompt + generated tokens); every profile: the decoder megakernel produces the logits and the host applies the penalty and chooses (about 2.5-3 ms per token greedy instead of ~1.5, about 20-27 ms per token when also sampling with `temperature` > 0, because the host then samples over the full vocabulary) |\n| `max_pixels`, `min_pixels` | the profile's preset | the resize bounds of the image (the task presets: spotting upscales small pages 2x and allows 1.6 megapixels) |\n| `stream` | false | Server-Sent Events: chat `chat.completion.chunk` deltas (`stream_options.include_usage`), `/ocr` `delta` then `done` events |\n\n- `/ocr` answers `text` (the model's output), `result` (table `html` / `otsl` / `rows`, spotting `items` with\n `box` and `points`, formula `latex`, chart `rows`), `usage`, `timings` (preprocess, vision, prefill, first\n token, decode, per token, in ms) and `image` (sizes, the patch grid).\n- `GET /health` reports readiness, `GET /info` the profile, tasks, weights and their commits, the device, the\n engines, the configuration, the buckets and the limits; `GET /v1/models` lists the served model.\n- Errors: 400 with the reason, 413 body too large, 415 content type, 422 malformed body, 429 queue full\n (`Retry-After`), 503 while starting or after `PADDLEOCR_QUEUE_TIMEOUT_S`, 500 on a device failure.\n- A Python API with the same parameters (`tt_paddleocr.api.PaddleOCRVL`) is described in\n [`code/PYTHON.md`](code/PYTHON.md).\n\n### Configuration\n\nThe server builds its device programs for one configuration when it starts; change it with environment variables\nand start it again. `GET /info` reports it.\n\n| item | environment variable | values | default |\n| --- | --- | --- | --- |\n| checkpoint | `PADDLEOCR_PROFILE` (the serve profiles set it) | `1.6`, `1.5`, `vl` | `1.6` |\n| largest image (pixels after the resize) | `PADDLEOCR_MAX_PIXELS` | 3136 .. 16777216 | 1605632 (1.5, 1.6: the spotting preset), 2822400 (vl) |\n| smallest image | `PADDLEOCR_MIN_PIXELS` | 3136 .. max | 112896 (1.5, 1.6), 147384 (vl) |\n| tokens per request | `PADDLEOCR_MAX_NEW_TOKENS` | 16 .. 16384 | 4096 (cap of `max_tokens`; the KV capacity bounds prompt + output: 4,096 on 1.5 / 1.6, 7,808 on vl) |\n| prompt text tokens | `PADDLEOCR_MAX_PROMPT_TOKENS` | 16 .. 1024 | 64 |\n| device engines | `PADDLEOCR_ENGINE` | `dec=mk` (megakernel) or `dec=ttnn` | `vis=ttnn,pre=ttnn,dec=mk` |\n| weight formats | `PADDLEOCR_PRECISION` | `vis`, `vis_mlp`, `pre_attn`, `pre_mlp`, `pre_head` = `bf16` / `bfp8`; `mk` = `bf16` / `bfp8` / `bfp8h8`; `vis_fid`, `pre_fid` = `HiFi4` / `HiFi2` / `LoFi` | vision bf16 + HiFi2, prefill bf16 (MLP bfp8) + HiFi4, megakernel `bfp8h8` |\n| compiled shapes | `PADDLEOCR_VIS_BUCKETS`, `PADDLEOCR_PRE_BUCKETS`, `PADDLEOCR_WARMUP` | patch / token counts; `all`, `none` or a list | derived from the largest image; `all` |\n| largest `top_k` | `PADDLEOCR_K_MAX` | 1 .. 64 | 64 |\n| streaming granularity | `PADDLEOCR_POLL_TOKENS` | 1 .. 64 decode steps per poll | 8 |\n| queue | `PADDLEOCR_QUEUE_DEPTH`, `PADDLEOCR_QUEUE_TIMEOUT_S` | waiting requests, seconds | 8, 300 |\n| uploads | `PADDLEOCR_MAX_BODY_MB`, `PADDLEOCR_MAX_IMAGE_MPIX`, `PADDLEOCR_ALLOW_URLS` | MB, megapixels, 0 / 1 | 64, 64, 0 |\n\n### Example output\n\nImages rendered for this demo (a table with merged header cells, a formula, a Korean notice), each sent to this\npackage's container on a p150 (default profile `1.6`) as `POST /ocr` with the task shown and otherwise the\ndefaults (greedy decoding). The right half of each image draws the answer as returned: the response's\n`result.html` (converted by the server from the model's OTSL cells) as a grid, the LaTeX as source and\nre-rendered with matplotlib, the text as is. [`media/demos.json`](media/demos.json) has the exact requests\n(plus a fourth, the notice in simplified Chinese), the whole answers with their timings, and the official\nfloat32 model's answers.\n\n![PaddleOCR-VL-1.6 on a Tenstorrent p150: a table with merged header cells and the table it returned, drawn as a grid](media/demo_table.png)\n\n![PaddleOCR-VL-1.6 on a Tenstorrent p150: the attention formula and the LaTeX it returned](media/demo_formula.png)\n\n![PaddleOCR-VL-1.6 on a Tenstorrent p150: a Korean notice and the text it returned](media/demo_korean.png)\n\nThe table's answer as the model wrote it (`text` of the response, `\"task\": \"table\"`; `result.html` holds the same\ntable as HTML):\n\n```text\nStationRainfall (mm)TotalJanFebMarAprHarbor81.264.570.352.8268.8Hillside95.077.488.160.2320.7Airport58.649.955.041.3204.8Valley72.461.066.747.5247.6\n```\n\n| input | task | image tokens | output tokens | first token | decoding | whole request (server) | client round trip |\n| --- | --- | --- | --- | --- | --- | --- | --- |\n| table, 788 x 324 | `table` | 336 | 145 | 131 ms | 608 tokens/s | 0.37 s | 0.38 s |\n| formula, 820 x 160 | `formula` | 174 | 49 | 103 ms | 635 tokens/s | 0.18 s | 0.19 s |\n| Korean notice, 1130 x 510 | `ocr` | 720 | 131 | 196 ms | 545 tokens/s | 0.44 s | 0.46 s |\n| Chinese notice, 1130 x 442 (`demos.json` only) | `ocr` | 640 | 65 | 253 ms | 552 tokens/s | 0.37 s | 0.39 s |\n\nThe second request of each input on a warm server (the first gave the same answer); the server times come from\nthe answer's `timings` (first token: `preprocess` + `first_token`; decoding: 1000 / `per_token`; whole request:\n`request`), the round trip is on loopback. Against the greedy answers of the official float32 model on the CPU\n(the same weights with their `trust_remote_code` files, transformers 5.24.1), the table, Korean and Chinese\nanswers are identical; the formula differs in one of its 49 tokens (`\\operatorname` where float32 writes\n`\\mathsf`, before \"s o f t m a x\"). The p150 and the float32 model both read the Chinese notice's underlined\ntitle as LaTeX, `\\(\\underline{\\text{\u56fe\u4e66\u9986\u4f7f\u7528\u987b\u77e5}}\\)`.\n", "performance": "Agreement with PaddlePaddle's own float32 code on the CPU (the repositories' `trust_remote_code` files,\ntransformers 5.24.1, same weights and prompts, greedy) on synthetic element crops (English / Chinese / mixed-script\ntext lines, a paragraph, vertical text, a tiny crop, a table, two formulas, a chart, a seal) and a page (OCR; text\nspotting on 1.5 / 1.6). Reference drift = PaddlePaddle's own model run in bfloat16 on the same inputs.\n\n| eval | vl | 1.5 | 1.6 |\n| --- | --- | --- | --- |\n| Outputs identical to the float32 outputs | 11 / 11 | 12 / 13 | 12 / 13 |\n| Character error rate vs the float32 outputs (mean) | 0 | 0.00015 | 0.00044 |\n| Next-token distribution, total-variation distance per step, mean / worst-case p95 (bfloat16 reference: mean <= 0.005) | <= 0.0062 / 0.041 | <= 0.0122 / 0.043 | <= 0.0069 / 0.034 |\n| Top-1 next token equal (teacher-forced) | 1.000 | 1.000 (spotting 0.991) | 1.000 |\n| Vision embedding PCC, projector output (worst case; bfloat16 reference worst case) | 0.9988 (0.9988) | 0.9944 (0.9910) | 0.9959 (0.9957) |\n\nThe two outputs that differ are the text-spotting pages: the text is identical, single location tokens differ\nby one step (1 / 1000 of the page). Megakernel decoding with on-device greedy selection gives the same tokens as\nthe float32 code on every element; sampling (`temperature` > 0) is reproducible for a fixed `seed`.\n\nReal scans (an independent check on 15 inputs cut from 9 public-domain page images: a NASA technical note and its\ntable, typewritten equations, a 1969 typed memo, an 1870 census table, Playfair's 1786 chart, a 1920s Chinese\nletter and its seal, an 1871 French book page; all three profiles, 40 greedy requests compared):\n\n| eval (real scans) | result |\n| --- | --- |\n| Outputs identical to the float32 greedy outputs | 24 / 40 requests (6,166 tokens) |\n| The other 16 | each diverges at a step where float32 itself is split: 15 at a near tie (its top two within 0.06: a whitespace, a LaTeX command, a digit, a location token), one at an uncertain digit of a 2,085-token table (0.575 / 0.376); where checked, PaddlePaddle's own bfloat16 model makes the device's choice. Character error rate vs float32 0.002-0.11, except the 1.6 Playfair chart (0.56: a whitespace tie at step 21, after which float32's numbers degenerate and the device's stay plausible) and the 1870 census table (0.24-0.29) |\n| Next-token distribution vs float32, TVD mean / top-1 (teacher-forced) | text, tables, pages 0.0001-0.006 / 0.985-1.000; formulas and the chart 0.003-0.013 (1.6-2.7x the bfloat16 drift) |\n| Text spotting (1.5 / 1.6, two real pages each) | location tokens equal to float32's at 1,249 / 1,264 steps (the others 1-2 / 1000 of the page away), text tokens at 2,567 / 2,569 |\n| Vision embedding PCC, projector output | 0.9941-0.9999 (43 runs) |\n\nTwo inputs are outside the model's competence: the seal stamp of the 1920s letter (every profile and float32 read\nit wrongly; on 1.6 the device's next-token distributions are further from float32 than the bfloat16 model's,\nTVD 0.10 vs 0.02, with the same greedy output) and the 1870 census table, on which the checkpoints themselves loop\n(they restart the table after its \"Total\" row until the token budget ends; float32 does the same).\n\nSpeed on one p150 (batch 1, warm, traced; median of 5 runs; time from the decoded image to the last token; ms):\n\n| speed (batch 1, warm) | vl | 1.5 | 1.6 |\n| --- | --- | --- | --- |\n| Decoder time per token (megakernel), element crops / page / spotting page | 1.49-1.54 / 2.38 / - | 1.48-1.56 / 2.10 / 2.60 | 1.48-1.56 / 2.08 / 2.61 |\n| Time to the first token, text-line crop (vision + prefill) | 53 | 44 | 43 |\n| Text line (22 tokens), end to end | 85 | 76 | 75 |\n| Table crop (67 tokens), end to end | 157 | 136 | 134 |\n| Formula / chart crop, end to end | 97 / 134 | 87 / 135 | 89 / 141 |\n| Page OCR (152-168 tokens), end to end | 967 | 653 | 648 |\n| Text-spotting page (559-572 tokens), end to end | - | 2138 | 2187 |\n\nFor comparison, the same pipeline with the tt-nn decode step instead of the megakernel (1.6): 5.1-5.9 ms per\ntoken; text line 162 ms, table 384 ms, page 1153 ms. A served request adds the HTTP and image decoding / resize\n(~5-15 ms for a crop).\n", "limitations": "- Element recognition only: the official pipeline's layout stage (PP-DocLayout, which finds and orders the\n elements of a page) is not included. Its weights are in PaddlePaddle's own format (only the first version's\n repository carries one, PP-DocLayoutV2; 1.5 / 1.6 use a newer one that is not in their repositories). Crop the\n elements with a layout detector of your choice, or send whole pages with `ocr` / `spotting`.\n- Batch 1: requests are served one at a time in arrival order (`PADDLEOCR_QUEUE_DEPTH` may wait).\n- One image per request, one user turn; no system prompt, no multi-turn chat.\n- Images larger than `PADDLEOCR_MAX_PIXELS` after the official resize are scaled down to it, as the official\n processor does with its own limit; the aspect ratio must stay below 200.\n- Prompt + output fit 4,096 tokens on 1.5 / 1.6 (the decoder megakernel's KV; no tt-nn decode engine is built by\n default): a request for more is cut to the room left and ends with `finish_reason` `length`. Spotting and\n full-page prompts take 1,250-2,030 tokens, so a dense page gets at most about 2,000-2,800 output tokens.\n `PADDLEOCR_TTNN_FALLBACK=1` adds the tt-nn decode engine (up to `PADDLEOCR_MAX_POSITIONS`, ~6 ms per token,\n longer start-up). `vl` builds it by default (7,808 positions).\n- Sampling (`temperature` > 0) on the megakernel draws from the 64 most likely tokens (`PADDLEOCR_K_MAX`;\n `top_p` applies within them); requests with `repetition_penalty` or on the tt-nn decode engine sample the full\n vocabulary on the host. Greedy decoding, the official default, is exact on every path.\n- EXIF orientation is ignored, as in the official processor: rotate photos before sending them.\n- Accuracy is measured on synthetic images and on 15 real scans (no public benchmark run): outputs equal\n PaddlePaddle's float32 greedy outputs on most inputs; on real scans a near tie in float32 (a few per cent\n apart) is occasionally resolved the other way, after which the rest of the output can differ (one chart of 15\n inputs differed substantially); on spotting pages single location tokens may differ by one step. On an\n out-of-distribution seal stamp the device's next-token distributions are further from float32 than\n PaddlePaddle's bfloat16 model's, with the same output.\n", "risks": null, "licensing": "- Weights (not redistributed here; `tt serve` downloads them from PaddlePaddle's repositories at these commits),\n all Apache-2.0: [PaddlePaddle/PaddleOCR-VL-1.6](https://huggingface.co/PaddlePaddle/PaddleOCR-VL-1.6)\n `132c45f5`, [PaddlePaddle/PaddleOCR-VL-1.5](https://huggingface.co/PaddlePaddle/PaddleOCR-VL-1.5) `1e521608`,\n [PaddlePaddle/PaddleOCR-VL](https://huggingface.co/PaddlePaddle/PaddleOCR-VL) `dae29965`. Notices:\n [`code/tt_paddleocr/licenses/NOTICE.md`](code/tt_paddleocr/licenses/NOTICE.md).\n- This package is a derivative work of PaddleOCR-VL: the inference code is written anew (the image\n pre-processing, chat template, 3-D rotary positions and task presets follow the official code), the networks\n run on the device in tt-nn operations and a custom decoder megakernel, and the weights are loaded unmodified.\n The decoder megakernel, its on-device sampler and the ttnn decoder are adapted from the same author's earlier\n p150 language-model ports (Apache-2.0; the ttnn decoder pattern from tt-metal's Qwen3-TTS demo, Copyright\n Tenstorrent AI ULC, Apache-2.0).\n- The language model inside PaddleOCR-VL is ERNIE-4.5-0.3B (Baidu,\n [baidu/ERNIE-4.5-0.3B-Paddle](https://huggingface.co/baidu/ERNIE-4.5-0.3B-Paddle), Apache-2.0); the official\n `trust_remote_code` files the port follows are Copyright 2025 PaddlePaddle Authors, Apache-2.0.\n- Port, server and scripts (`code/`) and the tt-metal patches in [`patches/`](patches/): Apache-2.0.\n- Samples: `code/tt_paddleocr/samples/` holds synthetic images made for this package (CC0 1.0); provenance in\n their `ATTRIBUTION.md`.\n- Demo images in `media/`: inputs rendered for this demo from text written for it, and this package's answers,\n CC0 1.0 (fonts: DejaVu, Bitstream Vera licence; Noto Sans CJK KR / SC, SIL OFL 1.1); attributions in\n [`media/ATTRIBUTION.md`](media/ATTRIBUTION.md).\n", "related": "- [changh95/DepthPro2](https://huggingface.co/changh95/DepthPro2): Apple Depth Pro 2 metric depth on p150.\n- [changh95/all-MiniLM-L6-v2](https://huggingface.co/changh95/all-MiniLM-L6-v2): sentence embeddings on p150.\n", "license": { "id": "apache-2.0", "name": null, "link": null }, "pipeline_tag": "image-text-to-text", "base_model": [ "PaddlePaddle/PaddleOCR-VL-1.6", "PaddlePaddle/PaddleOCR-VL-1.5", "PaddlePaddle/PaddleOCR-VL" ] } } }