Minimal prerequisite from #43646 for stable/1.104.x.
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
(cherry picked from commit 6a801372ac)
Test-only. Takes main's version of test_shipped_tool_search_rule_fills_mapped_claude_entries_without_flag, test_cache_control_injection_tool_config_honors_ttl_for_regional_model_lacking_own_pricing and test_get_model_info_gemini; retargets three tests whose rows main changed or removed (gemini-2.0-flash-001 -> gemini-2.5-flash, gpt-5.1-codex-max -> gpt-5.2 for xhigh, gpt-5.1-chat-latest -> gpt-5.1); registers this line's unsupported providers in PROVIDER_LABELS_WITHOUT_A_MODEL_SET; adds extraction mode, main's enum lists and every key main's map uses to test_utils' inline schema, plus main's seedance cost exceptions.
Adds search_free_requests, token_count_model (with litellm_provider enum bedrock/bedrock_mantle), token_count_framing and token_count_tokenizer to ci_cd/generate_model_prices_schema.py using main's definitions, and regenerates model_prices_and_context_window.schema.json. Schema keys are CI-only; the line already fetches main's map at runtime.
Backport of the router charge-once part of #47625 to stable/1.103.x, from main 6564a490f4 via the stable/1.104.x port 91cb4a55b5.
The batch accounting retry already landed in the earlier #47625 commit; this adds the charge-once helpers moved into router_utils.batch_utils and RouterBudgetLimiting's per-batch marker using the line's duration_in_seconds window. The shared-worker test waits for this line's background Redis push before reading spend.
Backport of #38172 to stable/1.103.x, from main 8327cd6d47 via the stable/1.104.x port 844e02f602.
Prerequisite for #47625: RouterBudgetLimiting reads the provider from the logging payload, so the batch poller's aretrieve_batch events reach router budgets at all. Test file placed at tests/test_litellm/router_strategy/ on this line.
Prerequisite for the #47625 backport to stable/1.103.x, from main 8a33b37c39.
Adds the per-counter batch charge-once marker that #47625 moves into router_utils.batch_utils.
Prerequisite for the #47625 backport to stable/1.103.x. Ports only the BATCH_RETRIEVE_CALL_TYPES / is_batch_retrieve_call_type helper from main 9acf09f60d, which #47625's charge-once helpers call. The rest of that commit (keeping batch retrieves out of router tpm/rpm counters) is not taken: its test passes on this line's tip, since batch retrieves are not stamped with a model group here.
Backport of #47419 to stable/1.103.x.
Cherry-picked from 3124797399 (main), via the stable/1.104.x port c88cf13cd3.
Adapted to the line: the cost-calc threshold changes are applied to this line's loop without the 1.104 base's batch-tier helpers; ModelNotMappedError from #42497 is hand-ported (exception class plus the get_model_info raise and re-raise) so registration lookups can tell an unmapped model from a transient failure; tests whose catalog rows (gpt-6-sol, gpt-6-luna from #42515) are not on this line are retargeted to amazon.nova-micro-v1:0 and gpt-5.6-sol profiles; the test conftest also snapshots _runtime_registered_fields. Billing checked unchanged on this line for a cross-provider alias (keeps cache prices) and for unpriced openai/ft: and bedrock/ap-northeast-1 deployments.
Prerequisite for the #47419 backport to stable/1.103.x, taken from the stable/1.104.x hand-port 49cacdb4b2.
Minimal port of helpers from #41523/#43890/#46647 needed by #47419; behavior changes of those PRs not included. Registrations are tracked in a _runtime_registered_fields side table and cost-map entries stay plain dicts.
Backport of #47625 to stable/1.103.x.
Cherry-picked from 6564a490f4 (main).
Adapted to the line: the batch accounting retry (track_batch_accounting in proxy_track_cost_callback and its use in check_batch_cost) is ported, while this PR's router-budget charge-once changes in router_utils/batch_utils, budget_limiter and model_max_budget_limiter are left out, since they refactor charge-once code from main (8a33b37c39, 9acf09f60d) that is not on this line. The write-started mark keys on a budget reservation only, as the search free tier is not on this line. Tests use the line's _ProxyDBLogger, and the router-budget and search-allowance assertions are dropped.
Backport of #47190 to stable/1.103.x.
Cherry-picked from 0ede0e10e7 (main).
Ported from the stable/1.104.x hand-port (3b7b5ab319). Carries the small typed table helpers that port relies on (_ManagedObjectRow protocol and the _managed_object_table/_user_table/_token_table/_team_table accessors, from the stable/1.104.x base). The poll-starvation integration test is dropped since its base and harness (#42622, integration/_support/prisma_clients) are not on this line. The 404-recovery unit test resets the litellm callback lists so a callback left by an earlier test cannot shadow it.
Backport of #47184 to stable/1.103.x.
Cherry-picked from 3fb95c8fe3 (main).
Ported from the stable/1.104.x hand-port (f7b0b09e75) onto this line's poller, which keeps LiteLLM_ManagedObjectTable and direct prisma table access. Brings the managed-files postgres_storable_json sanitizer from #45703 that this fix needs. Test files keep the line's content plus this PR's own cases.
Backport of #43935 to stable/1.103.x.
Cherry-picked from d7620c77a1 (main).
Ported from the stable/1.104.x adaptation (54f9259b40): the bridge check lives in litellm/main.py and the effort helpers keep the line's private names. Cost-map edits replay only this PR's reasoning-effort flags (gpt-6-astra and gpt-5.3-codex rows), plus supports_none_reasoning_effort=false on the azure gpt-6.1-sol rows from #46377, which the fix's tests key on. Tests built on gpt-6-sol rows (#42515), the Foundry tools-to-Responses bridge, or a full azure/eu/gpt-6-astra row are dropped since none of those are on this line.