
Aliyun Qwen Ocr
- 59 installs
- 396 repo stars
- Updated July 18, 2026
- cinience/alicloud-skills
Extract text and structure from images with Alibaba Cloud Model Studio Qwen OCR models, including tables, formulas, and key information.
About
Uses Model Studio Qwen OCR models for text extraction and document-structure parsing including tables, formulas, and multilingual OCR. A developer uses it when the task is primarily text extraction rather than visual reasoning.
- qwen-vl-ocr and latest/snapshot model variants
- Table parsing, formula recognition, and key information extraction
Aliyun Qwen Ocr by the numbers
- 59 all-time installs (skills.sh)
- Ranked #6,524 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/cinience/alicloud-skills --skill aliyun-qwen-ocrAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 59 |
|---|---|
| repo stars | ★ 396 |
| Last updated | July 18, 2026 |
| Repository | cinience/alicloud-skills ↗ |
What it does
Extract text and structure from images with Alibaba Cloud Model Studio Qwen OCR models, including tables, formulas, and key information.
Files
Category: provider
Model Studio Qwen OCR
Validation
mkdir -p output/aliyun-qwen-ocr
python -m py_compile skills/ai/multimodal/aliyun-qwen-ocr/scripts/prepare_ocr_request.py && echo "py_compile_ok" > output/aliyun-qwen-ocr/validate.txtPass criteria: command exits 0 and output/aliyun-qwen-ocr/validate.txt is generated.
Output And Evidence
- Save request payloads, selected OCR task name, and normalized output expectations under
output/aliyun-qwen-ocr/. - Keep the exact model, image source, and task configuration with each saved run.
Use Qwen OCR when the task is primarily text extraction or document structure parsing rather than broad visual reasoning.
Critical model names
Use one of these exact model strings:
qwen-vl-ocrqwen-vl-ocr-latestqwen-vl-ocr-2025-11-20qwen-vl-ocr-2025-08-28qwen-vl-ocr-2025-04-13qwen-vl-ocr-2024-10-28
Selection guidance:
- Use
qwen-vl-ocrfor the stable channel. - Use
qwen-vl-ocr-latestonly when you explicitly want the newest OCR behavior. - Pin
qwen-vl-ocr-2025-11-20when you need reproducible document parsing based on the Qwen3-VL OCR upgrade.
Prerequisites
- Install dependencies (recommended in a venv):
python3 -m venv .venv
. .venv/bin/activate
python -m pip install requests- Set
DASHSCOPE_API_KEYin environment, or adddashscope_api_keyto~/.alibabacloud/credentials.
Normalized interface (ocr.extract)
Request
image(string, required): HTTPS URL, local path, ordata:URL.model(string, optional): defaultqwen-vl-ocr.prompt(string, optional): use when you want custom extraction instructions.task(string, optional): built-in OCR task.task_config(object, optional): configuration for built-in task such as extraction fields.enable_rotate(bool, optional): defaultfalse.min_pixels(int, optional)max_pixels(int, optional)max_tokens(int, optional)temperature(float, optional): recommended to keep near default/low values.
Response
text(string): extracted text or structured markdown/html-style output.model(string)usage(object, optional)
Built-in OCR tasks
Use one of these values in task:
text_recognitionkey_information_extractiondocument_parsingtable_parsingformula_recognitionmulti_lanadvanced_recognition
Quick start
Custom prompt:
python skills/ai/multimodal/aliyun-qwen-ocr/scripts/prepare_ocr_request.py \
--image "https://example.com/invoice.png" \
--prompt "Extract seller name, invoice date, amount, and tax number in JSON."Built-in task:
python skills/ai/multimodal/aliyun-qwen-ocr/scripts/prepare_ocr_request.py \
--image "https://example.com/table.png" \
--task table_parsing \
--model qwen-vl-ocr-2025-11-20Operational guidance
- Prefer built-in OCR tasks for standard parsing jobs because they use official task prompts.
- For critical business fields, add downstream validation rules after OCR.
qwen-vl-ocrand older snapshots default to4096max output tokens unless higher limits are approved by Alibaba Cloud;qwen-vl-ocr-2025-11-20follows the model maximum.- Increase
max_pixelsonly when small text is missed; this raises token cost.
Output location
- Default output:
output/aliyun-qwen-ocr/request.json - Override base dir with
OUTPUT_DIR.
References
references/api_reference.mdreferences/sources.md
interface:
display_name: "Alibaba Cloud AI Multimodal Qwen OCR"
short_description: "OCR-specialized extraction with Qwen OCR models"
default_prompt: "Use $aliyun-qwen-ocr to complete this ai/multimodal OCR task on Alibaba Cloud."
Qwen OCR API Reference Notes
Endpoint
- Domestic:
https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions - International:
https://dashscope-intl.aliyuncs.com/compatible-mode/v1/chat/completions - Global (Virginia):
https://dashscope-us.aliyuncs.com/compatible-mode/v1/chat/completions
Minimal request body
{
"model": "qwen-vl-ocr",
"messages": [
{
"role": "user",
"content": [
{
"type": "image_url",
"image_url": {
"url": "https://example.com/invoice.png"
},
"max_pixels": 8388608
},
{
"type": "text",
"text": "Extract seller name, date, and total amount."
}
]
}
],
"temperature": 0.01
}Built-in task example
{
"model": "qwen-vl-ocr-2025-11-20",
"messages": [
{
"role": "user",
"content": [
{
"type": "image_url",
"image_url": {
"url": "https://example.com/table.png"
}
}
]
}
],
"ocr_options": {
"task": "table_parsing"
}
}Notes
qwen-vl-ocr-latestandqwen-vl-ocr-2025-11-20use32*32pixels per image token.- Older snapshots use
28*28pixels per image token. - For local files in HTTP/OpenAI-compatible workflows, prefer converting to a public URL or a Base64 data URL as documented by Alibaba Cloud.
- 文字提取(Qwen-OCR): https://help.aliyun.com/zh/model-studio/qwen-vl-ocr
- Qwen-OCR API 参考: https://help.aliyun.com/zh/model-studio/qwen-vl-ocr-api-reference
- 模型上下架与更新: https://help.aliyun.com/zh/model-studio/newly-released-models
- 模型列表: https://help.aliyun.com/zh/model-studio/models
#!/usr/bin/env python3
"""Prepare a normalized request for Model Studio Qwen OCR."""
from __future__ import annotations
import argparse
import json
from pathlib import Path
def main() -> None:
parser = argparse.ArgumentParser()
parser.add_argument("--image", required=True)
parser.add_argument("--model", default="qwen-vl-ocr")
parser.add_argument("--prompt")
parser.add_argument("--task")
parser.add_argument("--task-config")
parser.add_argument("--enable-rotate", action="store_true")
parser.add_argument("--min-pixels", type=int)
parser.add_argument("--max-pixels", type=int)
parser.add_argument("--max-tokens", type=int)
parser.add_argument("--temperature", type=float)
parser.add_argument(
"--output",
default="output/aliyun-qwen-ocr/request.json",
)
args = parser.parse_args()
content_item = {
"type": "image_url",
"image_url": {
"url": args.image,
},
}
if args.min_pixels is not None:
content_item["min_pixels"] = args.min_pixels
if args.max_pixels is not None:
content_item["max_pixels"] = args.max_pixels
if args.enable_rotate:
content_item["enable_rotate"] = True
message = {
"role": "user",
"content": [content_item],
}
if args.prompt:
message["content"].append({"type": "text", "text": args.prompt})
payload = {
"model": args.model,
"messages": [message],
}
if args.max_tokens is not None:
payload["max_tokens"] = args.max_tokens
if args.temperature is not None:
payload["temperature"] = args.temperature
if args.task:
payload["ocr_options"] = {"task": args.task}
if args.task_config:
payload["ocr_options"]["task_config"] = json.loads(args.task_config)
output = Path(args.output)
output.parent.mkdir(parents=True, exist_ok=True)
output.write_text(json.dumps(payload, ensure_ascii=False, indent=2), encoding="utf-8")
print(json.dumps({"ok": True, "request_path": str(output)}, ensure_ascii=False))
if __name__ == "__main__":
main()