Best practices
Use these guidelines to improve reliability, speed, and cost efficiency when working with Retab.- Cut documents into smaller parts: Split large inputs into logical, independent chunks. This reduces latency, avoids provider limits, and improves parallelism. Keep chunks cohesive and preserve ordering with lightweight metadata if you need to reassemble results.
- Use retries with exponential backoff: Transient errors happen. Retry 5xx/timeout/network errors with exponential backoff and jitter; avoid retrying 4xx validation errors. Make operations idempotent (e.g., by using stable IDs) and cap max attempts.
- Don’t submit documents that are too long: Validate size before sending. If content is too large, chunk it, compress, or pre-trim to the essential sections. Estimate tokens early to prevent hard failures and timeouts.
- Use a long timeout: Complex or multi-step processing can take longer than a default HTTP timeout. Configure generous timeouts for long-running requests or prefer an async job flow (enqueue → poll for status) when expected durations are high.