Commit graph

55 commits

Author SHA1 Message Date
devin-ai-integration[bot]
1edc4ba580
fix(logging): pass provider response headers to callbacks on every endpoint (#42824)
* fix(logging): pass provider response headers to callbacks on every endpoint

Custom callbacks only received kwargs["response_headers"] for chat
completions. Responses, image generation and edit, speech, and
transcription calls either never recorded the provider's headers or
recorded them in one place and not the other.

Every handler now records the provider's httpx headers on the response's
hidden params as "headers" (raw) and "additional_headers" (processed,
with LiteLLM's own entries winning on a clash), and the logging object
derives model_call_details["response_headers"] from those hidden params
before cost calculation on the non-stream and both streaming success
paths, keeping a handler-set value authoritative. Binary speech responses
expose their hidden params to the standard logging payload, and the sync
OpenAI transcription request always fetches the raw response.

* test(images): point the legacy image and speech fakes at the raw response surface

Image generation now goes through the SDK's raw response so the provider headers can be read, and the speech binary response now carries hidden params. The unit fakes in the image generation, xinference, proxy provider, image edit, Vertex speech, and otel suites still pinned the old call surface and the old "no hidden params" assertion, so they read an uncalled mock or a fake response without headers.

* test(images): drop the rewritten mock comments and the generated edit PNGs

* test(images): move the llm-span test's image fake to the raw response surface

---------

Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com>
2026-09-24 13:01:12 -07:00
yuneng-jiang
f4f1a75a9c
test(vertex_ai): run the files peak-memory guards without coverage tracing (#42914)
The new CircleCI tests pipeline (#42773) runs tests/unit under pytest-cov on
CPython 3.12.2, where coverage traces every line through sys.settrace. The two
tracemalloc peak comparisons in test_vertex_ai_files_streaming.py drive 8000-row
payloads through both pipelines and slow from ~10s to over 3 minutes under that
tracer, so both hit the 90s pytest-timeout on every run.

Mark them no_cover so pytest-cov pauses tracing for just these two. Their
assertions are unchanged and every other test in the file still reports coverage.
2026-09-24 11:56:42 -07:00
devin-ai-integration[bot]
d248cc5914
fix(fireworks_ai): route firerouter short names and bill pass-through legs at the routed model's rates (#42814)
* fix(fireworks_ai): route firerouter short names and bill pass-through legs at the routed model's rates

fireworks_ai/firerouter and fireworks_ai/firerouter/<slug> resolve to
accounts/fireworks/routers/... instead of a models/ path, and the cost
calculator falls back to the routed model's own catalog entry before the
Fireworks size buckets so a Claude leg is no longer priced at $0

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(fireworks_ai): bill routed legs under the routed model's own provider

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test(fireworks_ai): require the k suffix when parsing tiered input fields

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

---------

Co-authored-by: kerry <kerry@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-23 20:53:17 -07:00
devin-ai-integration[bot]
c2b388ebe6
fix(bedrock): honour stream_chunk_size in Invoke streaming (#42686) 2026-09-23 11:25:00 -07:00
devin-ai-integration[bot]
e73f949fbb
fix(params): stop stream_chunk_size reaching provider request bodies (#42664)
* fix(params): carry stream_chunk_size through litellm_params instead of provider params

* test(integration): fence stream_chunk_size out of every provider request body

* test(bedrock): type parametrized stream chunk test params

* test(integration): drop the contracts manifest resurrected by the main merge

* test(bedrock): type the stream_chunk_size test helpers

* test(params): finish AGENTS.md typing pass on stream_chunk_size tests

* test(integration): drop the covers marker from the stream_chunk_size wire test

---------

Co-authored-by: shrey kharbanda <shreshth@berri.ai>
2026-09-23 10:27:47 -07:00
devin-ai-integration[bot]
5c24802fbd
fix(bedrock): send json_schema as a forced tool on Claude Opus 4.7 and 4.8 Converse (#42644)
* fix(bedrock): send json_schema as a forced tool on Claude Opus 4.7 and 4.8 Converse

Bedrock rejects outputConfig.textFormat on Opus 4.7 and 4.8 with
"output_config.format: Extra inputs are not permitted", and the AWS
model cards list structured outputs as not supported for both, so
their cost-map entries no longer claim supports_native_structured_output
and json_schema requests fall back to the json_tool_call tool.

Fixes #27846

* test(bedrock): assert Opus 4.7 and 4.8 inline the schema on Invoke, move the native case to Sonnet 4.6

---------

Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com>
2026-09-22 20:09:21 -07:00
devin-ai-integration[bot]
075536eca1
chore(cost-map): remove models past their deprecation date (#42435)
* chore(cost-map): remove models past their deprecation date

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test(cost-calc): drop the empty parametrize left behind by the gemini web search removal

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(cost-map): drop merge base block left by conflict resolution

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test(cost-calc): drop gemini image cost tests pinned on removed model

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

---------

Co-authored-by: kerry <kerry@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-22 21:19:26 +00:00
devin-ai-integration[bot]
691c0d6596
test(unit): make bedrock collector and secret scan timing tests deterministic (#42405)
* test(unit): make bedrock collector and secret scan timing tests deterministic

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test(unit): count interpreter calls instead of wall clock in the secret scan scaling test

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test(unit): profile the secret scan with cProfile, restore the outer profiler and tighten the scaling bound

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

---------

Co-authored-by: kerry <kerry@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-22 09:30:28 -07:00
devin-ai-integration[bot]
5dc6261ebb
fix(bedrock): sign batch S3 requests with s3_access_key_id and s3_secret_access_key (#42342)
* fix(bedrock): sign batch S3 requests with s3_access_key_id and s3_secret_access_key

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test(bedrock): keep S3 signer test additions scoped to new cases

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test(bedrock): drop e2e suite changes from the S3 signing fix

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(bedrock): build S3 credentials directly from the s3_* pair so ambient AWS_* env never mixes in

Restores the split-identity e2e coverage

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

---------

Co-authored-by: yucheng <yucheng@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-21 19:01:18 -07:00
mateo-berri
e51ccbc759 fix(bedrock): forward anthropic-beta headers verbatim on the Claude platform messages path 2026-09-21 11:39:26 -07:00
yuneng-jiang
7c4b805ca0
Merge pull request #42145 from BerriAI/litellm_migrate_tests_p13
test: migrate legacy provider tests to tests/unit (wave 2, phase 13)
2026-09-20 10:50:18 -07:00
yuneng
8554d1f827 test: prepare reference input before tracing path-sourced peak
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-20 17:08:16 +00:00
yuneng
e3911c71f7 test: make path-sourced streaming peak test differential
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-20 16:24:36 +00:00
yuneng
5ddf6ff396 test: restore pagination limit tests and realtime query param regression test
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-20 14:53:26 +00:00
yuneng
a5033fff6e test: define local_model_cost_map fixture for migrated context caching tests
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-20 14:20:04 +00:00
yuneng
e1556ce32b test: migrate legacy provider tests to tests/unit (wave 2, phase 13)
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-20 14:18:49 +00:00
yuneng
69133cc8cf Merge remote-tracking branch 'origin/main' into litellm_migrate_tests_p12 2026-09-20 13:44:19 +00:00
yuneng-jiang
ec93936668
Merge pull request #42132 from BerriAI/litellm_migrate_tests_p14
test: migrate phase 14 wave 2 provider tests to tests/unit
2026-09-20 06:43:34 -07:00
yuneng-jiang
e5b2cabae5
Merge pull request #42128 from BerriAI/litellm_migrate_tests_p11
test: migrate openai, openai_like and openrouter legacy tests to tests/unit
2026-09-20 06:43:22 -07:00
yuneng
1ca0a662f0 Merge remote-tracking branch 'origin/main' into litellm_migrate_tests_p11 2026-09-20 12:55:05 +00:00
yuneng
affd2d0c30 merge: bring main (unit package markers) into litellm_migrate_tests_p3 2026-09-20 12:55:05 +00:00
yuneng
432cf517ce Merge remote-tracking branch 'origin/main' into litellm_migrate_tests_p14 2026-09-20 12:54:59 +00:00
yuneng
ad0511ab64 Merge remote-tracking branch 'origin/main' into litellm_migrate_tests_p12 2026-09-20 12:54:55 +00:00
yuneng
cd07acbdea test: add __init__.py to intermediate phase 12 unit test directories
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-20 12:37:21 +00:00
yuneng
42dd6a1300 test: add __init__.py to phase 12 unit test directories
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-20 12:36:15 +00:00
yuneng
baf40ea5e8 test(unit): add package markers to migrated unit test directories
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-20 11:53:14 +00:00
yuneng
49cd32affe test: add __init__.py to every tests/unit directory this migration touches
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-20 11:52:09 +00:00
yuneng
5599c59923 test: add package initializers to migrated unit test directories
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-20 11:52:07 +00:00
yuneng
e4a58ef91a test(unit): make every tests/unit directory a package so pytest collection is unique
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-20 11:50:59 +00:00
yuneng
a3dd47ea11 test(unit): clear ambient Azure credentials in entra token tests
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-20 11:05:03 +00:00
yuneng
ef6237b9f2 test: migrate phase 12 legacy llm provider tests to tests/unit
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-20 11:02:53 +00:00
yuneng
a69ca90ea5 test: migrate phase 14 wave 2 provider tests to tests/unit
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-20 11:01:40 +00:00
yuneng-jiang
bfc805b372
Merge pull request #42109 from BerriAI/litellm_migrate_tests_p5
test(llms): migrate phase 5 provider unit tests to tests/unit
2026-09-20 04:00:48 -07:00
yuneng-jiang
766f6fcd3a
Merge pull request #42112 from BerriAI/litellm_migrate_tests_p8
test: migrate wave 1 phase 8 legacy llm tests to tests/unit
2026-09-20 03:59:36 -07:00
yuneng-jiang
4852d71606
Merge pull request #42114 from BerriAI/litellm_migrate_tests_p7
test(llms): migrate phase 7 provider unit tests to tests/unit
2026-09-20 03:59:28 -07:00
yuneng
729a96e4ea test: migrate openai, openai_like and openrouter legacy tests to tests/unit
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-20 10:40:27 +00:00
yuneng-jiang
9e39c751ed
Merge pull request #42117 from BerriAI/litellm_migrate_tests_p9
test: migrate phase 9 legacy llm provider tests to tests/unit
2026-09-20 03:13:33 -07:00
yuneng-jiang
e08df02ebe
Merge pull request #42115 from BerriAI/litellm_migrate_tests_p10
test: migrate nvidia, oci, ocr, oobabooga and openai legacy tests to tests/unit
2026-09-20 03:13:07 -07:00
yuneng-jiang
53ba9f389f
Merge pull request #42107 from BerriAI/litellm_migrate_tests_p6
test(llms): migrate phase 6 provider unit tests to tests/unit
2026-09-20 03:12:59 -07:00
yuneng-jiang
5ae5727eb0
Merge pull request #42110 from BerriAI/litellm_migrate_tests_p4
test(llms): migrate bedrock, baseten and base_llm batch tests to tests/unit
2026-09-20 03:12:49 -07:00
yuneng
f61abe00a6 test(llms): wrap remaining lines over 120 chars in migrated unit tests
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-20 09:58:23 +00:00
yuneng
ba629f2537 test(bedrock): wrap long lines flagged by review in migrated unit tests
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-20 09:37:17 +00:00
yuneng
cf2a9b372c test(gigachat): cover env credential fallback by its resulting auth header
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-20 08:21:51 +00:00
Devin AI
6d327fff6f test(bedrock): keep beta headers fixture teardown off the network 2026-09-20 08:21:28 +00:00
yuneng
fcabb626ac test(unit): migrate wave 1 phase 3 anthropic, apiserpent, azure and azure_ai legacy tests
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-20 08:19:05 +00:00
yuneng
ad523edb25 test: migrate phase 9 legacy llm provider tests to tests/unit 2026-09-20 08:13:11 +00:00
yuneng
feca00248c test(bedrock): isolate host AWS config in realtime and rerank unit tests
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-20 08:11:56 +00:00
yuneng
443c9f8385 test: migrate nvidia, oci, ocr, oobabooga and openai legacy tests to tests/unit
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-20 08:09:49 +00:00
yuneng
d47008129c test(llms): migrate phase 7 provider unit tests to tests/unit
Move the wave 1 phase 7 batch (fireworks_ai, gemini, gigachat, github_copilot; 20 files) from tests/test_litellm to tests/unit after judging every test function under a behaviour mutation. Seven wiring or mock-echo tests that stayed green are deleted. The fireworks cost calculator tests get a local model_cost save/restore fixture since the tests/unit tree has no shared conftest for it

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-20 08:08:12 +00:00
yuneng
4defed7f2e test: migrate wave 1 phase 8 legacy llm tests to tests/unit
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-20 08:03:54 +00:00