mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-28 00:00:38 +00:00
* feat(nace): add NDI document parse as an OCR provider Add a Rust OCR adapter for Nace Document Intelligence (NDI) Parse with the models nace/parse-low, nace/parse-medium and nace/parse-high. A public https link goes to Nace as a link. Any other document is uploaded with a one-time grant, parsed, and deleted after the call. The cost map bills each processed page at the price of the effort. * fix(nace): clean the job error before the OCR response hooks see it The copy of a Nace job that goes to the response hooks now has its error code and message cleaned and the deployment API key masked. The copy keeps the key order of the job. The password texts now say that the logging callbacks mask it. * fix(nace): accept include_image_base64 and never send it to Nace Clients that use the Mistral OCR request shape send the top-level include_image_base64 option. A host that passes every body field on sent it to Nace, which refuses an unknown field with a 422. The option is now accepted with any value and left out of the parse request, since Nace returns images as links (output.include_images), not base64. * fix(nace): map the pages option to Nace page_ranges Clients that use the Mistral OCR request shape select pages with the top-level pages option (0-based page indexes). The Python host dropped it, so Nace parsed and billed the whole document, and a host that passes every body field on sent it to Nace, which refuses it with a 422. The option is now sorted, deduplicated, shifted to 1-based pages and merged into page_ranges runs. An empty list parses the whole document. Values that are not non-negative integers, or pages together with page_ranges, are refused with a 400 before the upload. * test(nace): assert request headers without loops and drop a redundant doc line * fix(nace): refuse include_image_base64 true unless drop_params is on Nace returns images as links, never as base64, so a request asking for base64 images now gets the unsupported-param 400 that other OCR providers give for output they cannot return. drop_params drops it instead, and false or null are still accepted and never sent, which keeps Open WebUI's Mistral loader working * fix(nace): refuse output.include_images unless drop_params is on Nace returns image crops only as links that need the operator's Nace key and stop working once cleanup deletes the job, so image requests now get the same unsupported-param 400 as include_image_base64 and every job is deleted * fix(nace): bill only the requested pages when Nace omits billed units With page_ranges, the page count Nace reports covers the whole document, so a job without units now bills the requested pages that exist in the document instead of every page --------- Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| conftest.py | ||
| data.py | ||
| test_callbacks.py | ||
| test_dispatch.py | ||
| test_failures.py | ||
| test_guardrails.py | ||
| test_lifecycle.py | ||
| test_passthrough.py | ||
| test_requests.py | ||
| test_settings.py | ||