litellm/litellm
devin-ai-integration[bot] 2cf209f265
fix(mistral-ocr): forward the complete public parameter contract (#33600)
* fix(mistral-ocr): forward the complete public parameter contract

The Rust OCR path already lists id in the supported Mistral parameters, but litellm/ocr/main.py ran filter_out_litellm_params before handing optional_params to the bridge. That generic filter drops every key in all_litellm_params, which includes id, so the supported public Mistral OCR field id was silently stripped and never reached the provider while the rest of the contract went through.

Restore id after the generic filter via an OCR-specific reserved set, keeping genuine internal params filtered. Add Rust core and ai-gateway contract tests that pin the exact serialized request body for the full supported contract and prove internal canaries are dropped, a Python regression test that id survives while internal params do not, and a deterministic capture E2E plus a live Mistral param test.

Co-Authored-By: Ishaan Jaffer <155045088+ishaan-berri@users.noreply.github.com>

* test(mistral-ocr): drop unnecessary comments from parity tests

Co-Authored-By: Ishaan Jaffer <155045088+ishaan-berri@users.noreply.github.com>

* fix(mistral-ocr): only forward reserved id when set; harden capture e2e

Co-Authored-By: Ishaan Jaffer <155045088+ishaan-berri@users.noreply.github.com>

* refactor(mistral-ocr): typed queue-injected capture harness for e2e

Co-Authored-By: Ishaan Jaffer <155045088+ishaan-berri@users.noreply.github.com>

* test(mistral-ocr): fully type E2E capture models and move gateway ocr tests

Replace the remaining Any/coarse object wire types in the OCR E2E module
with concrete frozen Pydantic models for the supported-param contract,
internal canaries, upstream capture request, and normalized response, and
build every request payload immutably per call. The capture fixture now
cleans up on every failure path (terminate then always wait, kill then
always wait, shutdown plus server_close, join the server thread) and
requires an HTTP 200 liveness probe. The live Mistral test now exercises
the complete public parameter contract with valid json_schema annotation
formats. Move the ai-gateway OCR test module out of io/ocr.rs into a
focused io/ocr/tests.rs.

Co-Authored-By: Ishaan Jaffer <155045088+ishaan-berri@users.noreply.github.com>

* fix(mistral-ocr): drop reserved id upstream when null and type the E2E harness

Extend map_ocr_params so a null-valued reserved public id is omitted from the
serialized request, matching the Python OCR boundary for the standalone Axum
path where a caller can submit JSON id:null; add core map and serialized-body
tests for both the absent and null id cases. Extract the deterministic capture
harness into a typed ocr_capture_proxy helper module with an exception-safe
fixture that cleans up on every failure path from capture-server creation
onward (terminate then always wait, kill then always wait, shutdown plus
server_close, join the server thread, close logs after the process exits) and
requires an HTTP 200 liveness probe. Serialize wire payloads with by_alias so
the annotation schema/additionalProperties keys match the provider contract.
Replace the lambda internal canary in the Python bridge regression with a
serializable value and cover the litellm_session_id and tags internal fields.

Co-Authored-By: Ishaan Jaffer <155045088+ishaan-berri@users.noreply.github.com>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Ishaan Jaffer <155045088+ishaan-berri@users.noreply.github.com>
2026-07-16 20:25:22 -07:00
..
a2a_protocol chore(lint): remove PLR0915 too-many-statements ruff rule (#30574) 2026-06-16 16:52:49 -07:00
anthropic_interface feat(context_management): compact_20260112 polyfill for non-Anthropic providers (#28868) 2026-05-30 09:20:05 -07:00
assistants chore: migrate Python formatter from black to ruff format (#31317) 2026-06-25 11:27:43 -07:00
batch_completion
batches chore: migrate Python formatter from black to ruff format (#31317) 2026-06-25 11:27:43 -07:00
caching chore: migrate Python formatter from black to ruff format (#31317) 2026-06-25 11:27:43 -07:00
completion_extras chore: migrate Python formatter from black to ruff format (#31317) 2026-06-25 11:27:43 -07:00
compression build(deps-dev): bump black to 26.3.1 and apply formatting (#28525) 2026-05-21 17:24:18 -07:00
containers style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
endpoints/speech/speech_to_completion_bridge
evals style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
experimental_mcp_client feat(mcp): graft v2 resolver onto _create_mcp_client (none + api_key static family) (#31058) 2026-06-24 14:53:33 -07:00
files chore: migrate Python formatter from black to ruff format (#31317) 2026-06-25 11:27:43 -07:00
fine_tuning chore: migrate Python formatter from black to ruff format (#31317) 2026-06-25 11:27:43 -07:00
google_genai chore: migrate Python formatter from black to ruff format (#31317) 2026-06-25 11:27:43 -07:00
images chore: migrate Python formatter from black to ruff format (#31317) 2026-06-25 11:27:43 -07:00
integrations fix(otel): hashable scope for _emit_once when guardrail_mode is list (#31262) 2026-06-25 11:59:35 -07:00
interactions chore: litellm oss staging (#30968) 2026-06-23 07:31:44 -07:00
litellm_core_utils chore: migrate Python formatter from black to ruff format (#31317) 2026-06-25 11:27:43 -07:00
llms refactor(ocr): remove python provider transforms 2026-06-25 14:30:06 -07:00
models feat(litellm): add models and repository layers (#29686) 2026-06-06 20:59:33 -07:00
ocr fix(mistral-ocr): forward the complete public parameter contract (#33600) 2026-07-16 20:25:22 -07:00
passthrough chore: migrate Python formatter from black to ruff format (#31317) 2026-06-25 11:27:43 -07:00
proxy chore: migrate Python formatter from black to ruff format (#31317) 2026-06-25 11:27:43 -07:00
proxy_auth
rag chore: migrate Python formatter from black to ruff format (#31317) 2026-06-25 11:27:43 -07:00
realtime_api chore(lint): remove PLR0915 too-many-statements ruff rule (#30574) 2026-06-16 16:52:49 -07:00
repositories feat(litellm): add models and repository layers (#29686) 2026-06-06 20:59:33 -07:00
rerank_api chore(lint): remove PLR0915 too-many-statements ruff rule (#30574) 2026-06-16 16:52:49 -07:00
responses chore: migrate Python formatter from black to ruff format (#31317) 2026-06-25 11:27:43 -07:00
router_strategy chore: migrate Python formatter from black to ruff format (#31317) 2026-06-25 11:27:43 -07:00
router_utils chore: migrate Python formatter from black to ruff format (#31317) 2026-06-25 11:27:43 -07:00
rust_bridge feat: package Rust OCR bridge in LiteLLM wheel (#31267) 2026-06-25 12:32:55 -07:00
sandbox chore: migrate Python formatter from black to ruff format (#31317) 2026-06-25 11:27:43 -07:00
search Litellm oss staging 050626 (#29774) 2026-06-05 13:51:51 -07:00
secret_managers ci: drop mypy entirely, standardize type checking on basedpyright (#30648) 2026-06-17 09:42:00 -07:00
skills chore(proxy): scope skills and container resources 2026-04-30 18:23:58 -07:00
types chore: migrate Python formatter from black to ruff format (#31317) 2026-06-25 11:27:43 -07:00
vector_store_files build(deps-dev): bump black to 26.3.1 and apply formatting (#28525) 2026-05-21 17:24:18 -07:00
vector_stores feat(litellm): add models and repository layers (#29686) 2026-06-06 20:59:33 -07:00
videos ci(lint): add blanket-noqa, dataclass-default, and unused-noqa Ruff rules (#30516) 2026-06-16 12:07:22 -07:00
__init__.py feat(ocr): route all OCR through Rust 2026-06-25 14:16:42 -07:00
_internal_context.py fix(proxy): harden request parameter handling 2026-04-16 01:38:12 +00:00
_lazy_imports.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
_lazy_imports_registry.py refactor(ocr): remove python provider transforms 2026-06-25 14:30:06 -07:00
_logging.py ci(lint): add blanket-noqa, dataclass-default, and unused-noqa Ruff rules (#30516) 2026-06-16 12:07:22 -07:00
_redis.py chore: migrate Python formatter from black to ruff format (#31317) 2026-06-25 11:27:43 -07:00
_redis_credential_provider.py feat: add ability to auth to azure with token (#27556) 2026-05-09 22:34:09 +00:00
_service_logger.py fix: missing span for guardrail passthrough (#29552) 2026-06-03 01:25:15 +00:00
_uuid.py build(deps-dev): bump black to 26.3.1 and apply formatting (#28525) 2026-05-21 17:24:18 -07:00
_version.py
anthropic_beta_headers_config.json chore(oss): litellm oss staging 120626 (#30292) 2026-06-12 09:49:25 -07:00
anthropic_beta_headers_manager.py Refactor: Filtering beta header after transformation 2026-03-16 10:47:15 +05:30
blog_posts.json docs(blog): add WebRTC blog post link 2026-03-13 17:54:33 +05:30
budget_manager.py chore: migrate Python formatter from black to ruff format (#31317) 2026-06-25 11:27:43 -07:00
constants.py chore: migrate Python formatter from black to ruff format (#31317) 2026-06-25 11:27:43 -07:00
cost.json
cost_calculator.py chore: migrate Python formatter from black to ruff format (#31317) 2026-06-25 11:27:43 -07:00
exceptions.py feat: standardize rate limit errors with category, rate_limit_type, model, and llm_provider fields (#27687) 2026-06-06 17:50:29 -07:00
main.py chore: migrate Python formatter from black to ruff format (#31317) 2026-06-25 11:27:43 -07:00
model_prices_and_context_window_backup.json fix(anthropic): drop unsupported speed param with drop_params (#31152) 2026-06-23 22:22:49 -07:00
policy_templates_backup.json feat(add-new-block_code_execution-guardrail): prevent agent from executing code (#22154) 2026-02-25 22:02:14 -08:00
provider_endpoints_support_backup.json chore: litellm oss staging (#30968) 2026-06-23 07:31:44 -07:00
py.typed
router.py chore: migrate Python formatter from black to ruff format (#31317) 2026-06-25 11:27:43 -07:00
scheduler.py style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
setup_wizard.py Add Claude Fable 5 across Anthropic, Bedrock, Vertex AI, and Azure AI (#30064) 2026-06-10 08:50:15 +05:30
timeout.py docs: add class docstring to _LoopWrapper (#27870) 2026-05-13 13:54:00 -07:00
utils.py refactor(ocr): remove python provider transforms 2026-06-25 14:30:06 -07:00