import base64, iofrom PIL import Imagefrom vllm import LLM, SamplingParams PROMPT = "OCR this image as HTML layout blocks with bbox and label." llm = LLM( model="ebinan92/Qwen3.5-ocr-jp-2b", dtype="bfloat16", max_model_len=12288, limit_mm_per_prompt={"image": 1}, trust_remote_code=True,)sampling = SamplingParams(temperature=0.0, top_p=0.1, max_tokens=8000) image = Image.open("page.png").convert("RGB")buf = io.BytesIO()image.save(buf, format="PNG")b64 = base64.b64encode(buf.getvalue()).decode() messages = [{ "role": "user", "content": [ {"type": "image_url", "image_url": {"url": f"data:image/png;base64,{b64}"}}, {"type": "text", "text": PROMPT}, ],}]print(llm.chat(messages, sampling_params=sampling)[0].outputs[0].text)