schift-ocr-1-beta on Tenstorrent p150
Derived from Schift's schift-ocr-1-beta, a Korean document OCR fine-tune of Baidu's 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. 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.
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.
Runs on Tenstorrent p150 β see the serving profiles below.
Packaged and published with tt-model-manager 0.1.0 (manifest schema 5.1).
At a glance
| Hardware | p150 |
| License | apache-2.0 |
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).
Prerequisites
- The Tenstorrent CLI,
tt:uv tool install tenstorrent(or use tt-model alone, see the Quickstart) - Docker
- Tenstorrent hardware: p150
- About 7.3 GB of free disk for the checkpoint (fetched once into the Hugging Face cache), plus the container image and about 2.8 GB for the compiled kernels in the container's persistent cache
- Time for the first start: about 17 minutes from an empty cache (16 min 47 s measured; up to about 32 minutes on
a heavily loaded host): it compiles the device kernels for up to 32 tiles and 11 prompt-length buckets. Later
starts reuse the kernel cache and take about 2 minutes. The
bf16serve profile compiles its own decoder kernels on its first start (a few minutes more) - Page images as PNG, JPEG, WebP, BMP, TIFF or GIF (the first frame); PDF pages must be rendered to images first
Quickstart
tt serve changh95/schift-ocr-1-beta
tt serve downloads the Docker image and the schift-io/schift-ocr-1-beta at 8fc26dce9ef6c0307a9067ee39a97ae15ccd1cbf weights (into your HF cache; they are not in the image), then starts the model's own HTTP server on port 20000 (or the next free port, if that one is busy). The first start compiles kernels for your device, which takes several minutes; the server is ready when it logs Application startup complete.
Without tt-cli: tt-model serve changh95/schift-ocr-1-beta.
On the port tt serve reported:
curl -sLO https://huggingface.co/changh95/schift-ocr-1-beta/resolve/main/code/tt_dsocr/samples/ko_table/sample.png
curl -s localhost:20000/ocr -F file=@sample.png -F format=raw # the model's own output (det blocks)
# {"model": "schift-ocr-1-beta", "text": "<|det|>title [54, 75, 428, 127]<|/det|>2026λ
3λΆκΈ° μ§μλ³ νλ§€ μ€μ \n...", ...}
curl -s localhost:20000/ocr -F file=@sample.png # Markdown (the default format)
curl -s localhost:20000/ocr -F file=@sample.png -F format=json # blocks: label, box in pixels, text
curl -sN localhost:20000/ocr -F file=@sample.png -F stream=true # SSE text deltas
Serving profiles
Select a different serving profile using --profile.
| profile | hardware | mesh | description |
|---|---|---|---|
default (default) |
p150 | P150 | the shipped configuration: decoder MLP / expert weights bfp8 (HiFi2) |
bf16 |
p150 | P150 | decoder MLP / expert weights bf16 (HiFi4): closer free runs on some pages, about 10 % longer time to first token |
Capabilities
This package exposes the model's own HTTP server on port 20000, not an OpenAI-compatible chat API β its request and response shapes are the model's own. See the author's notes for the payload it expects.
POST /v1/chat/completions is OpenAI-compatible: the page goes in an image_url part as a data URL (base64), the
prompt in a text part (empty = <image>document parsing., the model card's prompt; <image> is placed in front,
without a newline, when the text has none, so document parsing. is that prompt too); stream, max_tokens, temperature, top_p, seed and
stream_options.include_usage work as in the OpenAI API, and the OpenAI Python client works against it. The
answer is the model's raw output, block tags included:
import base64
from openai import OpenAI
client = OpenAI(base_url="http://localhost:20000/v1", api_key="unused")
url = "data:image/png;base64," + base64.b64encode(open("page.png", "rb").read()).decode()
r = client.chat.completions.create(model="schift-ocr-1-beta", messages=[{"role": "user", "content": [
{"type": "image_url", "image_url": {"url": url}}, {"type": "text", "text": "<image>document parsing."}]}])
print(r.choices[0].message.content) # <|det|>title [132, 68, 310, 86]<|/det|>...
POST /ocr is the native route: multipart (file + fields), JSON ({"image": base64 or data URL, ...}) or the
raw image as the body (Content-Type: image/png, fields as query parameters):
| request field | default | meaning |
|---|---|---|
file / image |
required | the page image (one per request) |
task |
parse |
parse: the prompt <image>document parsing. (the only prompt the model card documents) |
prompt |
the task's | another instruction (<image> is placed in front, without a newline, when it has none); untested by the authors |
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 |
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 |
format |
markdown |
raw (the model's output with its <|det|> tags), markdown (the block contents without the tags, image blocks as  placeholders: the official rule), json ({"text", "refs": [{"label", "boxes" (pixels), "boxes_norm"}], "blocks": [{"label", "boxes", "boxes_norm", "text"}]}) |
max_new_tokens |
16384 | 1 .. DSOCR_MAX_NEW_TOKENS |
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 |
temperature, top_k, top_p, repetition_penalty, seed |
0, 0, 1, 1.0, random | 0 = greedy, the model card's decoding; top_k <= 64 |
stream |
false | Server-Sent Events: {"type": "delta", "text"} as tokens are decoded, then {"type": "done", ...} |
- The answer:
text(informat),raw_text,refs(every block with a box: label, boxes in pixels of the input image and the 0..999 values the model wrote),json,finish_reason(stop|length),usage(prompt_tokens,image_tokens,completion_tokens),image(size, mode, tile grid, image tokens) andtimings(preprocessing, vision, prefill, first token, decode tokens per second). GET /healthreports readiness,GET /infothe weights and their commit, the device, the engines, the configuration, the modes and their image-token counts and the timings of the last request;GET /v1/modelslists the model.- The chat route reads the last user message only (one image part and its text parts);
temperaturedefaults to 0, not OpenAI's 1; it also takestask,mode,min_crops,max_crops,top_k,repetition_penaltyand the n-gram fields.nother than 1,stop,logprobs,tools, presence / frequency penalties and JSON response formats are refused with 400. Image URLs (http / https) are fetched only whenDSOCR_ALLOW_URLS=1. - Errors: 400 with the reason (also a prompt with an unpaired surrogate, or a second image), 413 body or image too
large, 415 content type, 422 malformed body, 429 queue full (
Retry-After), 503 while starting or afterDSOCR_QUEUE_TIMEOUT_S, 500 on a device failure. - A Python API with the same parameters (
tt_dsocr.api.DeepSeekOcr) is described incode/PYTHON.md; it needs a tt-metal build with the patches inpatches/.
Configuration
The server builds its device programs for one configuration when it starts. A serve profile selects a prepared
configuration (tt serve changh95/schift-ocr-1-beta --profile bf16); the other values are environment variables
of the container's launch command (tt-model serve --print prints it). Change them and start it again; GET /info
reports the configuration.
| item | environment variable | values | default |
|---|---|---|---|
| resolution modes a request may use | DSOCR_MODES, DSOCR_DEFAULT_MODE |
any of gundam,base (one vision trace per view size) |
both, gundam |
| Gundam tiles per page | DSOCR_MAX_CROPS |
2 .. 32 (fewer tiles: smaller prefill buckets, a shorter start) | 32 |
| positions (prompt + output) | DSOCR_MAX_CONTEXT |
1024 .. 32768 (the KV cache holds the prompt + 128 generated tokens whatever this is) | 32768 |
largest / default max_new_tokens |
DSOCR_MAX_NEW_TOKENS, DSOCR_DEFAULT_MAX_NEW_TOKENS |
16 .. 16384 | 16384, 16384 |
| longest prompt text | DSOCR_MAX_PROMPT_TOKENS |
16 .. 4096 | 512 |
| prefill buckets | DSOCR_PREFILL_BUCKETS |
comma-separated multiples of 32 rows (one trace each) | derived from the modes and tiles (384 .. 4352, 11 buckets) |
| device engines | DSOCR_ENGINE |
vis=ttnn,pre=ttnn,dec=ttnn |
vis=ttnn,pre=ttnn,dec=ttnn |
| decode MoE | DSOCR_SPARSE_DECODE |
1 = the 6 routed experts' rows gathered per token, 0 = all 72 experts masked | 1 |
| 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 |
largest top_k |
DSOCR_K_MAX |
1 .. 64 | 64 |
| queue | DSOCR_QUEUE_DEPTH, DSOCR_QUEUE_TIMEOUT_S |
waiting requests, seconds | 8, 600 |
| uploads | DSOCR_MAX_BODY_MB, DSOCR_MAX_INPUT_MEGAPIXELS, DSOCR_ALLOW_URLS |
MB per request, megapixels, 0 / 1 | 64, 50, 0 |
Example output
A Korean bank deposit form written and rendered for this card (every name and number invented), parsed by this
package's container on one p150 with the default request (task=parse, Gundam, greedy): left, the page with the
boxes of the blocks as returned (pixels) and their labels; right, the returned blocks in reading order, the HTML
tables drawn as grids. The timings are in the image's footer; the exact request and the whole answer are in
media/demos.json. Attributions for every file in media/:
media/ATTRIBUTION.md.
Expected performance
Measured on the p150 (ETH dispatch, 120 cores) against Schift's own float32 model on the CPU (its remote code,
transformers 4.52.1, the official infer input building, same weights and prompt, greedy, no n-gram rule, the
128-token window) on five Korean pages rendered for this package: a bank form with three tables, a sales table
with merged header cells, a lecture slide, an A4 report page and a short notice (Gundam mode, 0 to 28 tiles), and
by an independent verifier on 8 new Korean pages written for that check (a receipt, a quotation, a degraded JPEG
scan, a form, a slide, a merged-cell table, a 300-dpi report, a 32-tile page; other fonts; 0 to 32 tiles).
| eval | this package | pages |
|---|---|---|
Prompt ids, tile grids and image views vs the official infer |
identical | 5 + 8 |
| Image embeddings PCC vs float32 | 0.9970 - 0.9996 (new pages 0.9957 - 0.9997) | 5 + 8 |
| Blocks: count, order and labels vs float32 | identical on the 5 pages; new pages: identical on 5 of 8 | 5 + 8 |
| 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 |
| Layout boxes vs float32 | within 3 units on the 0 - 1000 scale where the blocks agree | 5 + 8 |
| 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 |
| 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 |
| 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 |
| speed (batch 1, warm) | input | measured |
|---|---|---|
| Time to first token | a page with 0 / 6 / 28 tiles | 0.23 / 0.61 - 0.87 / 2.14 s |
| Decoder (tt-nn; host-bound) | 146 - 530 output tokens, quiet host | 71 - 76 tokens/s |
| Whole page | the bank form (6 tiles, 530 tokens) / the slide (28 tiles, 211 tokens) | 7.5 s / 5.0 s |
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 |
The decoder runs on tt-nn operations; this package family's decode megakernel is not available for this model
(see Limitations). The tt-nn decoder issues every step from the host CPU, so a busy host slows it: 32-50
tokens/s at a host load average of about 22, 76-82 in a 12-minute soak on a quieter host. Sampling
(temperature > 0) decodes more slowly than greedy (49-51 against 80 tokens/s on a quiet host).
Decoder weight precision: the default keeps the decoder's MLP and expert weights in bfp8. The serve profile bf16
(bf16 weights, HiFi4) was compared with it on the same 13 pages: teacher-forced agreement with float32 98.95 %
(bfp8) against 99.02 % (bf16); free runs identical to float32 on 2 of 6 pages with bf16 against 0 of 6 with
bfp8; time to first token about 10 % longer (prefill about 20 % slower), decode about 5 % slower, 2.7 GB more
device memory (14.6 of 33 GB).
Limitations
- A beta model: Schift releases these weights as a beta and serves a better version only through its API. Its model card notes that very long pages can end in repeated text, and that large tables with many merged cells can come out with rows of the wrong cell count.
- A page that makes the model loop (rows of repeated text; the official float32 model loops on them too) runs to
max_tokens/max_new_tokens, by default the maximum 16,384 tokens: one such request held the server for about 3.5 minutes on a quiet host (longer under load) while later requests waited in the queue. Send a lowermax_tokens(chat) ormax_new_tokens(/ocr) when pages may loop; an answer cut there ends withfinish_reason: length. - Not for decisions that need exact text without a human check (legal, medical, financial or identity documents): OCR output can miss, misread or invent characters, on the CPU and the p150 alike.
- One page per request, single-turn prompts, batch 1: requests are served one at a time in arrival order
(
DSOCR_QUEUE_DEPTHmay wait). No PDF input; documents are read page by page. - The model is trained on Korean documents with the prompt
<image>document parsing.; other prompts and other languages are untested. - The
markdownformat follows the official post-processing (block tags removed, image blocks as placeholders, no crops written);rawis the model's output unchanged. - Sampling (
temperature> 0) draws from at most the 64 most likely tokens (DSOCR_K_MAX); greedy decoding, the model card's setting, is the reference behaviour. - The decoder runs on tt-nn operations only: this package family's decode megakernel (3-4x faster on
DeepSeek-OCR, where it is an experimental opt-in) has no port to this model's 72 experts and 128-token window,
so it is not available here (
DSOCR_ENGINE=dec=mkis refused). - Rare large single-token deviations, seen on the longest prompts (28-32 tiles): 3 of 7,988 teacher-forced steps
(along float32's tokens, 13 pages) pick another token where float32 is confident (by more than 3 logits); in a
free run this shows, for example, as one garbled word (
okalforλ) in the 2,782-token output of a 32-tile page. They are deterministic and isolated (the following steps agree again) and come from the bfp8 decoder weights: thebf16serve profile removes these, but shows other deviations of the same kind at a similar rate (5 of 7,988 steps), so it is offered as an option, not as the default. - The prefill buckets of 3840, 4096 and 4352 rows serve a 32-tile page with a prompt text longer than about 280 tokens; with the trained prompt no page needs them. They are compiled and captured at every start but were not checked against float32.
- One p150 only: device dispatch runs on the chip's Ethernet cores, so multi-chip meshes are not supported.
Licensing
- Weights (not redistributed here;
tt servedownloads them from the authors' repository at this commit): schift-io/schift-ocr-1-beta8fc26dce, MIT (declared in its model card, "inherited from baidu/Unlimited-OCR"; the repository carries the base model's MIT License, "Copyright (c) 2026 Baidu":code/tt_dsocr/licenses/LICENSE-MIT-schift-ocr-1-beta.txt). The model is Schift's fine-tune of Baidu's Unlimited-OCR (MIT). Notices:code/tt_dsocr/licenses/NOTICE.md. - This package is a derivative work of schift-ocr-1-beta: the inference code is written anew (image views,
tiling and the prompt follow the official
infer; the generation window follows the officialSlidingWindowLlamaAttention, read but never run in the package), the networks run on the device in tt-nn operations, and the weights are loaded unmodified. The official Python files are never downloaded, and the authors' code is never executed. The HTTP server and the Python API are adapted from the same author's changh95/GLM-OCR port (Apache-2.0), whose server worker comes from the same author's Qwen3-ASR / Qwen3-TTS ports. Related packages by the same author: changh95/Unlimited-OCR-2 (the second version of this model's base model, from the same code), changh95/DeepSeek-OCR, changh95/DeepSeek-OCR-2, changh95/GLM-OCR, changh95/PaddleOCR-VL, changh95/DepthPro2, changh95/all-MiniLM-L6-v2. - Port, server and scripts (
code/) and the tt-metal patches inpatches/: Apache-2.0. - Samples:
code/tt_dsocr/samples/*/sample.png, synthetic images made for these packages (Apache-2.0); provenance in theirPROVENANCE.md. The demo files inmedia/: seemedia/ATTRIBUTION.md.
Feedback
Questions or problems with this package: open a discussion at https://huggingface.co/changh95/schift-ocr-1-beta/discussions β that is what reaches its author. A problem with the tt tooling itself: tt report issue (collects your environment and opens a prefilled issue against tenstorrent/tt-cli). Product feedback: support@tenstorrent.com.
Provenance
The exact sources the image was built from β code/ in this repo is byte-identical to the model code inside the image:
| component | built from |
|---|---|
| tt-metal | 44d66500520fda9f2c7060c0f6b41ec48f7ab37e (dirty tree β the image includes uncommitted changes) |
code/ digest |
a332344c515e51b2 (sha256, first 16 hex digits) |
| built | 2026-12-02T18:37:09+00:00 by tt-model 0.1.0 |
