Repository navigation
Conversation
The /ocr clients post multipart/form-data and pass options as query parameters, which the server never read before. multipart.zig parses a body already read into parts that are slices of it, keeping the raw Content-Type and a normalized media type, with bounded headers and part counts; query.zig decodes one parameter, refuses a name sent twice so a repeated option cannot mean two things, and reads pydantic's boolean words.
The line contracts on /ocr carry plain-text lines, while block readers give one box a block, so markdown.zig reads a block's normalized Markdown as plain-text lines, table rows included, and lines.zig divides the block's box into equal bands along its reading edges, one per line, and a line's box into words in proportion to each word's character count, splitting on the whitespace Python's str.split uses. Every derived quad passes the shared validation, so no encoder sees a zero-area box.
LiteParse's --ocr-server-url sends one page image as a multipart file part and reads text items with boxes in the image's pixels, so POST /ocr now chooses its contract from ?format=, the media type and the part names, and answers LiteParse with one result a line: text, an axis-aligned bbox and confidence 1.0, the fields LiteParse's published OCR API spec defines. A reader without boxes and a PDF are refused, files parts are refused on every path rather than dropped, a repeated format is refused, and the client's captured request is replayed. Refusals made before the contract is known use the OpenAI envelope, and a model without a reader or a server without --vision gives the gate's refusal on every path.
The API guide gains the /ocr route: how it picks its contract and which refusals use the OpenAI envelope, the gate's refusal on every path, the refusal of a repeated query name, LiteParse's failure column, the estimated lines and scores, and the LiteParse section on its published OCR spec with the refusal of readers without boxes; the inference scope lists /ocr.
A body line `--XyZ--junk`, with boundary XyZ, was taken as the close delimiter, so the parser stopped there and ignored any later parts. RFC 2046 lets only transport padding and a line break, or the end of the body, follow `--boundary--`, so the close now needs exactly that, and a line with more text stays in the part body like any other boundary-like text; a regression test reads a later part past such a line and checks the accepted close forms.
…gument post main's cache-salt isolation test called ocr/route.zig's post with three arguments; this branch gives post the route it dispatches on. The test sends a /v1/ocr request, so it now passes "/v1/ocr". Nothing else changes.
Reject unqualified recurrent heads, epsilon, tied weights, and layer schedules for the SM110 product. Keep the MLX and ModelOpt weight checks and exercise each refusal on the host. Move the SM110 driver assertions out of the byte-pinned serving source so the serving identity check still covers the original driver bytes.
Owner
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CI for a landing train: #2573 #4796 stacked on main in that order. Nothing merges from this PR: each PR above lands on its own once this tip is green, and this PR is then closed.