schift-ocr-1-beta / tt_kernel_manifest.json
changh95's picture
tt-model push schift-ocr-1-beta (container)
ca1a504 verified
Raw History Blame Contribute Delete
31.8 kB
{
"schema_version": "5.1",
"name": "schift-ocr-1-beta",
"tt_metal_version": "0.65.2.dev11169+g44d66500520",
"arch": "blackhole",
"device_count": 1,
"producer": {
"tt_kernel_version": "0.1.0",
"created_at": "2026-12-02T19:07:23.975302+00:00",
"hostname": "hchang-bh"
},
"weights": {
"repo_id": "schift-io/schift-ocr-1-beta",
"revision": "8fc26dce9ef6c0307a9067ee39a97ae15ccd1cbf",
"allow_patterns": [
"model-00001-of-00002.safetensors",
"model-00002-of-00002.safetensors",
"model.safetensors.index.json",
"config.json",
"generation_config.json",
"processor_config.json",
"special_tokens_map.json",
"tokenizer.json",
"tokenizer_config.json",
"README.md",
"LICENSE"
],
"ignore_patterns": null,
"repo_type": "model"
},
"auxiliary_weights": [],
"mesh": null,
"entrypoint": null,
"resources": null,
"capabilities": null,
"env": {},
"bundled": null,
"deps": null,
"container": {
"image": {
"registry": "hf",
"repository": "schift-ocr-1-beta",
"tag": "tt-model/schift-ocr-1-beta:0fce23ddd31e",
"digest": "sha256:0fce23ddd31eb20e73355e8e7a5138b6e5b697f1ddef1014c9b8b7a3a228ba0a"
},
"kind": "tt-dit-server",
"runtime": {
"app": "tt_dsocr.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": "8fc26dce9ef6c0307a9067ee39a97ae15ccd1cbf",
"TT_METAL_VISIBLE_DEVICES": "0",
"TT_DEVICE_ID": "0",
"HF_HUB_DISABLE_IMPLICIT_TOKEN": "1",
"DSOCR_VARIANT": "schift-ocr-1-beta",
"DSOCR_BACKEND": "device",
"DSOCR_DISPATCH": "eth",
"DSOCR_MODES": "gundam,base",
"DSOCR_DEFAULT_MODE": "gundam",
"DSOCR_MAX_CROPS": "32",
"DSOCR_MAX_CONTEXT": "32768",
"DSOCR_ENGINE": "vis=ttnn,pre=ttnn,dec=ttnn",
"DSOCR_PRECISION": "",
"DSOCR_K_MAX": "64",
"DSOCR_MAX_NEW_TOKENS": "16384",
"DSOCR_DEFAULT_MAX_NEW_TOKENS": "16384",
"DSOCR_MAX_PROMPT_TOKENS": "512",
"DSOCR_PREFILL_BUCKETS": "",
"DSOCR_TRACE": "1",
"DSOCR_SPARSE_DECODE": "1",
"DSOCR_QUEUE_DEPTH": "8",
"DSOCR_QUEUE_TIMEOUT_S": "600",
"DSOCR_MAX_BODY_MB": "64",
"DSOCR_MAX_INPUT_MEGAPIXELS": "50",
"DSOCR_ALLOW_URLS": "0",
"DSOCR_URL_TIMEOUT_S": "15",
"DSOCR_TORCH_THREADS": "4",
"DSOCR_TRACE_REGION_MB": "1024"
}
},
"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": {
"DSOCR_PRECISION": ""
},
"name": "default",
"description": "the shipped configuration: decoder MLP / expert weights bfp8 (HiFi2)"
},
{
"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": {
"DSOCR_PRECISION": "pre_mlp=bf16,pre_experts=bf16,pre_fid=HiFi4"
},
"name": "bf16",
"description": "decoder MLP / expert weights bf16 (HiFi4): closer free runs on some pages, about 10 % longer time to first token"
}
],
"default_profile": "default",
"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_dsocr.ttaw.device import eth_dispatch_patch_present as p; assert p(), 'the ETH patch is not visible'",
"from tt_dsocr.tt import sdpa_chunks as SC; assert (SC.even_k_chunk(288, 32), SC.even_k_chunk(96, 32), SC.even_k_chunk(640, 128)) == (160, 64, 160) # plain SDPA: even key-chunk counts",
"import sys, tt_dsocr.server.app as a; assert a.app and not [m for m in sys.modules if m.split('.')[0] in ('ttnn', 'torch', 'numpy')], 'the server module must import without ttnn / torch / numpy'",
"from tt_dsocr.server.app import parse_mesh_shape as p; assert p('1x1') == p('(1, 1)') == p('1,1') == (1, 1)",
"from tt_dsocr.server.app import load_config; c = load_config({'DSOCR_VARIANT': 'schift-ocr-1-beta', 'DSOCR_DISPATCH': 'eth', 'TT_MODEL_WEIGHTS_REVISION': '8fc26dce9ef6c0307a9067ee39a97ae15ccd1cbf'}); assert (c.variant, c.backend, c.dispatch, c.revision, c.modes, c.max_crops, c.max_context, c.kv_positions, c.pre_buckets, c.engine['dec'], c.info.window) == ('schift-ocr-1-beta', 'device', 'eth', '8fc26dce9ef6c0307a9067ee39a97ae15ccd1cbf', ('gundam', 'base'), 32, 32768, 4480, (384, 896, 1024, 1536, 2048, 2560, 3072, 3584, 3840, 4096, 4352), 'ttnn', 128), c",
"from tt_dsocr.server.app import load_config as L\nfor bad in ({'DSOCR_VARIANT': 'schift-ocr-1-beta', 'DSOCR_BACKEND': 'gpu'}, {'DSOCR_VARIANT': 'schift-ocr-1-beta', 'DSOCR_LOOP_STEPS': '2'}, {'DSOCR_VARIANT': 'schift-ocr-1-beta', 'DSOCR_ENGINE': 'dec=mk'}, {'DSOCR_VARIANT': 'schift-ocr-1-beta', 'DSOCR_DISPATCH': 'pcie'}, {'DSOCR_VARIANT': 'schift-ocr-1-beta', 'DSOCR_MODES': 'tiny'}, {'DSOCR_VARIANT': 'schift-ocr-1-beta', 'DSOCR_MAX_CROPS': '33'}, {'DSOCR_VARIANT': 'schift-ocr-1-beta', 'DSOCR_MAX_PAGES': '2'}, {'DSOCR_VARIANT': 'schift-ocr-1-beta', 'DSOCR_MAX_CONTEXT': '40000'}, {'DSOCR_VARIANT': 'gpt'}, {'DSOCR_VARIANT': 'schift-ocr-1-beta', 'TT_MESH_SHAPE': '1x2'}):\n try:\n L(bad)\n except RuntimeError:\n continue\n raise AssertionError(bad)",
"from tt_dsocr import config as C; v = C.VARIANTS['schift-ocr-1-beta']; assert (v.weights_repo, v.revision, v.license, v.license_file, v.tasks, v.device, v.dec_engines, v.window, v.crop_max, v.ngram_presets[0], C.TASK_PROMPTS['schift-ocr-1-beta']['parse']) == ('schift-io/schift-ocr-1-beta', '8fc26dce9ef6c0307a9067ee39a97ae15ccd1cbf', 'MIT', 'LICENSE-MIT-schift-ocr-1-beta.txt', ('parse',), True, ('ttnn',), 128, 32, 'off', '<image>document parsing.') and not [f for f in v.weight_files if f.endswith('.py')]",
"from tt_dsocr import config as C; from tt_dsocr.api import DeepSeekOcr, InputError\nS = '/opt/tt-metal/tt_dsocr/samples/'\nm = DeepSeekOcr.from_config(C.resolve_config({'DSOCR_BACKEND': 'fake', 'DSOCR_VARIANT': 'schift-ocr-1-beta'}))\nr = m.ocr(S + 'ko_table/sample.png'); assert (r.task, r.mode, r.output_format, r.finish_reason) == ('parse', 'gundam', 'markdown', 'stop') and r.image['grid'] == [3, 2] and r.image['image_tokens'] == 893, r\nr = m.ocr(S + 'ko_table/sample.png', output_format='json'); assert isinstance(r.json, dict) and 'refs' in r.json, r\ns = m.ocr_stream(S + 'ko_table/sample.png'); assert ''.join(s) == s.result.raw_text\nfor kw in ({'task': 'markdown'}, {'mode': 'tiny'}, {'ngram_preset': 'sglang'}, {'max_crops': 33}):\n try:\n m.prepare(S + 'ko_table/sample.png', **kw)\n except InputError:\n continue\n raise AssertionError(kw)",
"import tokenizers, PIL, safetensors, huggingface_hub; assert (tokenizers.__version__, PIL.__version__, safetensors.__version__, huggingface_hub.__version__) == ('0.22.2', '12.3.0', '0.8.0', '1.16.1')",
"import sys; from tt_dsocr.tt.model import DsocrDevice as D, DeviceConfig; miss = [n for n in ('generate', 'timings', 'room', 'close', 'prompt_rows') if not callable(getattr(D, n, None))]; assert not miss, miss; from tt_dsocr import config as C; d = C.resolve_config({'DSOCR_VARIANT': 'schift-ocr-1-beta'}).device_config(); assert (d.variant, d.engine_dec, d.max_crops, d.max_context, d.window, d.max_positions, tuple(d.prefill_buckets)[-1]) == ('schift-ocr-1-beta', 'ttnn', 32, 4480, 128, 32768, 4352), d; assert 'ttnn' not in sys.modules",
"from pathlib import Path; t = Path('/opt/tt-metal/tt_dsocr'); assert all((t / f).is_file() for f in ('tt/model.py', 'tt/ttnn_vision.py', 'tt/ttnn_decoder.py', 'tt/vision_consts.py', 'tt/sdpa_chunks.py', 'tt/trace_safety.py', 'reference/model.py'))",
"import hashlib, json; from pathlib import Path\nfor n in ('ko_table', 'ko_notice'):\n d = Path('/opt/tt-metal/tt_dsocr/samples', n); m = json.loads((d / 'sample.json').read_text()); assert hashlib.sha256((d / m['file']).read_bytes()).hexdigest() == m['sha256'] and (d / 'PROVENANCE.md').is_file() and m['only'] == ['schift-ocr-1-beta'] and m['task'] == 'parse' and m['expected_text'].startswith('<|det|>')",
"from pathlib import Path; d = Path('/opt/tt-metal/tt_dsocr/licenses'); t = (d / 'LICENSE-MIT-schift-ocr-1-beta.txt').read_text(); assert t.startswith('MIT License') and 'Copyright (c) 2026 Baidu' in t and 'Apache License' in (d / 'LICENSE-APACHE-2.0.txt').read_text() and 'schift-ocr-1-beta' in (d / 'NOTICE.md').read_text()",
"from pathlib import Path; assert all(Path('/opt/tt-metal', p).is_file() for p in ('tt_dsocr/server/smoke_test.py', 'tt_dsocr/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', 'argmax', 'embedding', 'conv2d', 'layer_norm', 'rms_norm', 'linear', 'matmul', 'softmax')) and all(hasattr(ttnn.experimental, a) for a in ('rotary_embedding_hf', 'paged_fused_update_cache', 'nlp_create_qkv_heads_decode', 'nlp_create_qkv_heads', 'nlp_concat_heads')) and all(hasattr(ttnn.transformer, a) for a in ('scaled_dot_product_attention', 'scaled_dot_product_attention_decode')) and hasattr(ttnn, 'SDPAProgramConfig')"
],
"built": {
"image": "tt-model/schift-ocr-1-beta:0fce23ddd31e",
"repo": "changh95/schift-ocr-1-beta",
"tt_model_version": "0.1.0",
"created_at": "2026-12-02T18:37:09+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": "a332344c515e51b2acd58be6891d0f2d6edb482b77324f2dc3ff331e67084252",
"image_digest": "sha256:0fce23ddd31eb20e73355e8e7a5138b6e5b697f1ddef1014c9b8b7a3a228ba0a"
},
"card": {
"description": "schift-ocr-1-beta reads a Korean document page and writes it in reading order as layout blocks: each block is a label (title, text, table, footer, image, ...) with a box in 0-1000 page coordinates, followed by its content, tables as HTML (merged cells as rowspan / colspan). It is Schift's fine-tune of Baidu's Unlimited-OCR (the first version) on Korean forms, slides and reports (beta, open weights). The page is encoded by DeepSeek-OCR's vision encoder, DeepEncoder (SAM-ViT-B followed by CLIP-L, 16x token compression), into 273 image tokens for a 1024 x 1024 global view plus about 100 per 640 x 640 tile (up to 32 tiles); the tokens enter a DeepSeek-V2-style decoder of 12 layers with 72 routed experts (the base model's 64 plus 8 added) and 2 shared experts per layer, 6 experts per token, about 3.6B parameters. While writing, each token attends to the whole image and prompt plus the last 128 generated tokens only, so the memory does not grow with the output (up to 16384 tokens). The package includes the official input building (views, tiling, the prompt), greedy decoding as the model card runs it, and Markdown / JSON readings of the blocks. The vision encoder, the prefill and the decoder run on the device as traced tt-nn graphs; image decoding and tiling run on the host CPU.",
"attribution": "Derived from Schift's [schift-ocr-1-beta](https://huggingface.co/schift-io/schift-ocr-1-beta), a Korean document OCR fine-tune of Baidu's [Unlimited-OCR](https://huggingface.co/baidu/Unlimited-OCR), with unmodified weights downloaded from the authors' repository. Schift describes it as a beta release of open weights (a better version is served only through the Schift API). The model builds on DeepSeek's [DeepSeek-OCR](https://huggingface.co/deepseek-ai/DeepSeek-OCR). This is a third-party port, not affiliated with or endorsed by Schift, Baidu or DeepSeek. See the original model card for training details and results.",
"prerequisites": "- About 7.3 GB of free disk for the checkpoint (fetched once into the Hugging Face cache), plus the container image\n and about 2.8 GB for the compiled kernels in the container's persistent cache\n- Time for the first start: about 17 minutes from an empty cache (16 min 47 s measured; up to about 32 minutes on\n a heavily loaded host): it compiles the device kernels for up to 32 tiles and 11 prompt-length buckets. Later\n starts reuse the kernel cache and take about 2 minutes. The `bf16` serve profile compiles its own decoder\n kernels on its first start (a few minutes more)\n- Page images as PNG, JPEG, WebP, BMP, TIFF or GIF (the first frame); PDF pages must be rendered to images first\n",
"quickstart": "On the port `tt serve` reported:\n\n```bash\ncurl -sLO https://huggingface.co/changh95/schift-ocr-1-beta/resolve/main/code/tt_dsocr/samples/ko_table/sample.png\ncurl -s localhost:20000/ocr -F file=@sample.png -F format=raw # the model's own output (det blocks)\n# {\"model\": \"schift-ocr-1-beta\", \"text\": \"<|det|>title [54, 75, 428, 127]<|/det|>2026년 3분기 지역별 판매 실적\\n...\", ...}\ncurl -s localhost:20000/ocr -F file=@sample.png # Markdown (the default format)\ncurl -s localhost:20000/ocr -F file=@sample.png -F format=json # blocks: label, box in pixels, text\ncurl -sN localhost:20000/ocr -F file=@sample.png -F stream=true # SSE text deltas\n```\n",
"architecture": null,
"status": null,
"intended_use": "Korean document parsing on one Tenstorrent p150, one page per request: printed forms, tables, lecture slides and reports converted to text in reading order with layout boxes and HTML tables; for research, prototyping and offline processing. This is a beta model (see Limitations).",
"out_of_scope_use": null,
"usage": "`POST /v1/chat/completions` is OpenAI-compatible: the page goes in an `image_url` part as a data URL (base64), the\nprompt in a text part (empty = `<image>document parsing.`, the model card's prompt; `<image>` is placed in front,\nwithout a newline, when the text has none, so `document parsing.` is that prompt too); `stream`, `max_tokens`, `temperature`, `top_p`, `seed` and\n`stream_options.include_usage` work as in the OpenAI API, and the OpenAI Python client works against it. The\nanswer is the model's raw output, block tags included:\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(\"page.png\", \"rb\").read()).decode()\nr = client.chat.completions.create(model=\"schift-ocr-1-beta\", messages=[{\"role\": \"user\", \"content\": [\n {\"type\": \"image_url\", \"image_url\": {\"url\": url}}, {\"type\": \"text\", \"text\": \"<image>document parsing.\"}]}])\nprint(r.choices[0].message.content) # <|det|>title [132, 68, 310, 86]<|/det|>...\n```\n\n`POST /ocr` is the native route: multipart (`file` + fields), JSON (`{\"image\": base64 or data URL, ...}`) or the\nraw image as the body (`Content-Type: image/png`, fields as query parameters):\n\n| request field | default | meaning |\n| --- | --- | --- |\n| `file` / `image` | required | the page image (one per request) |\n| `task` | `parse` | `parse`: the prompt `<image>document parsing.` (the only prompt the model card documents) |\n| `prompt` | the task's | another instruction (`<image>` is placed in front, without a newline, when it has none); untested by the authors |\n| `mode` | `gundam` | `gundam` (1024 global view + 2 .. 32 tiles of 640: the model card's setting), `base` (one 1024 x 1024 view, 273 image tokens); those enabled by `DSOCR_MODES` |\n| `min_crops`, `max_crops` | 2, 32 | Gundam tile grid limits (1 <= min <= max <= `DSOCR_MAX_CROPS`); pages up to 640 x 640 get no tiles |\n| `format` | `markdown` | `raw` (the model's output with its `<\\|det\\|>` tags), `markdown` (the block contents without the tags, image blocks as `![](images/<i>.jpg)` placeholders: the official rule), `json` (`{\"text\", \"refs\": [{\"label\", \"boxes\" (pixels), \"boxes_norm\"}], \"blocks\": [{\"label\", \"boxes\", \"boxes_norm\", \"text\"}]}`) |\n| `max_new_tokens` | 16384 | 1 .. `DSOCR_MAX_NEW_TOKENS` |\n| `no_repeat_ngram_size`, `ngram_window`, `ngram_whitelist`, `ngram_preset` | `off` | no n-gram rule (the model card's setting); `hf` / `vllm` presets or explicit fields set one |\n| `temperature`, `top_k`, `top_p`, `repetition_penalty`, `seed` | 0, 0, 1, 1.0, random | 0 = greedy, the model card's decoding; `top_k` <= 64 |\n| `stream` | false | Server-Sent Events: `{\"type\": \"delta\", \"text\"}` as tokens are decoded, then `{\"type\": \"done\", ...}` |\n\n- The answer: `text` (in `format`), `raw_text`, `refs` (every block with a box: label, boxes in pixels of the\n input image and the 0..999 values the model wrote), `json`, `finish_reason` (`stop` | `length`), `usage`\n (`prompt_tokens`, `image_tokens`, `completion_tokens`), `image` (size, mode, tile grid, image tokens) and\n `timings` (preprocessing, vision, prefill, first token, decode tokens per second).\n- `GET /health` reports readiness, `GET /info` the weights and their commit, the device, the engines, the\n configuration, the modes and their image-token counts and the timings of the last request; `GET /v1/models`\n lists the model.\n- The chat route reads the last user message only (one image part and its text parts); `temperature` defaults to\n 0, not OpenAI's 1; it also takes `task`, `mode`, `min_crops`, `max_crops`, `top_k`, `repetition_penalty` and the\n n-gram fields. `n` other than 1, `stop`, `logprobs`, `tools`, presence / frequency penalties and JSON response\n formats are refused with 400. Image URLs (http / https) are fetched only when `DSOCR_ALLOW_URLS=1`.\n- Errors: 400 with the reason (also a prompt with an unpaired surrogate, or a second image), 413 body or image too\n large, 415 content type, 422 malformed body, 429 queue full (`Retry-After`), 503 while starting or after\n `DSOCR_QUEUE_TIMEOUT_S`, 500 on a device failure.\n- A Python API with the same parameters (`tt_dsocr.api.DeepSeekOcr`) is described in\n [`code/PYTHON.md`](code/PYTHON.md); it needs a tt-metal build with the patches in [`patches/`](patches/).\n\n### Configuration\n\nThe server builds its device programs for one configuration when it starts. A serve profile selects a prepared\nconfiguration (`tt serve changh95/schift-ocr-1-beta --profile bf16`); the other values are environment variables\nof the container's launch command (`tt-model serve --print` prints it). Change them and start it again; `GET /info`\nreports the configuration.\n\n| item | environment variable | values | default |\n| --- | --- | --- | --- |\n| resolution modes a request may use | `DSOCR_MODES`, `DSOCR_DEFAULT_MODE` | any of `gundam,base` (one vision trace per view size) | both, `gundam` |\n| Gundam tiles per page | `DSOCR_MAX_CROPS` | 2 .. 32 (fewer tiles: smaller prefill buckets, a shorter start) | 32 |\n| positions (prompt + output) | `DSOCR_MAX_CONTEXT` | 1024 .. 32768 (the KV cache holds the prompt + 128 generated tokens whatever this is) | 32768 |\n| largest / default `max_new_tokens` | `DSOCR_MAX_NEW_TOKENS`, `DSOCR_DEFAULT_MAX_NEW_TOKENS` | 16 .. 16384 | 16384, 16384 |\n| longest prompt text | `DSOCR_MAX_PROMPT_TOKENS` | 16 .. 4096 | 512 |\n| prefill buckets | `DSOCR_PREFILL_BUCKETS` | comma-separated multiples of 32 rows (one trace each) | derived from the modes and tiles (384 .. 4352, 11 buckets) |\n| device engines | `DSOCR_ENGINE` | `vis=ttnn,pre=ttnn,dec=ttnn` | `vis=ttnn,pre=ttnn,dec=ttnn` |\n| decode MoE | `DSOCR_SPARSE_DECODE` | 1 = the 6 routed experts' rows gathered per token, 0 = all 72 experts masked | 1 |\n| weight formats | `DSOCR_PRECISION` | `vis` = `bf16` / `bfp8`; `pre_mlp`, `pre_experts` = `bf16` / `bfp8` / `bfp4`; `vis_fid`, `pre_fid` = `HiFi4` / `HiFi2` / `LoFi` | `\"\"` = vision bf16 HiFi4, decoder MLP / experts bfp8 HiFi2; the serve profile `bf16`: `pre_mlp=bf16,pre_experts=bf16,pre_fid=HiFi4` |\n| largest `top_k` | `DSOCR_K_MAX` | 1 .. 64 | 64 |\n| queue | `DSOCR_QUEUE_DEPTH`, `DSOCR_QUEUE_TIMEOUT_S` | waiting requests, seconds | 8, 600 |\n| uploads | `DSOCR_MAX_BODY_MB`, `DSOCR_MAX_INPUT_MEGAPIXELS`, `DSOCR_ALLOW_URLS` | MB per request, megapixels, 0 / 1 | 64, 50, 0 |\n\n### Example output\n\n![schift-ocr-1-beta on a Tenstorrent p150: a Korean bank form (left, with the returned layout boxes) and the\nparsed blocks (right)](media/demo_ko_form.png)\n\nA Korean bank deposit form written and rendered for this card (every name and number invented), parsed by this\npackage's container on one p150 with the default request (`task=parse`, Gundam, greedy): left, the page with the\nboxes of the blocks as returned (pixels) and their labels; right, the returned blocks in reading order, the HTML\ntables drawn as grids. The timings are in the image's footer; the exact request and the whole answer are in\n[`media/demos.json`](media/demos.json). Attributions for every file in `media/`:\n[`media/ATTRIBUTION.md`](media/ATTRIBUTION.md).\n",
"performance": "Measured on the p150 (ETH dispatch, 120 cores) against Schift's own float32 model on the CPU (its remote code,\ntransformers 4.52.1, the official `infer` input building, same weights and prompt, greedy, no n-gram rule, the\n128-token window) on five Korean pages rendered for this package: a bank form with three tables, a sales table\nwith merged header cells, a lecture slide, an A4 report page and a short notice (Gundam mode, 0 to 28 tiles), and\nby an independent verifier on 8 new Korean pages written for that check (a receipt, a quotation, a degraded JPEG\nscan, a form, a slide, a merged-cell table, a 300-dpi report, a 32-tile page; other fonts; 0 to 32 tiles).\n\n| eval | this package | pages |\n| --- | --- | --- |\n| Prompt ids, tile grids and image views vs the official `infer` | identical | 5 + 8 |\n| Image embeddings PCC vs float32 | 0.9970 - 0.9996 (new pages 0.9957 - 0.9997) | 5 + 8 |\n| Blocks: count, order and labels vs float32 | identical on the 5 pages; new pages: identical on 5 of 8 | 5 + 8 |\n| Recognised text (block tags removed) vs float32 | identical on 4 of 5 (the report page has one extra space, character error rate 0.0021); new pages: identical on 4 of 8, a fifth differs in one character, which this package reads correctly | 5 + 8 |\n| Layout boxes vs float32 | within 3 units on the 0 - 1000 scale where the blocks agree | 5 + 8 |\n| Divergent readings | on 3 of the 8 new pages an early layout decision where float32 itself is near a tie (margin below 0.1) leads to a different reading: a totals block read as a table, two closing labels `text` instead of `footer`, and on the 32-tile page a longer reading than float32's (it also reads the last section and the table) | 8 |\n| Teacher-forced next-token agreement vs float32 | 98.5 - 99.9 % per page along this package's own tokens, end of output always agreeing (new pages); 98.95 % over 7,988 steps along float32's tokens (the 5 + 8 pages) | 5 + 8 |\n| Outputs longer than the 128-token window | 488 and 530 tokens: same text as float32; 2,782 tokens on the 32-tile page; 16,384 tokens (the maximum) on a looping page, the first 3,000 identical to float32 | 2 + 2 |\n\n| speed (batch 1, warm) | input | measured |\n| --- | --- | --- |\n| Time to first token | a page with 0 / 6 / 28 tiles | 0.23 / 0.61 - 0.87 / 2.14 s |\n| Decoder (tt-nn; host-bound) | 146 - 530 output tokens, quiet host | 71 - 76 tokens/s |\n| Whole page | the bank form (6 tiles, 530 tokens) / the slide (28 tiles, 211 tokens) | 7.5 s / 5.0 s |\n| Server start (`tt serve` until ready, in the container) | first start with empty caches / restart | 16 min 47 s / 1 min 51 s (an independent verifier, host load about 10); 31 min 44 s on a heavily loaded host |\n\nThe decoder runs on tt-nn operations; this package family's decode megakernel is not available for this model\n(see Limitations). The tt-nn decoder issues every step from the host CPU, so a busy host slows it: 32-50\ntokens/s at a host load average of about 22, 76-82 in a 12-minute soak on a quieter host. Sampling\n(`temperature` > 0) decodes more slowly than greedy (49-51 against 80 tokens/s on a quiet host).\n\nDecoder weight precision: the default keeps the decoder's MLP and expert weights in bfp8. The serve profile `bf16`\n(bf16 weights, HiFi4) was compared with it on the same 13 pages: teacher-forced agreement with float32 98.95 %\n(bfp8) against 99.02 % (bf16); free runs identical to float32 on 2 of 6 pages with bf16 against 0 of 6 with\nbfp8; time to first token about 10 % longer (prefill about 20 % slower), decode about 5 % slower, 2.7 GB more\ndevice memory (14.6 of 33 GB).\n",
"limitations": "- A beta model: Schift releases these weights as a beta and serves a better version only through its API. Its\n model card notes that very long pages can end in repeated text, and that large tables with many merged cells\n can come out with rows of the wrong cell count.\n- A page that makes the model loop (rows of repeated text; the official float32 model loops on them too) runs to\n `max_tokens` / `max_new_tokens`, by default the maximum 16,384 tokens: one such request held the server for\n about 3.5 minutes on a quiet host (longer under load) while later requests waited in the queue. Send a lower\n `max_tokens` (chat) or `max_new_tokens` (`/ocr`) when pages may loop; an answer cut there ends with\n `finish_reason: length`.\n- Not for decisions that need exact text without a human check (legal, medical, financial or identity\n documents): OCR output can miss, misread or invent characters, on the CPU and the p150 alike.\n- One page per request, single-turn prompts, batch 1: requests are served one at a time in arrival order\n (`DSOCR_QUEUE_DEPTH` may wait). No PDF input; documents are read page by page.\n- The model is trained on Korean documents with the prompt `<image>document parsing.`; other prompts and other\n languages are untested.\n- The `markdown` format follows the official post-processing (block tags removed, image blocks as placeholders,\n no crops written); `raw` is the model's output unchanged.\n- Sampling (`temperature` > 0) draws from at most the 64 most likely tokens (`DSOCR_K_MAX`); greedy decoding, the\n model card's setting, is the reference behaviour.\n- The decoder runs on tt-nn operations only: this package family's decode megakernel (3-4x faster on\n DeepSeek-OCR, where it is an experimental opt-in) has no port to this model's 72 experts and 128-token window,\n so it is not available here (`DSOCR_ENGINE=dec=mk` is refused).\n- Rare large single-token deviations, seen on the longest prompts (28-32 tiles): 3 of 7,988 teacher-forced steps\n (along float32's tokens, 13 pages) pick another token where float32 is confident (by more than 3 logits); in a\n free run this shows, for example, as one garbled word (`okal` for `높`) in the 2,782-token output of a 32-tile\n page. They are deterministic and isolated (the following steps agree again) and come from the bfp8 decoder\n weights: the `bf16` serve profile removes these, but shows other deviations of the same kind at a similar rate\n (5 of 7,988 steps), so it is offered as an option, not as the default.\n- The prefill buckets of 3840, 4096 and 4352 rows serve a 32-tile page with a prompt text longer than about 280\n tokens; with the trained prompt no page needs them. They are compiled and captured at every start but were not\n checked against float32.\n- One p150 only: device dispatch runs on the chip's Ethernet cores, so multi-chip meshes are not supported.\n",
"risks": null,
"licensing": "- Weights (not redistributed here; `tt serve` downloads them from the authors' repository at this commit):\n [schift-io/schift-ocr-1-beta](https://huggingface.co/schift-io/schift-ocr-1-beta) `8fc26dce`, MIT (declared in\n its model card, \"inherited from baidu/Unlimited-OCR\"; the repository carries the base model's MIT License,\n \"Copyright (c) 2026 Baidu\":\n [`code/tt_dsocr/licenses/LICENSE-MIT-schift-ocr-1-beta.txt`](code/tt_dsocr/licenses/LICENSE-MIT-schift-ocr-1-beta.txt)).\n The model is Schift's fine-tune of Baidu's [Unlimited-OCR](https://huggingface.co/baidu/Unlimited-OCR) (MIT).\n Notices: [`code/tt_dsocr/licenses/NOTICE.md`](code/tt_dsocr/licenses/NOTICE.md).\n- This package is a derivative work of schift-ocr-1-beta: the inference code is written anew (image views,\n tiling and the prompt follow the official `infer`; the generation window follows the official\n `SlidingWindowLlamaAttention`, read but never run in the package), the networks run on the device in tt-nn\n operations, and the weights are loaded unmodified. The official Python files are never downloaded, and the\n authors' code is never executed. The HTTP server and the Python API are adapted from the same author's\n [changh95/GLM-OCR](https://huggingface.co/changh95/GLM-OCR) port (Apache-2.0), whose server worker comes from\n the same author's Qwen3-ASR / Qwen3-TTS ports. Related packages by the same author:\n [changh95/Unlimited-OCR-2](https://huggingface.co/changh95/Unlimited-OCR-2) (the second version of this model's\n base model, from the same code),\n [changh95/DeepSeek-OCR](https://huggingface.co/changh95/DeepSeek-OCR),\n [changh95/DeepSeek-OCR-2](https://huggingface.co/changh95/DeepSeek-OCR-2),\n [changh95/GLM-OCR](https://huggingface.co/changh95/GLM-OCR),\n [changh95/PaddleOCR-VL](https://huggingface.co/changh95/PaddleOCR-VL),\n [changh95/DepthPro2](https://huggingface.co/changh95/DepthPro2),\n [changh95/all-MiniLM-L6-v2](https://huggingface.co/changh95/all-MiniLM-L6-v2).\n- Port, server and scripts (`code/`) and the tt-metal patches in [`patches/`](patches/): Apache-2.0.\n- Samples: `code/tt_dsocr/samples/*/sample.png`, synthetic images made for these packages (Apache-2.0); provenance\n in their `PROVENANCE.md`. The demo files in `media/`: see [`media/ATTRIBUTION.md`](media/ATTRIBUTION.md).\n",
"related": null,
"license": {
"id": "apache-2.0",
"name": null,
"link": null
},
"pipeline_tag": "image-text-to-text",
"base_model": [
"schift-io/schift-ocr-1-beta"
]
}
}
}