AI Model Strategy
The platform should support multiple AI providers behind a routing layer. The business workflow should not depend directly on one provider API.
Provider comparison
| Provider | Strengths | Best use |
|---|---|---|
| OpenAI GPT | Strong structured extraction, reliable JSON, good reasoning over mixed documents. | Rental contracts, complex bills, ambiguous documents. |
| Anthropic Claude | Strong long-context reading and careful language understanding. | Long contracts, dense legal documents, multi-page schedules. |
| Google Gemini | Strong multimodal handling and broad document understanding. | Scanned documents, image-heavy bills, mixed visual layouts. |
| DeepSeek | Cost-effective text reasoning for simpler extraction tasks. | Invoices, straightforward schedules, second-pass validation. |
Routing strategy by document type
| Document type | Primary model | Fallback |
|---|---|---|
| Rental contracts | OpenAI GPT or Claude | Gemini for image-heavy scans |
| Utility contracts | OpenAI GPT | Claude |
| Utility bills | Gemini or OpenAI GPT | DeepSeek for normalized text |
| Bank transaction fallback | OpenAI GPT | DeepSeek |
| Invoices | DeepSeek or OpenAI GPT | Gemini for scanned invoices |
| Tax documents | OpenAI GPT | Claude |
| Condominium schedules | Claude | OpenAI GPT |
| Insurance contracts | Claude or OpenAI GPT | Gemini |
| Property ownership documents | Claude | OpenAI GPT |
Fallback logic
Fallback should be triggered when:
- JSON is invalid
- classification confidence is low
- required fields are missing
- OCR output is poor
- model returns unsupported values
- backend validation fails for format-sensitive fields
Prompt versioning
Prompts should be versioned by document type. A saved extraction job should record:
- provider
- model
- prompt version
- schema version
- token usage
- latency
- confidence summary
Practical recommendation
Start with one high-accuracy model for the first production workflows. Add routing after enough extraction logs exist to identify which document types are expensive or error-prone.