litellm/tests/test_litellm/llms
devin-ai-integration[bot] 47bba14336
fix(passthrough): parse Bedrock stream spend incrementally instead of buffering the whole response (#40724)
* fix(passthrough): parse Bedrock stream spend incrementally instead of buffering the whole response

Bedrock pass-through streaming kept every relayed chunk in memory until EOF and
then decoded, parsed and translated the whole stream again for spend logging.
Large or concurrent streams could exhaust proxy worker memory.

Sync and async passthrough wrappers now hand each chunk to a provider stream
collector as it is relayed. Bedrock decodes event-stream frames incrementally,
folds consecutive text deltas, and keeps only what stream_chunk_builder needs
for usage, tool calls and metadata. Text deltas are no longer retained in the
Bedrock and Anthropic stream decoders either. Providers without a collector
keep the previous raw-bytes behavior. Collector failures are isolated so spend
tracking can never interrupt the customer stream

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

* test(passthrough): assert the spend payload the collector builds instead of mock internals

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

* test(passthrough): type the Bedrock collector helpers by the collector protocol instead of asserting the class

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

---------

Co-authored-by: yassin <yassin@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-11 09:53:37 -07:00
..
a2a/chat fix(guardrails): skip streaming guardrail rounds that re-scan cleared output (#39386) 2026-09-02 18:25:28 -07:00
aiml/image_generation test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
amazon_nova/chat test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
anthropic feat(proxy): expose reversible Claude Code model listing aliases (#40515) 2026-09-09 22:04:37 -07:00
apiserpent test: unwind environment writes in tests/test_litellm with monkeypatch (#37806) 2026-08-21 20:28:37 -07:00
azure fix(openai): drop tool schema regex patterns OpenAI's validator cannot compile (#40485) 2026-09-09 22:08:30 -07:00
azure_ai fix(passthrough): parse Bedrock stream spend incrementally instead of buffering the whole response (#40724) 2026-09-11 09:53:37 -07:00
base_llm feat(azure): support credential chain for storage (#39229) 2026-09-02 18:55:22 -07:00
baseten/chat style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
bedrock fix(passthrough): parse Bedrock stream spend incrementally instead of buffering the whole response (#40724) 2026-09-11 09:53:37 -07:00
bedrock_mantle fix: sign Bedrock guardrail, embedding, and Mantle requests off the event loop 2026-09-08 16:59:34 -07:00
black_forest_labs fix(image_edit): await an async transform hook and hide the URL policy verdict from callers 2026-09-04 23:20:21 -07:00
bytez/chat test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
cerebras fix(cerebras): add max_retries and extra_headers to get_supported_openai_params (#36601) 2026-08-25 14:10:56 -07:00
chat fix(bedrock): keep x-amzn-RequestId on chat error responses (#40089) 2026-09-07 17:16:47 -07:00
chatgpt test: annotate registry metadata test parameters 2026-09-08 13:37:56 +00:00
cloudflare fix(cloudflare): route native Workers AI provider through OpenAI-compatible endpoint (#31053) 2026-06-23 12:09:11 -07:00
cohere fix(ocr): send each provider a health-check document it accepts 2026-09-04 22:52:12 -07:00
cometapi/chat test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
compactifai fix(exceptions): map upstream status codes for providers with no exception_type branch 2026-08-26 00:47:28 -07:00
crusoe test: unwind environment writes in tests/test_litellm with monkeypatch (#37806) 2026-08-21 20:28:37 -07:00
custom_httpx refactor(mcp): reuse the shared HTTP handler for bounded probes 2026-09-10 19:59:07 -07:00
dashscope Merge pull request #39237 from BerriAI/litellm_fix_dashscope_rerank_endpoint 2026-09-10 10:31:48 -07:00
databricks fix(databricks): route Unity model services through AI Gateway (#40492) 2026-09-09 17:15:48 -07:00
datarobot test: unwind environment writes in tests/test_litellm with monkeypatch (#37806) 2026-08-21 20:28:37 -07:00
deepgram test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
deepinfra test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
deepseek fix: collapse image_url blocks whose payload lacks a url instead of forwarding them 2026-08-26 13:19:06 -07:00
docker_model_runner test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
elevenlabs test: avoid provider test module name collision 2026-04-29 22:36:57 -07:00
fal_ai test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
fastcrw/search chore(oss): litellm oss staging 150626 (#30463) 2026-06-16 12:06:41 -07:00
featherless_ai/chat test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
fireworks_ai fix(fireworks): fold system and developer items into instructions on the responses path 2026-09-08 12:12:34 -07:00
gdc/chat Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_decrease_anys_opus5 2026-08-29 06:03:33 -07:00
gemini test: collapse blank lines left by removed tests 2026-09-08 02:21:55 +00:00
gigachat fix(gigachat): fold cached tokens back into prompt and total token counts 2026-08-31 15:16:44 -07:00
github_copilot test(realtime): pin mode-only transcription detection and correct a stale docstring 2026-08-26 12:33:46 -07:00
gradient_ai test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
groq fix: omit thinking.type=disabled for always-on thinking Claude models (#37510) 2026-08-21 10:27:26 -07:00
heroku style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
hosted_vllm fix(hosted_vllm): reject image edit params vLLM-Omni ignores 2026-09-08 20:11:01 -07:00
huggingface fix: bound Hugging Face config fetch and keep embedding tests off the network 2026-08-29 09:45:52 +00:00
inception test: collapse blank lines left by removed tests 2026-09-08 02:21:55 +00:00
jina_ai/embedding test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
langflow fix(exceptions): map upstream status codes for providers with no exception_type branch 2026-08-26 00:47:28 -07:00
lemonade test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
litellm_proxy feat(skills): semantic search over the LiteLLM-hosted skill registry (#39401) 2026-09-07 12:28:38 -07:00
llamafile/chat style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
lm_studio style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
manus test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
meta_llama test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
minimax fix(minimax): attach MINIMAX_API_KEY on anthropic messages requests 2026-08-26 12:19:37 -07:00
mistral Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_mistral_voxtral_tts_speech 2026-09-04 16:45:33 -07:00
modelscope test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
mongodb/vector_stores fix: preserve MongoDB deadlines and secure remote sidecar transport 2026-09-07 23:43:21 -07:00
moonshot test: collapse blank lines left by removed tests 2026-09-08 02:21:55 +00:00
nebius test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
neosantara Litellm oss staging 050626 (#29774) 2026-06-05 13:51:51 -07:00
nimble/search feat(search): add Nimble as a search provider (#36347) 2026-08-14 17:09:58 -07:00
novita/chat test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
nscale/chat test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
nvidia_nim/rerank test: drop rerank package marker colliding with voyage test package 2026-08-11 23:37:27 -07:00
nvidia_riva test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
oci style(oci): wrap the Cohere tool-turn test fixtures to 120 columns 2026-09-05 16:38:23 -07:00
ocr test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
ollama perf: move Anthropic, Vertex Anthropic, Ollama and HF template fetches off the event loop (#40311) 2026-09-08 15:53:43 -07:00
oobabooga/chat test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
openai fix(model_prices): registry audit 2026-09-10, absorb open pricing PRs 2026-09-10 13:17:14 +00:00
openai_like test: collapse blank lines left by removed tests 2026-09-08 02:21:55 +00:00
openrouter test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
ovhcloud test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
parallel_ai fix(search): forward search-tool params through the router, complete Parallel AI v1 param mapping (#37883) 2026-09-01 21:46:46 -07:00
parasail Litellm oss staging 080626 (#29932) 2026-06-08 13:49:52 -07:00
pass_through test: remove four mirror test files that exercise none of their module 2026-07-25 10:57:19 -07:00
perplexity test: collapse blank lines left by removed tests 2026-09-08 02:21:55 +00:00
pg_vector/vector_stores test: require a match= on broad pytest.raises, and drop duplicate parametrize cases (#37769) 2026-08-20 20:24:49 -07:00
publicai test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
ragflow/chat test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
recraft test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
reducto Litellm oss staging 04 21 2026 2 (#26569) 2026-05-20 21:25:19 -07:00
runwayml fix(runwayml): skip progress scaling when Runway returns a null progress 2026-08-24 12:20:00 -07:00
s3_vectors fix(vector-store): embed through the SDK when the Router does not serve the query embedding model 2026-09-02 21:32:00 -07:00
sagemaker feat(bedrock): thread aws_session_tags into STS AssumeRole 2026-09-09 12:37:36 -07:00
sambanova Feat/sambanova embeddings (#13308) 2025-08-12 17:15:26 -07:00
sap style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
scaleway Feature/add audio support for scaleway (#26110) 2026-04-20 14:49:41 -07:00
snowflake fix(async): move remote image fetches off the event loop for Snowflake, Bedrock invoke Claude, Mantle and Gemini 2026-09-04 17:48:56 -07:00
soniox Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_soniox_srt_cue_grouping 2026-08-29 12:02:21 -07:00
stability test: require a match= on broad pytest.raises, and drop duplicate parametrize cases (#37769) 2026-08-20 20:24:49 -07:00
tencent test(tencent): drive thinking tests off the real cost map instead of patched internals 2026-08-26 11:34:06 -07:00
tinyfish test: require a match= on broad pytest.raises, and drop duplicate parametrize cases (#37769) 2026-08-20 20:24:49 -07:00
together_ai/chat fix(moonshot, together_ai): send the reasoning effort Kimi K3 accepts (#38611) 2026-08-27 20:46:46 -07:00
valkey/vector_stores fix(vector-store): route embeddings through router 2026-09-01 15:33:18 -07:00
vercel_ai_gateway test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
vertex_ai merge litellm_internal_staging 2026-09-09 13:05:02 +00:00
volcengine test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
voyage Merge remote-tracking branch 'origin/litellm_internal_staging' into HEAD 2026-09-10 13:55:11 -07:00
wandb feat(wandb): default unmapped W&B models to reasoning-capable 2026-09-10 16:40:07 -07:00
watsonx perf: move Anthropic, Vertex Anthropic, Ollama and HF template fetches off the event loop (#40311) 2026-09-08 15:53:43 -07:00
xai test: pin redirected xai slugs to the target's tier field set 2026-09-08 02:44:52 +00:00
you_com test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
zai test: collapse blank lines left by removed tests 2026-09-08 02:21:55 +00:00
test_cache_control_and_reasoning.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
test_file_content_block.py Litellm oss staging (#28161) 2026-05-18 16:27:44 -07:00
test_file_search_responses.py fix(file_search): escape the dropped vector_store_id in the warning 2026-09-05 16:44:54 -07:00
test_lifecycle_fix.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_polling_url_origin_match.py chore(security): close two unaddressed SSRF cases 2026-05-01 18:43:47 +00:00
test_predibase_transformation.py refactor(predibase): migrate transform_request and transform_response… (#25249) 2026-04-27 08:58:22 +05:30