litellm - 💡(How to fix) Fix [Bug]: langfuse_otel callback logs raw upstream model name instead of proxy alias for streaming requests [1 comments, 1 participants]

Official PRs (…)
ON THIS PAGE

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
BerriAI/litellm#25628Fetched 2026-04-14 05:38:34
View on GitHub
Comments
1
Participants
1
Timeline
4
Reactions
0
Author
Participants
Timeline (top)
labeled ×3commented ×1

Code Example

model_list:
     - model_name: groq-gpt-oss-120b
       litellm_params:
         model: groq/openai/gpt-oss-120b
         api_key: os.environ/GROQ_API_KEY

   litellm_settings:
     callbacks:
       - langfuse_otel

---

import openai
   client = openai.OpenAI(base_url="http://localhost:4000", api_key="<master-key>")
   response = client.chat.completions.create(
       model="groq-gpt-oss-120b",
       messages=[{"role": "user", "content": "hello"}],
       stream=True,
       max_tokens=5,
   )
   for chunk in response:
       pass

---
RAW_BUFFERClick to expand / collapse

Check for existing issues

  • I have searched the existing issues and checked that my issue is not a duplicate.

What happened?

When using the langfuse_otel callback with LiteLLM proxy and a model configured with a proxy alias (e.g. groq-gpt-oss-120bgroq/openai/gpt-oss-120b), streaming requests log the raw upstream model identifier (openai/gpt-oss-120b) in Langfuse instead of the configured proxy alias (groq-gpt-oss-120b).

Non-streaming requests work correctly and log the proxy alias.

Expected: Langfuse traces show the proxy alias (groq-gpt-oss-120b) for both streaming and non-streaming requests.

Steps to Reproduce

  1. Configure a model alias in config.yaml:
   model_list:
     - model_name: groq-gpt-oss-120b
       litellm_params:
         model: groq/openai/gpt-oss-120b
         api_key: os.environ/GROQ_API_KEY

   litellm_settings:
     callbacks:
       - langfuse_otel
  1. Make a streaming request to the proxy:
   import openai
   client = openai.OpenAI(base_url="http://localhost:4000", api_key="<master-key>")
   response = client.chat.completions.create(
       model="groq-gpt-oss-120b",
       messages=[{"role": "user", "content": "hello"}],
       stream=True,
       max_tokens=5,
   )
   for chunk in response:
       pass
  1. Check the Langfuse trace — the observation model field shows "openai/gpt-oss-120b" (raw upstream) instead of "groq-gpt-oss-120b" (proxy alias).

  2. Repeat with stream=False — proxy alias is logged correctly.

Relevant log output

What part of LiteLLM is this about?

Proxy

What LiteLLM version are you on ?

v1.82.3-stable

Twitter / LinkedIn details

No response

extent analysis

TL;DR

The issue can be resolved by modifying the langfuse_otel callback to handle streaming requests correctly, ensuring it logs the proxy alias instead of the raw upstream model identifier.

Guidance

  • Review the langfuse_otel callback implementation to identify why it's not handling streaming requests as expected, focusing on how model identifiers are processed.
  • Verify that the model_name from the config.yaml is being correctly passed to the langfuse_otel callback for streaming requests.
  • Check if there's an existing option or configuration in langfuse_otel that allows specifying the model alias for logging purposes, especially for streaming requests.
  • Consider adding custom logging logic within the langfuse_otel callback to override the model identifier with the proxy alias for streaming requests.

Example

No specific code example can be provided without modifying the existing langfuse_otel callback, but a potential approach could involve overriding the model identifier in the callback:

# Hypothetical example, actual implementation may vary
def langfuse_otel_callback(request):
    # ...
    if request.stream:
        # Override model identifier with proxy alias
        model_identifier = request.model_name
    else:
        model_identifier = get_upstream_model_identifier()
    # Log using model_identifier

Notes

The exact solution depends on the internal workings of the langfuse_otel callback and how it interacts with LiteLLM's proxy functionality. The provided steps are guidance toward identifying and potentially resolving the issue.

Recommendation

Apply a workaround by modifying the langfuse_otel callback to correctly handle streaming requests, as upgrading to a fixed version is not explicitly mentioned as an option in the provided issue context.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING