Qianfan Ocr
@zts/qianfan-ocrv2026.11.03.1
Security Notice
This extension includes executable binaries. They run with your user permissions. Review each binary before installing.
- helper/qianfan_ocr.py
- helper/qianfan_ocr.py.lock
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.
02Behaviors
@zts/qianfan-ocrv2026.11.03.1qianfan_ocr.ts
Global Arguments
| Argument | Type | Description |
|---|---|---|
| uvPath? | string | uv executable that runs the Python helper (absolute path if not on PATH) |
| hfHome? | string | Hugging 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)
| Argument | Type | Description |
|---|---|---|
| imagePath | string | Image to read; absolute, or relative to the repository |
| prompt | string | What to ask the model, e.g. to transcribe the text or return JSON fields |
| maxNewTokens? | number | Most tokens the model may generate |
| name? | string | Name 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)
| Argument | Type | Description |
|---|---|---|
| items | array | The images to read, in order |
| maxNewTokens? | number | Most tokens the model may generate, for each image |
| name? | string | Name 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 Versions
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
Repository
https://github.com/zts/swamp-extensionsdeno-command1 accepted
Spawns a subprocess with Deno.Command().
- models/uv_runner.ts:38 — no reason given
behavior-spelling1 accepted
- (extension) — New extension with no existing users; it targets swamp releases that load the behavior spelling.
06Platforms
07Labels