Skip to main content

Qianfan Ocr

@zts/qianfan-ocrv2026.11.03.1· MIT· 1d agoBEHAVIORSACCEPTED WARNINGS
01README

Run the Qianfan-OCR vision-language model (baidu/Qianfan-OCR) locally to read text or structured details from an image, with a prompt you give. install builds the Python environment with uv and downloads the model at a pinned revision ahead of time; extract reads one image and never downloads, so a run never stalls on a multi-GB fetch; extractBatch reads many images with one load of the model. Runs on Apple silicon (MPS), CUDA or CPU, and takes turns on the model across the machine. Needs uv.

02Behaviors1
@zts/qianfan-ocrv2026.11.03.1qianfan_ocr.ts

Global Arguments

ArgumentTypeDescription
uvPath?stringuv executable that runs the Python helper (absolute path if not on PATH)
hfHome?stringHugging Face cache directory (HF_HOME); default Hugging Face's own
fn install()
Build the Python environment and download the model; skips what is already there
fn extract(imagePath: string, prompt: string, maxNewTokens?: number, name?: string)
Read one image with the model and a prompt; never downloads (run install first)
ArgumentTypeDescription
imagePathstringImage to read; absolute, or relative to the repository
promptstringWhat to ask the model, e.g. to transcribe the text or return JSON fields
maxNewTokens?numberMost tokens the model may generate
name?stringName of the ocr resource, after ocr-; default the image file's stem
fn extractBatch(items: array, maxNewTokens?: number, name?: string)
Read many images with one load of the model; never downloads (run install first)
ArgumentTypeDescription
itemsarrayThe images to read, in order
maxNewTokens?numberMost tokens the model may generate, for each image
name?stringName of the batch resource, after batch-; default the time the batch started

Resources

ocr(infinite)— What the model read from one image, and how long it took
batch(7d)— One extractBatch: each image's outcome and the ocr record it wrote
install(infinite)— The last install: model revision and what was already there
03Previous Versions1
2026.11.02.1MIT
04Stats
A
100 / 100
Downloads
0
Archive size
90.1 KB
  • Has README or module doc2/2earned
  • README has a code example1/1earned
  • README is substantive1/1earned
  • Most symbols documented1/1earned
  • No slow types (deprecated)1/1earned
  • Dependencies pass trust audit2/2earned
  • Docs keep secrets in a vault1/1earned
  • Has description1/1earned
  • Platform support declared (or universal)2/2earned
  • License2/2earned
  • Verified public repository2/2earned

06Platforms
07Labels