Commit graph

6 commits

Author SHA1 Message Date
mateo-berri
c813cc71ae Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_internal_copy_38013 2026-09-02 11:16:40 -07:00
samzong
26e71ddc54 fix(proxy): serialize model block responses
Signed-off-by: samzong <samzong.lu@gmail.com>
2026-08-29 21:22:17 -07:00
derhornspieler
d626d65d18 fix(proxy): let the model table validate a row it was handed as an object
/model/block and /model/unblock declare the proxy model table as their response model, and FastAPI
validates the returned row against it with from_attributes. The before-validator that parses the
JSON string columns assumed a mapping, so it called .get on the row object and both endpoints
answered 500 even though the block itself had already been applied

The validator now passes an object through untouched and keeps parsing the string columns it exists
for, which is the case the database actually produces. Found while exercising the provider setup's
enable and disable toggle against a live proxy
2026-08-23 10:35:13 -04:00
ryan-crabbe-berri
680bcfd8aa
test(lint): ban blind pytest.raises(Exception) with ruff B017 (#37731)
* test(lint): ban blind pytest.raises(Exception) with ruff B017

A bare pytest.raises(Exception) accepts whatever the body throws. The TypeError
a refactor introduces satisfies it exactly as well as the rejection the test was
written for, so the crash reads as a pass and the test never goes red.

All 111 existing sites are narrowed here. A runtime probe recorded the concrete
exception each one actually catches, and each site now names that type. Where
the code under test genuinely raises a bare Exception, the site pins a stable
slice of the message with match= instead.

Two sites tell on themselves. The shared responses-API cancel test raises
"custom_llm_provider is required but passed as None" rather than talking to a
provider at all, because cancel_responses takes a provider, not a model. And
test_bedrock_guardrails_with_streaming was the only test in its file still
passing without AWS credentials, because the NoCredentialsError boto3 raised
long before the guardrail ran satisfied the blind raises.

* fix(test): widen the openai batch-dispatch assertion to OpenAIError

The narrowed NotFoundError only holds where OPENAI_API_KEY is set. Without one
the SDK raises OpenAIError while building the client, long before any 404, so CI
went red. OpenAIError covers both and still rejects a TypeError from a refactor.
2026-08-20 18:09:42 -07:00
Tianhe Zhang
607e4a4e30 feat(spend-logs): add lifecycle timestamps 2026-08-18 14:16:08 -07:00
Yassin Kortam
5e2db7eee4
feat(litellm): add models and repository layers (#29686) 2026-06-06 20:59:33 -07:00