--- license: apache-2.0 base_model: Qwen/Qwen3-VL-4B-Instruct pipeline_tag: image-text-to-text tags: - document-understanding - information-extraction - vision-language - qwen3-vl library_name: transformers --- # obj_v1 Vision-language model fine-tuned for structured data extraction from Indian financial documents. Give it a page image and a JSON schema; it returns the schema filled in from what is on the page. A 4B vision-language model, LoRA fine-tuned and merged ## Authors
## Serving with vLLM ```bash vllm serve objectai/obj_v1 \ --served-model-name obj_v1 \ --max-model-len 16384 \ --limit-mm-per-prompt '{"image":1}' \ --mm-processor-kwargs '{"max_pixels":1003520}' \ --trust-remote-code ``` `max_pixels` is 1280x28x28, the resolution the model was trained at. Raising it wastes KV cache; lowering it makes small print unreadable. ## Calling it The server is OpenAI-compatible, so an ordinary chat completion works: ```python import base64, json, openai client = openai.OpenAI(base_url="http://localhost:8000/v1", api_key="EMPTY") image = base64.b64encode(open("cheque.jpg", "rb").read()).decode() schema = {"cheque_details": {"amount": "number", "payee": "string", "date": "string", "cheque_number": "string"}} response = client.chat.completions.create( model="obj_v1", temperature=0.0, max_tokens=8192, messages=[ {"role": "system", "content": "You are a document data extraction model. " "Extract only values present in the document. " "Use null for fields that are absent or illegible. " "Output a single compact JSON object matching the requested schema. " "No prose, no markdown, no explanation."}, {"role": "user", "content": [ {"type": "image_url", "image_url": {"url": f"data:image/jpeg;base64,{image}"}}, {"type": "text", "text": f"document_type: cheque\nschema: {json.dumps(schema)}"}, ]}, ], ) print(response.choices[0].message.content) ``` ## Prompt format Match training or accuracy drops. The system prompt above is verbatim, and the user turn is the image followed by exactly two lines: ``` document_type: