litellm - ✅(Solved) Fix [Bug]: Lemonade Server provider ignores api_key [1 pull requests, 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#25363Fetched 2026-04-09 07:52:31
View on GitHub
Comments
0
Participants
1
Timeline
6
Reactions
0
Participants
Timeline (top)
referenced ×3cross-referenced ×2labeled ×1

Fix Action

Fixed

PR fix notes

PR #25364: fix(lemonade): use configured api_key instead of hardcoded value

Description (problem / solution / changelog)

Problem

Fixes #25363

The Lemonade provider ignores the api_key parameter and always uses the hardcoded string "lemonade". When Lemonade Server is configured with a custom API key via LEMONADE_API_KEY, all requests fail authentication.

Root Cause

In litellm/llms/lemonade/chat/transformation.py, _get_openai_compatible_provider_info() receives api_key as a parameter but ignores it entirely:

# Before — hardcoded key
key = "lemonade"

This is inconsistent with how api_base is handled (which properly falls back through the parameter → env var → default).

Solution

Apply the same fallback pattern used for api_base:

# After — respect configured key with fallback
key = (
    api_key
    or get_secret_str("LEMONADE_API_KEY")
    or "lemonade"
)

This preserves backward compatibility (default "lemonade" still works when no key is configured) while enabling authentication when LEMONADE_API_KEY is set.

Testing

  • Without LEMONADE_API_KEY: behavior unchanged (key = "lemonade")
  • With LEMONADE_API_KEY env var: uses the configured key
  • With api_key in litellm_params: uses the explicitly provided key

Changed files

  • litellm/llms/lemonade/chat/transformation.py (modified, +5/-1)
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?

Lemonade Server supports api keys (https://lemonade-server.ai/docs/server/configuration/#lemond-cli). api_key configured in config.yaml gets ignored by provider as the word "lemonade" is hardcoded as key. Check line 113 in litellm/llms/lemonade/chat/transformation.py

Steps to Reproduce

  1. Setup lemonade-server with LEMONADE_API_KEY set to something.
  2. Configure lemonade provider: model_list:

general_settings: ...

  1. Start LiteLLM and try to use the model (e.g. Open Web UI)

Relevant log output

What part of LiteLLM is this about?

LLM Provider

What LiteLLM version are you on ?

1.82.3

Twitter / LinkedIn details

No response

extent analysis

TL;DR

The issue can likely be fixed by updating the transformation.py file to use the configured api_key instead of the hardcoded "lemonade" key.

Guidance

  • Review line 113 in lemonade/chat/transformation.py to understand how the hardcoded "lemonade" key is being used.
  • Consider updating the transformation.py file to use the api_key configured in config.yaml instead of the hardcoded value.
  • Verify that the LEMONADE_API_KEY environment variable is set correctly and being used in the config.yaml file.
  • Test the updated configuration to ensure that the api_key is being used correctly.

Example

No code example is provided as the issue does not contain sufficient information about the code changes required.

Notes

The fix may require modifying the transformation.py file, which could have unintended consequences. It is recommended to test the changes thoroughly before deploying them to production.

Recommendation

Apply workaround: Update the transformation.py file to use the configured api_key instead of the hardcoded value, as this is the most direct way to address the issue.

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