feat: support configuring api_key and api_base via environment variables#9484
feat: support configuring api_key and api_base via environment variables#9484coding-ninja-afk wants to merge 2 commits intoBerriAI:mainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
ishaan-jaff
left a comment
There was a problem hiding this comment.
please add a test here's the checklist: https://docs.litellm.ai/docs/extras/contributing_code#checklist-before-submitting-a-pr
|
Thanks for your work @freshman829. Can you explain the problem a bit more? You can already set the env var for any provider specific credential |
Sure! While litellm allows provider-specific env vars, this change standardizes base-level config (api_key, api_base) across deployments—especially useful in Docker/CI environments where we don’t want to hardcode values or rely on provider-specific keys unless necessary. |
Added unit testing for my update |
|
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. |
What does this PR do?
litellm.api_keyandlitellm.api_basevia environment variablesLITELLM_API_KEYandLITELLM_API_BASE.Why is this useful?
.envor runtime environment injectionWhat's included:
__init__.pyREADME.mdsection added under UsageHappy to iterate on feedback!