{"slug":"LightOnOcr_3_4B_Q8","routeSlug":"lightonocr-3-4b-q8","name":"LightOnOCR","developer":"LightOn","modality":"vision","inferenceTypes":["img2txt"],"surface":"native-v2","infrastructure":"native-fleet","planRequired":"basic","status":"standard_model","tags":["Native GPU Fleet"],"description":"LightOn's open-weight document OCR model. Turns scans, photos and screenshots into clean Markdown, with tables as HTML and equations as LaTeX. Reads print and handwriting in many languages.","useCases":["Run LightOnOCR via unified v2 jobs with free pre-run /price quotes","Low-latency pay-as-you-go inference on direct GPU capacity"],"pricing":{"unit":"Input image resolution","headlineRate":"$0.01206 / 1024×1024","hasLiveQuoteEndpoint":true,"quoteEndpoint":"/api/v2/quote","isEstimated":false,"notes":"High-accuracy OCR and document parsing."},"specs":{},"links":{"html":"https://runstage.dev/models/lightonocr-3-4b-q8","markdown":"https://runstage.dev/models/lightonocr-3-4b-q8.md","json":"https://runstage.dev/models/lightonocr-3-4b-q8.json","playground":"https://runstage.dev/playground?model=LightOnOcr_3_4B_Q8"},"snippets":{"curl":"# 1. Free pre-run retail quote\ncurl -X POST 'https://runstage.dev/api/v2/quote' \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"model\":\"LightOnOcr_3_4B_Q8\",\"width\":1024,\"height\":1024}'\n\n# 2. Submit metered image upload job (PNG, JPEG, WebP, GIF, or BMP up to 10 MB)\ncurl -X POST 'https://runstage.dev/api/v2/run' \\\n  -H \"Authorization: Bearer $RUNSTAGE_API_KEY\" \\\n  --form-string 'model=LightOnOcr_3_4B_Q8' \\\n  -F \"image=@input.png\" \\\n  --form-string \"format=text\" \\\n  --form-string \"return_result_in_response=true\"\n\n# 3. Poll owner-scoped job result until status is \"done\" or \"failed\"\ncurl -H \"Authorization: Bearer $RUNSTAGE_API_KEY\" \\\n  'https://runstage.dev/api/v2/jobs/<request_id>'","typescript":"import { readFile } from \"node:fs/promises\";\n\nconst authHeader = `Bearer ${process.env.RUNSTAGE_API_KEY}`;\n\n// 1. Free pre-run retail quote\nconst quote = await fetch(\"https://runstage.dev/api/v2/quote\", {\n  method: \"POST\",\n  headers: { \"Content-Type\": \"application/json\" },\n  body: JSON.stringify({\n  \"model\": \"LightOnOcr_3_4B_Q8\",\n  \"width\": 1024,\n  \"height\": 1024\n}),\n}).then((r) => r.json());\nconsole.log(\"Quoted USD:\", quote.data?.price);\n\n// 2. Submit metered multipart image upload (up to 10 MB)\nconst form = new FormData();\nform.append(\"model\", \"LightOnOcr_3_4B_Q8\");\nform.append(\"format\", \"text\");\nform.append(\"return_result_in_response\", \"true\");\nform.append(\"image\", new Blob([await readFile(\"input.png\")], { type: \"image/png\" }), \"input.png\");\n\nconst job = await fetch(\"https://runstage.dev/api/v2/run\", {\n  method: \"POST\",\n  headers: { Authorization: authHeader },\n  body: form,\n}).then((r) => r.json());\n\n// 3. Poll owner-scoped job status until terminal\nlet result;\nfor (let i = 0; i < 60; i++) {\n  result = await fetch(`https://runstage.dev/api/v2/jobs/${job.data.request_id}`, {\n    headers: { Authorization: authHeader },\n  }).then((r) => r.json());\n  if ([\"done\", \"failed\", \"refunded\"].includes(result.data?.status)) break;\n  await new Promise((r) => setTimeout(r, 2000));\n}\nconsole.log(\"Status:\", result?.data?.status, result?.data?.result ?? result?.data?.result_url);","python":"import os, time, requests\n\nheaders = {\"Authorization\": f\"Bearer {os.environ['RUNSTAGE_API_KEY']}\"}\n\n# 1. Free pre-run retail quote\nquote = requests.post(\n    \"https://runstage.dev/api/v2/quote\",\n    json={\n    \"model\": \"LightOnOcr_3_4B_Q8\",\n    \"width\": 1024,\n    \"height\": 1024\n},\n    timeout=15,\n).json()\nprint(\"Quoted USD:\", quote[\"data\"][\"price\"])\n\n# 2. Submit metered multipart image upload (up to 10 MB)\nwith open(\"input.png\", \"rb\") as img_file:\n    job = requests.post(\n        \"https://runstage.dev/api/v2/run\",\n        headers=headers,\n        data={\n        \"model\": \"LightOnOcr_3_4B_Q8\",\n        \"format\": \"text\",\n        \"return_result_in_response\": \"true\"\n},\n        files={\"image\": (\"input.png\", img_file, \"image/png\")},\n        timeout=30,\n    ).json()\njob_id = job[\"data\"][\"request_id\"]\n\n# 3. Poll owner-scoped job status until terminal\nresult = None\nfor _ in range(60):\n    result = requests.get(f\"https://runstage.dev/api/v2/jobs/{job_id}\", headers=headers, timeout=15).json()\n    if result[\"data\"][\"status\"] in (\"done\", \"failed\", \"refunded\"):\n        break\n    time.sleep(2)\nprint(\"Status:\", result[\"data\"][\"status\"], result[\"data\"].get(\"result\") or result[\"data\"].get(\"result_url\"))"}}