Fork this repository and build a Python solution that processes all images in ./images, extracts structured data from "recibos de caja menor" (and equivalent small-receipt formats in this dataset), and generates a consolidated Excel file.
You will receive an OpenCode Zen API key for this test.
-
Use OpenCode Harness (required)
- The extraction step must use OpenCode harness.
- Use model
sonnet-4.6for document field extraction. - Submissions that do not use OpenCode harness for extraction will not be considered valid.
-
Rotation handling with Tesseract only (required)
- Before sending each image to the model, detect orientation with Tesseract (for example OSD).
- If rotated, correct the image orientation programmatically.
- Rotation detection/correction must not be delegated to an LLM.
-
Processing flow (required)
- For each image:
- Detect orientation with Tesseract.
- Rotate image if needed.
- Send corrected image to OpenCode harness (
sonnet-4.6) with a prompt. - Parse extracted fields.
- After all images are processed, generate one consolidated Excel file.
- For each image:
-
AI-first workflow transparency (required)
- This technical test is expected to be built 100% using AI assistance.
- You must store:
- The prompts you used during development.
- The conversation history used during development.
- These artifacts will be reviewed in a follow-up interview, so make sure to have them available. You can also submit conversation history to the repository.
-
Benchmark against one OpenCode OSS model (required)
- In addition to
sonnet-4.6, run the same extraction task with one open-source model available in OpenCode. - Build a benchmark comparison between
sonnet-4.6and your chosen model using the same input images and a comparable prompt strategy. - Provide a written performance analysis considering accuracy, failure patterns, consistency, speed/cost tradeoffs, and your own architecture and engineering recommendations (which model would you chosse in real life and why).
- The analysis must be delivered as a PDF file and committed to the repository.
- In addition to
-
Local OCR pipeline proposal with Ollama (required, planning only)
- Provide a written plan describing how you would solve the same problem with a local pipeline using Ollama + an open-source model.
- This is a design/planning deliverable only (do not implement this pipeline in code for this test).
- The plan must be delivered as a PDF file and committed to the repository.
- Folder:
./images - File types: receipt photos with mixed orientation and mixed templates.
Your parser must cover the fields present across the receipt formats in this dataset.
ciudadfechanumero_recibopagado_avalorconceptovalor_en_letras
Include these when present; leave empty/null when not available in a specific image:
firma_recibidocc_o_nitcodigoaprobadodireccionvendedortelefono_faxforma_pago(e.g., contado/plazo/credito)cantidaddetallevalor_unitariovalor_totaltotal_documentotipo_documento(e.g., recibo de caja menor / cuenta de cobro / recibo de pago / remision / pedido)
Recommended extra metadata columns:
source_fileplantilla_detectadarotation_angle_applied
- Excel file (for example:
./output/receipts_extracted.xlsx) - One row per image.
- Stable schema across all rows.
- We will run your solution with other images that use the same formats but different content.
- We will evaluate primarily on:
- Field extraction accuracy on unseen images.
- Correct rotation detection/correction using Tesseract.
- Correct usage of OpenCode harness +
sonnet-4.6. - Benchmark quality and rigor for
sonnet-4.6vs chosen OpenCode OSS model. - Depth and practicality of the Ollama local OCR pipeline plan.
- Reliability and clarity of your implementation.
- Quality/completeness of AI prompts and conversation logs.
Please submit at least:
- Source code.
requirements.txt.- Run instructions (
READMEsection or separate doc). - Generated Excel output example.
- AI usage evidence (optional in the repo but required in the interview):
ai/prompts.md(or equivalent)ai/conversations/(exports/logs/transcripts)
- Benchmark deliverables:
benchmark/results.*with comparison table/metricsbenchmark/analysis.pdfwith written conclusions and recommendation
- Local OCR planning deliverable:
docs/local-ollama-ocr-plan.pdfdescribing architecture, components, model choice, preprocessing steps, extraction strategy, validation strategy, risks, and rollout plan
Provide a command similar to:
python main.py --input-dir ./images --output-file ./output/receipts_extracted.xlsxYour code must be reproducible from a clean environment, assuming there will be a .env with the variable OPENCODE_API_KEY.
- Do not commit API keys.
- The model extraction step must go through OpenCode harness.
- The orientation step must be solved with Tesseract, not with an LLM.
- The benchmark must compare
sonnet-4.6with one selected OpenCode OSS model. - The Ollama pipeline section is required as a written plan only; implementation is out of scope.
- The Ollama plan and the model comparison analysis must be submitted as a PDF and committed into the repository.
- Share the repository fork to the GitHub user
danyel117.