Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR refactors how API keys are supplied by removing them from each model's metadata and centralizing them in the ENV_VARS block.
- Uncomment loading of
OPENAI_API_KEYandANTHROPIC_API_KEYinENV_VARS - Remove
api_keyentries from each model'slitellm_params
Comments suppressed due to low confidence (2)
src/scripts/deploy.py:55
- Removing the per-model
api_keyfromlitellm_paramswill prevent each model from receiving credentials unless you explicitly inject them elsewhere. Consider updating the model initialization to merge in the global API key (e.g., add a lookup forENV_VARS["ANTHROPIC_API_KEY"]orENV_VARS["OPENAI_API_KEY"]).
"litellm_params": {
src/scripts/deploy.py:19
- Add an explicit validation step for
OPENAI_API_KEYandANTHROPIC_API_KEYat startup (e.g., checkos.getenvand raise a clear error) rather than relying on a rawKeyErrorwhen accessingos.environ. This provides more user-friendly diagnostics.
"OPENAI_API_KEY": os.environ["OPENAI_API_KEY"],
jamesbraza
reviewed
May 23, 2025
| "model_name": "anthropic/claude-3-7-sonnet-20250219", | ||
| "litellm_params": { | ||
| "model": "anthropic/claude-3-7-sonnet-20250219", | ||
| "api_key": os.environ["ANTHROPIC_API_KEY"], |
There was a problem hiding this comment.
Any chance you can add a ValueError special case somewhere if there is an api_key in litellm_params? Just thinking about catching this moving forward
Contributor
Author
There was a problem hiding this comment.
we can totally do that on the server side of the platform 🫡
mskarlin
approved these changes
May 23, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.