litellm - 💡(How to fix) Fix [Bug]: Secret Manager Not called during Invoke in 1.83.7-latest-stable [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#26151Fetched 2026-04-22 07:46:20
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Participants
Timeline (top)
labeled ×3
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?

I am using the litellm proxy server for my llm and mcp management. I have built a custom secret manager with below overridden methods. async def async_read_secret( self, secret_name: str, optional_params: Optional[dict] = None, timeout: Optional[Union[float, httpx.Timeout]] = None, ) -> Optional[str]:

and

def sync_read_secret(
    self,
    secret_name: str,
    optional_params: Optional[dict] = None,
    timeout: Optional[Union[float, httpx.Timeout]] = None,
) -> Optional[str]:

When I register the model using litellm api and add a secret with os.environ/<secret> then the above method are called but the same methods are not called during model invoke due to which the model is returning 401 unauthorized.

This was working properly in with docker image "litellm/litellm:v1.82.3-stable" but i encountered a source_url issue while registering mcp.

Now i am using "ghcr.io/berriai/litellm:v1.83.7-stable" which resolves the mcp registration issue but this has this invoke issue

Steps to Reproduce

  1. register a model azure model with api_key = os.environ/<your_api_key>
  2. Generate Virtual key for the model
  3. invoke the model using chatlitellm from langchain . chat = ChatLiteLLM( model="litellm_proxy/<model_name>", # Use the exact name you added via model/new api_base=<Litellm_Url> api_key=<virtual_key>,
    temperature=0.7,
    max_tokens= 2000, request_timeout=10, )

Invoke will fail.

Relevant log output

What part of LiteLLM is this about?

Proxy

What LiteLLM version are you on ?

v1.83.7

Twitter / LinkedIn details

No response

extent analysis

TL;DR

The issue is likely due to the async_read_secret and sync_read_secret methods not being called during model invocation, causing a 401 unauthorized error, and a potential workaround is to investigate the differences in behavior between the litellm/litellm:v1.82.3-stable and ghcr.io/berriai/litellm:v1.83.7-stable images.

Guidance

  • Investigate the changes between the litellm/litellm:v1.82.3-stable and ghcr.io/berriai/litellm:v1.83.7-stable images to identify potential causes for the difference in behavior.
  • Verify that the async_read_secret and sync_read_secret methods are correctly implemented and registered in the custom secret manager.
  • Check the documentation for the ghcr.io/berriai/litellm:v1.83.7-stable image to see if there are any changes to the way secrets are handled during model invocation.
  • Test the model invocation with a different secret management approach to isolate the issue.

Example

No code example is provided as the issue is more related to the configuration and behavior of the LiteLLM proxy server.

Notes

The issue seems to be specific to the ghcr.io/berriai/litellm:v1.83.7-stable image, and the fact that it worked with the litellm/litellm:v1.82.3-stable image suggests that there might be a regression or a change in behavior that needs to be investigated.

Recommendation

Apply workaround: Investigate the differences between the two images and try to identify the cause of the issue, as upgrading to a different version may not be feasible or may introduce other issues.

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

litellm - 💡(How to fix) Fix [Bug]: Secret Manager Not called during Invoke in 1.83.7-latest-stable [1 participants]