Skip to content

[Bug]: LiteLLM shouldn't retried when the error is an authentification error and should log them when debug is on #18395

@Butanium

Description

@Butanium

What happened?

I was wondering why my code was not working, I was dumb and didn't set my anthropic variable. After several minutes of waiting, I finally got the error message:

litellm.exceptions.AuthenticationError: litellm.AuthenticationError: Missing Anthropic API Key - A call is being made to anthropic but no key is set either in the environment variables or via params. Please set `ANTHROPIC_API_KEY` in your environment vars

I have 2 complains:

  1. _turn_on_debug should log errors before retrying
  2. litellm.Authentification error should raise directly and not retry

Relevant log output

What part of LiteLLM is this about?

SDK (litellm Python package)

What LiteLLM version are you on ?

v1.80.0

Twitter / LinkedIn details

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions