Key takeaway
Reconcile saved chat batch records by ID and distinguish success, failed response and missing row.
On this page
When importing a Mistral chat batch, join output records to your input by custom_id. Keep the original IDs even if the final deliverable is a spreadsheet. An output file may have fewer usable rows than the input, and matching line one to line one can attach the wrong response to a record. The official batch guide shows the input identifier and the quickstart uses it when reading results. Mistral batch quickstart
Run a sample with an incomplete result
Save the reconciliation script, requests and results in the same folder.
python mistral-batch-reconcile.py batch-reconcile-requests.jsonl batch-reconcile-results.jsonl
On November 11, 2026, the local run printed:
cedar: failed (HTTP 429)
birch: "Birch"
spruce: missing
The sample contains a synthetic success followed by a synthetic failure. The script prints in input order. Exit status 1 is expected here because two inputs lack a usable answer. This is an offline reconciliation test with a deliberately incomplete file.
Decide what belongs in the export
Keep three separate counts. Count the original requests, count usable responses, and count rows needing review. For this fixture those are three, one and two. Check that the last two counts add up to the first before handing the spreadsheet to a downstream system.
The script treats an unknown or repeated ID as an input problem and stops rather than choosing an arbitrary record. For each matched ID it requires a successful HTTP code and nonempty chat text. A response can still be unsuitable if it contains the wrong information. Use a separate check for your task, such as an expected category from an approved support ticket. Promptfoo output replay
Triage before retrying
For an actual completed job, inspect its status and both the output and error files according to the current batch documentation. This script reads one result file using the chat-completion response shape. Preserve any separate error file for diagnosis. A missing ID in this file means the script found no matching record here. Check the other artifacts before assuming the service never processed that input.
Keep the original request manifest and the job ID. Once you understand a failure, prepare a retry subset containing only the affected IDs. When merging a second run, choose explicitly which attempt replaces a previous failure and keep that choice in your records. The sample avoids an automatic retry because the same symptom can come from a missing file, an invalid request or a transient service response.
Sources & references
Written by Modelrovia Editorial. Our standards distinguish official claims from observed results.
How we research and test →

