Deploy Sarvam Vision
Deploy Sarvam Vision — a 3B-parameter document-intelligence model — as a SageMaker endpoint in your own account. It performs OCR and document parsing (tables, layout, reading order) across 23 languages and returns clean HTML or Markdown. The full, runnable notebook lives in sarvamai/amazon-sagemaker-examples.
Prerequisites
Complete Get started on SageMaker: subscribe to the Sarvam Vision listing, copy your model package ARN, and have an execution role ARN ready.
1. Configure
2. Deploy a real-time endpoint
3. Invoke it
Send a single PDF, individual PNG/JPG page images, or a flat ZIP of page images as the request body, with a Content-Type that matches the bytes. Pass options — language, output_format (md/html/json), filename — as custom attributes. The full request and response contract is in the API reference.
Sync is for small documents at low concurrency — prefer async for everything else. Every sync request must finish inside AWS’s hard 60-second InvokeEndpoint timeout, so keep sync documents to 5 pages or fewer (the container hard-caps any document at 500 pages → 413). Send multi-page or bursty work to async or batch.
Concurrency
Because each sync request must finish inside the 60-second timeout, an instance serves a bounded number of documents at once. That capacity scales with the ml.g6e instance size — a document fans out across the instance’s GPUs. See the recommended instances and concurrency table for the per-instance numbers.
Send more concurrent documents than the instance can handle and requests queue past 60 seconds and time out. For heavy, bursty, or high-concurrency workloads, size up the ml.g6e instance or — better — use async (below), which queues work and never hits the sync timeout.
Prefer async for documents
Async is the recommended path for almost all document workloads. It queues requests, supports payloads up to 50 MB and minutes-long processing, scales to zero when idle, and never hits the 60-second sync timeout.
Async is not automatic — it’s a deploy-time choice. Add an AsyncInferenceConfig (with an S3 output path) to the endpoint configuration, grant the execution role S3 access, then invoke with invoke_endpoint_async.
- Async — submit a job and read the result from S3 when ready; supports large documents, high concurrency, and scale-to-zero.
- Batch transform — process a whole S3 prefix of documents in one job, then shut the instances down.
Reserve sync for small, latency-sensitive, one-off documents at low concurrency; send everything else to async or batch. Both use the same model package — see Operations for autoscaling and sizing.