mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-28 00:00:38 +00:00
* fix(langfuse): upload base64 media and export its reference from the langfuse callback
The v2 SDK replaced base64 payloads in a trace's input, output and metadata with
Langfuse media references and uploaded the bytes before ingestion. The v4 export
channel sends spans through litellm's own exporter, which had no such step, so
images reached Langfuse inline and multiplied the stored trace size on servers
that do not extract them.
The export channel now replaces data URIs and the Anthropic and Vertex typed
blocks with the same references and uploads the bytes through the Langfuse media
REST API on one background thread per channel.
* fix(langfuse): bound queued media by bytes and stop trusting the storage response
Media the uploader has no room for now stays inline in the span, the cap counts
decoded bytes, and a failed upload makes flush report failure. The storage PUT
no longer follows redirects and Langfuse is told the storage status without the
storage response body. A data URI followed by text is left as it is, trace level
media is registered without an observation, and queued uploads get five seconds
to finish at shutdown.
* fix(langfuse): validate upload URLs for request-supplied hosts and queue an attribute's media as a whole
A Langfuse host that comes with a key's or team's credentials now has the upload
URLs it returns checked with validate_url, so it cannot point the upload at an
internal address. A host the operator configured keeps naming its own storage.
The media of one attribute is queued all together or not at all, so an attribute
that stays inline no longer leaves part of its media uploading.
* fix(langfuse): keep media inline while Langfuse cannot store it
A Langfuse with no media route or bucket, or one whose upload URL is refused, answers the same
way for every payload. After the first such answer the uploader turns media away, so the exporter
keeps it inline, and one upload per pause checks whether Langfuse takes media again.
* fix(langfuse): re-send a media registration that does not reach Langfuse
The span export keeps trying through a short Langfuse outage, so a trace could arrive with a
reference whose single registration attempt had failed. Registration now waits out the same delays.
* fix(langfuse): replace base64 media in model parameters
A call rejected before the provider, such as an unknown model or a failed key check, is logged
with its request body as the model parameters, which left the image inline in those traces.
* Revert "fix(langfuse): replace base64 media in model parameters"
This reverts commit
|
||
|---|---|---|
| .. | ||
| langfuse_expected_request_body | ||
| __init__.py | ||
| test_gemini_cached_tokens.py | ||
| test_langfuse.py | ||
| test_langfuse_dynamic_credentials.py | ||
| test_langfuse_handler.py | ||
| test_langfuse_media.py | ||
| test_langfuse_prompt_management.py | ||
| test_langfuse_sdk.py | ||