Skip to content

Route bulk prediction through the versioned serving snapshot - #1025

Merged
Userunknown84 merged 1 commit into
Userunknown84:mainfrom
pavsoss:feat/1021-bulk-predict-robust
Jul 31, 2026
Merged

Route bulk prediction through the versioned serving snapshot#1025
Userunknown84 merged 1 commit into
Userunknown84:mainfrom
pavsoss:feat/1021-bulk-predict-robust

Conversation

@pavsoss

@pavsoss pavsoss commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Bulk prediction now scores an uploaded file against a single, coherent serving snapshot (model + vectorizer + label encoder) captured at the start of the request, so a concurrent model reload can never score part of a file with a mismatched set. Results carry the serving model version.

Behaviour

  • One bad row can no longer fail the whole upload. Each row is validated and scored in isolation; rows that are empty, over the per-row length cap, or otherwise un-transformable come back in a structured skipped list with a stable typed reason, while every valid row still returns its prediction.
  • Two env-configurable limits guard resource use: a total row cap (exceeding it returns a typed error through the standard error
    envelope) and a per-row length cap (over-length rows are skipped, not fatal).
  • Responses are stamped with the serving model version — a model_version field on the JSON body and a matching column plus header on the CSV export — so consumers can tie predictions to the exact model that produced them.
  • Missing serving objects now surface as a typed, retryable error instead of an opaque failure.

Existing response fields are preserved; the new fields are additive.

Test plan

Regression coverage for mixed valid/invalid uploads (valid rows returned with the skip list populated), row-cap enforcement as a typed error, and version stamping on both the JSON and CSV responses.

Part 1/2 #1021

@vercel

vercel Bot commented Jul 29, 2026

Copy link
Copy Markdown

@pavsoss is attempting to deploy a commit to the Aditya Sharma's projects Team on Vercel.

A member of the Team first needs to authorize it.

@Userunknown84
Userunknown84 merged commit c747e3d into Userunknown84:main Jul 31, 2026
4 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants