---
title: "Automating Receipt Collection: Apple Intelligence for On-Device Inference"
description: "Ramp built automatic receipt detection for its iOS app to reduce the effort of finding receipt photos while keeping private images on device. An initial design used PhotoKit, Vision OCR, background processing, local storage, and exact checks for merchant, amount, and date, but formatting differences, aliases, and OCR errors produced many false negatives. FoundationModels enabled a local structured-output LLM, yet a single prompt performed poorly in evals because the small 4096-token model hallucinated and took shortcuts. Splitting the merchant, date, and amount questions and requesting rationale improved evaluation results, but the alpha release reached 66% precision and about 18% recall. Version 3.0 combined one LLM merchant-name check with deterministic iOS 26 data detectors for dates and monetary values; it cut processing time, more than doubled recall, and raised precision to 87%."
---

# Automating Receipt Collection: Apple Intelligence for On-Device Inference

[Ramp](https://yomu.fyi/company/ramp) · Kabir Oberai · Apr 13, 2026

**Type:** Problem & solution

## Summary

Ramp built automatic receipt detection for its iOS app to reduce the effort of finding receipt photos while keeping private images on device. An initial design used PhotoKit, Vision OCR, background processing, local storage, and exact checks for merchant, amount, and date, but formatting differences, aliases, and OCR errors produced many false negatives. FoundationModels enabled a local structured-output LLM, yet a single prompt performed poorly in evals because the small 4096-token model hallucinated and took shortcuts. Splitting the merchant, date, and amount questions and requesting rationale improved evaluation results, but the alpha release reached 66% precision and about 18% recall. Version 3.0 combined one LLM merchant-name check with deterministic iOS 26 data detectors for dates and monetary values; it cut processing time, more than doubled recall, and raised precision to 87%.

## Context

Ramp wanted to automatically find receipt photos associated with business-card transactions, reducing manual photo-library searches while ensuring that private photos stayed on device. Exact string comparisons failed on real-world variations in amounts, merchant names, dates, and OCR output; an initial all-in-one local LLM approach also produced poor precision and recall.

## Approach / What changed

The implementation evolved from background PhotoKit scans and Vision OCR with deterministic comparisons, to FoundationModels prompts evaluated against receipt and transaction data. The final design uses Apple Intelligence for merchant-name matching, while iOS 26 String.dataDetectorMatches extracts dates and monetary values deterministically. This reduced LLM calls from three to one and improved speed and matching results.

## Takeaways

- The initial exact-matching approach missed valid receipts because amounts, merchant names, and OCR text varied in formatting and wording.
- The local Apple Intelligence model had a 4096-token context and performed poorly when asked to verify merchant, date, and amount together; splitting the questions and requesting rationale improved eval results.
- The final hybrid approach raised precision from 66% to 87%, more than doubled recall, and became 3x faster at presenting matches by using deterministic date and amount detection alongside one LLM call.

**Tags:** [AI](https://yomu.fyi/topic/ai), [iOS](https://yomu.fyi/topic/ios), [LLMs](https://yomu.fyi/topic/llm), [Performance](https://yomu.fyi/topic/performance)

- Source: [Ramp](https://builders.ramp.com/post/apple-intelligence-receipt-matching)
- Source URL: https://builders.ramp.com/post/apple-intelligence-receipt-matching
- Ingested by Yomu: 2026-09-01T01:35:01.019Z

[Read original post](https://builders.ramp.com/post/apple-intelligence-receipt-matching)
