$npx -y skills add cinience/alicloud-skills --skill aliyun-qwen-ocrUse when OCR-specialized extraction is needed with Alibaba Cloud Model Studio Qwen OCR models (qwen-vl-ocr, qwen-vl-ocr-latest, and snapshots), including document parsing, table parsing, multilingual OCR, formula recognition, and key information extraction.
| 1 | Category: provider |
| 2 | |
| 3 | # Model Studio Qwen OCR |
| 4 | |
| 5 | ## Validation |
| 6 | |
| 7 | ```bash |
| 8 | mkdir -p output/aliyun-qwen-ocr |
| 9 | python -m py_compile skills/ai/multimodal/aliyun-qwen-ocr/scripts/prepare_ocr_request.py && echo "py_compile_ok" > output/aliyun-qwen-ocr/validate.txt |
| 10 | ``` |
| 11 | |
| 12 | Pass criteria: command exits 0 and `output/aliyun-qwen-ocr/validate.txt` is generated. |
| 13 | |
| 14 | ## Output And Evidence |
| 15 | |
| 16 | - Save request payloads, selected OCR task name, and normalized output expectations under `output/aliyun-qwen-ocr/`. |
| 17 | - Keep the exact model, image source, and task configuration with each saved run. |
| 18 | |
| 19 | Use Qwen OCR when the task is primarily text extraction or document structure parsing rather than broad visual reasoning. |
| 20 | |
| 21 | ## Critical model names |
| 22 | |
| 23 | Use one of these exact model strings: |
| 24 | - `qwen-vl-ocr` |
| 25 | - `qwen-vl-ocr-latest` |
| 26 | - `qwen-vl-ocr-2025-11-20` |
| 27 | - `qwen-vl-ocr-2025-08-28` |
| 28 | - `qwen-vl-ocr-2025-04-13` |
| 29 | - `qwen-vl-ocr-2024-10-28` |
| 30 | |
| 31 | Selection guidance: |
| 32 | - Use `qwen-vl-ocr` for the stable channel. |
| 33 | - Use `qwen-vl-ocr-latest` only when you explicitly want the newest OCR behavior. |
| 34 | - Pin `qwen-vl-ocr-2025-11-20` when you need reproducible document parsing based on the Qwen3-VL OCR upgrade. |
| 35 | |
| 36 | ## Prerequisites |
| 37 | |
| 38 | - Install dependencies (recommended in a venv): |
| 39 | |
| 40 | ```bash |
| 41 | python3 -m venv .venv |
| 42 | . .venv/bin/activate |
| 43 | python -m pip install requests |
| 44 | ``` |
| 45 | |
| 46 | - Set `DASHSCOPE_API_KEY` in environment, or add `dashscope_api_key` to `~/.alibabacloud/credentials`. |
| 47 | |
| 48 | ## Normalized interface (ocr.extract) |
| 49 | |
| 50 | ### Request |
| 51 | - `image` (string, required): HTTPS URL, local path, or `data:` URL. |
| 52 | - `model` (string, optional): default `qwen-vl-ocr`. |
| 53 | - `prompt` (string, optional): use when you want custom extraction instructions. |
| 54 | - `task` (string, optional): built-in OCR task. |
| 55 | - `task_config` (object, optional): configuration for built-in task such as extraction fields. |
| 56 | - `enable_rotate` (bool, optional): default `false`. |
| 57 | - `min_pixels` (int, optional) |
| 58 | - `max_pixels` (int, optional) |
| 59 | - `max_tokens` (int, optional) |
| 60 | - `temperature` (float, optional): recommended to keep near default/low values. |
| 61 | |
| 62 | ### Response |
| 63 | - `text` (string): extracted text or structured markdown/html-style output. |
| 64 | - `model` (string) |
| 65 | - `usage` (object, optional) |
| 66 | |
| 67 | ## Built-in OCR tasks |
| 68 | |
| 69 | Use one of these values in `task`: |
| 70 | - `text_recognition` |
| 71 | - `key_information_extraction` |
| 72 | - `document_parsing` |
| 73 | - `table_parsing` |
| 74 | - `formula_recognition` |
| 75 | - `multi_lan` |
| 76 | - `advanced_recognition` |
| 77 | |
| 78 | ## Quick start |
| 79 | |
| 80 | Custom prompt: |
| 81 | |
| 82 | ```bash |
| 83 | python skills/ai/multimodal/aliyun-qwen-ocr/scripts/prepare_ocr_request.py \ |
| 84 | --image "https://example.com/invoice.png" \ |
| 85 | --prompt "Extract seller name, invoice date, amount, and tax number in JSON." |
| 86 | ``` |
| 87 | |
| 88 | Built-in task: |
| 89 | |
| 90 | ```bash |
| 91 | python skills/ai/multimodal/aliyun-qwen-ocr/scripts/prepare_ocr_request.py \ |
| 92 | --image "https://example.com/table.png" \ |
| 93 | --task table_parsing \ |
| 94 | --model qwen-vl-ocr-2025-11-20 |
| 95 | ``` |
| 96 | |
| 97 | ## Operational guidance |
| 98 | |
| 99 | - Prefer built-in OCR tasks for standard parsing jobs because they use official task prompts. |
| 100 | - For critical business fields, add downstream validation rules after OCR. |
| 101 | - `qwen-vl-ocr` and older snapshots default to `4096` max output tokens unless higher limits are approved by Alibaba Cloud; `qwen-vl-ocr-2025-11-20` follows the model maximum. |
| 102 | - Increase `max_pixels` only when small text is missed; this raises token cost. |
| 103 | |
| 104 | ## Output location |
| 105 | |
| 106 | - Default output: `output/aliyun-qwen-ocr/request.json` |
| 107 | - Override base dir with `OUTPUT_DIR`. |
| 108 | |
| 109 | ## References |
| 110 | |
| 111 | - `references/api_reference.md` |
| 112 | - `references/sources.md` |