Skip to content

Conversation

avirajsingh7
Copy link

@avirajsingh7 avirajsingh7 commented Sep 1, 2025

Target Issue : #190

This PR fixes a limitation in litellmmodel where API credentials had to be provided exclusively via environment variables. Even if api_key (or api_base, api_version) was passed during initialization, it was never forwarded to validate_environment or validate_access, causing errors such as:

Required environment variable (keys) from the model are Missing. 
missing_keys: ['OPENAI_API_KEY']

Changes

  • Updated validate_environment and validate_access to forward api_key, api_base, and api_version from kwargs.
  • This allows per-request credential injection instead of relying only on global environment variables.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant