litellm icon indicating copy to clipboard operation
litellm copied to clipboard

feature: Allow config litellm.api_key and litellm.api_base by environment variables

Open viralbhadeshiya opened this issue 9 months ago • 2 comments

Title

Allow config api_key & api_base by environment variable

Relevant issues

Feature #9075

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • [ ] I have Added testing in the tests/litellm/ directory, Adding at least 1 test is a hard requirement - see details
  • [x] I have added a screenshot of my new test passing locally
  • [x] My PR passes all unit tests on (make test-unit)[https://docs.litellm.ai/docs/extras/contributing_code]
  • [x] My PR's scope is as isolated as possible, it only solves 1 specific problem

Type

🆕 New Feature

Changes

  • Added support to read api_base & api_key form env variables. It will overwrite if these variable are specifically provided in code.
  • Added Module notes so user can see it in function description.
  • Unit test case result: Code 2025-03-13 11 17 10

viralbhadeshiya avatar Mar 13 '25 18:03 viralbhadeshiya

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
litellm ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 13, 2025 6:21pm

vercel[bot] avatar Mar 13 '25 18:03 vercel[bot]

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Apr 22 '25 22:04 CLAassistant

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

github-actions[bot] avatar Jul 24 '25 00:07 github-actions[bot]