Skip to main content

OCR service configuration

For OCR functionality, Reducto uses AWS Textract with automatic region selection and load balancing across multiple regions.

Textract region configuration

Format

The TEXTRACT_REGIONS environment variable accepts a comma-separated list of region:quota pairs:
Format Rules:
  • With quota: region:quota (e.g., us-east-1:100)
  • Without quota: region (defaults to quota of 1)
  • Mixed: us-east-1:50,us-west-2,eu-west-1:25

Use cases

This configuration is particularly useful for:
  • Government Cloud deployments requiring specific regions (e.g., us-gov-west-1, us-gov-east-1)
  • Data residency requirements restricting processing to certain geographic regions
  • Custom quota management when you have different service limits across regions
  • Network restrictions where only certain regions are accessible from your deployment

Examples

Government Cloud:
Europe-only processing:
Single region:
When this variable is set, Reducto will use weighted random selection based on the quotas to distribute Textract requests across the specified regions, providing both load balancing and compliance with regional requirements. With automatic quota handling.

Azure Vision OCR

For OCR functionality using Azure Computer Vision service.

Single endpoint

Multiple endpoints (failover and load balancing)

For setups with multiple endpoints, use AZURE_VISION_ARRAY. If any endpoint returns an error (rate limits, connection failures, server errors), Reducto automatically tries the remaining endpoints before failing. With load_balance (default), requests are distributed randomly across endpoints. With priority, endpoints are tried in the order listed, useful when you have a preferred region and want others used only as fallbacks.
When AZURE_VISION_ARRAY is set, AZURE_VISION_ENDPOINT and AZURE_VISION_KEY are ignored.

LLM provider environment variables

Reducto supports multiple LLM providers through environment variables. Below is a complete list of supported providers and their required environment variables. Features that call an LLM, such as intelligent spreadsheet clustering (spreadsheet_table_clustering set to intelligent), use the providers that you configure on this page. If none of them can serve intelligent clustering, Reducto uses default clustering.

LiteLLM proxy

OpenAI

Azure OpenAI

Anthropic

Google

Use google:<model>, for example google:gemini-3.7-flash, to call Gemini on Vertex AI.

Gemini API through Google AI Studio

Use google_aistudio:<model>. Set GEMINI_API_KEY to your Google AI Studio key, and name the provider in a deployment setting: LOCAL_KV_MODEL, AGENTIC_TABLES_MODEL, or LOCAL_EXTRACT_CITATIONS_MODEL. An API request cannot set it:
Reducto never falls back between Vertex AI and Google AI Studio. This provider is not available when LITELLM_PROXY_URL is set, and GCP_REGION does not apply to it.

AWS Bedrock

AI usage tracking

Reducto includes a comprehensive AI usage tracking system that monitors language model consumption throughout the document processing pipeline. This feature provides detailed insights into token usage, request counts, and model utilization for billing and optimization purposes.

How AI usage tracking works

The AI usage tracking system operates at the block level within the parsing pipeline:
  1. Token Counting: Each AI operation (table summarization, figure analysis, key-value extraction, etc.) records token consumption
  2. Request Tracking: The system counts API calls made to each model
  3. Model Identification: Usage is tracked per model type with provider information
  4. Aggregation: Usage is aggregated across all blocks and pages for comprehensive reporting

Available via /parse API

AI usage information is currently only available through the /parse API endpoint using the custom_format parameter. This feature is not available in other API endpoints.

Usage information structure

When enabled, the system returns an AIUsageInfo object containing:

Field descriptions

  • did_use_ai_models: Boolean indicating whether any AI models were used during processing
  • ai_usage_info: Array of usage information objects, one per model type used
  • promptTokenCount: Total input tokens sent to the model
  • completionTokenCount: Total output tokens generated by the model
  • cachedTokenCount: Total cached tokens used (when supported by provider)
  • requestCount: Number of API calls made to this model
  • modelType: Standardized model identifier
  • modelProvider: Provider name (e.g., “anthropic”, “openai”)
  • modelRateLimitFamily: Rate limiting group for the model

Enabling AI usage tracking

To retrieve AI usage information, set the custom_format parameter to "ai_usage" in your /parse request:

Tracked AI operations

The system tracks usage from these AI-powered features:
  • Table Summarization: Analysis and description of complex tables
  • Figure Summarization: Analysis and description of images and charts
  • Key-Value enrichment: Enrichment for form-like regions within documents

Model name standardization

The system automatically standardizes model names for consistent reporting:
  • Internal model identifiers are mapped to standard formats
  • Provider information is automatically added
  • Rate limit families are identified for capacity planning

Possible model identifiers

The following model identifiers may appear in the modelType field of AI usage tracking responses, if you have OpenAI and Anthropic access enabled:

OpenAI models

  • gpt-4o-2024-08-06
  • gpt-4o-mini-2024-07-18

Anthropic models

  • claude-3-5-haiku-20241022
  • claude-3-5-sonnet-20240620
If you enable other model providers, they have their own prefixes which will appear.