litellm - 💡(How to fix) Fix [Feature]: support passing api keys through sdk instead of environment for langfuse otel integrarion [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

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#26760Fetched 2026-04-30 06:20:19
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
0
Author
Participants
Timeline (top)
labeled ×2
RAW_BUFFERClick to expand / collapse

Check for existing issues

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

The Feature

langfuse otel integration supports taking keys and host only from env. it should be enabled to explictly pass these params when initializing client/calling acompletion and only derive params from env as fallback

Motivation, pitch

it is a better practice security wise to not export keys to env

What part of LiteLLM is this about?

SDK (litellm Python package)

LiteLLM is hiring a founding backend engineer, are you interested in joining us and shipping to all our users?

No

Twitter / LinkedIn details

No response

extent analysis

TL;DR

Modify the langfuse otel integration to allow explicit passing of keys and host parameters when initializing the client or calling a completion, using environment variables as a fallback.

Guidance

  • Review the current implementation of the langfuse otel integration in the LiteLLM Python package to identify where environment variables are being used to derive keys and host.
  • Update the client initialization and completion calling functions to accept explicit keys and host parameters.
  • Implement a fallback mechanism to use environment variables when explicit parameters are not provided.
  • Consider adding input validation to ensure that either explicit parameters or environment variables are set to avoid errors.

Example

# Example of updated client initialization with explicit parameters
def initialize_client(keys=None, host=None):
    if keys is None:
        keys = os.environ.get('KEYS')
    if host is None:
        host = os.environ.get('HOST')
    # ... rest of the initialization code ...

Notes

The exact implementation details may vary depending on the current code structure and requirements of the langfuse otel integration.

Recommendation

Apply workaround: Update the langfuse otel integration to support explicit parameter passing, as this provides better security practices by not relying solely on environment variables.

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