Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the ability to set the key based on the model #42

Closed
ishaan-jaff opened this issue Aug 3, 2023 · 6 comments
Closed

Add the ability to set the key based on the model #42

ishaan-jaff opened this issue Aug 3, 2023 · 6 comments

Comments

@ishaan-jaff
Copy link
Contributor

Usage

litellm.set_key(model)

Reason:
Not everyone sets their keys in OPENAI_API_KEY, eg openai.api_key = get_api_key("OPENAI")

litellm should handle setting the appropriate env variables for a given model

@krrishdholakia
Copy link
Contributor

should it just be litellm.api_key ? like on openai

@krrishdholakia
Copy link
Contributor

nvm you're right.. how about this

import litellm 

litellm.api_keys = {"openai": key, "azure": key..}

@krrishdholakia
Copy link
Contributor

import litellm 

litellm.openai_key = "sk-..."

litellm.azure_key = "..."

alternative.. i think thisi is a bit cleaner

@krrishdholakia
Copy link
Contributor

better for cases where you have maybe 1-2 alt keys, probably less ideal for a batch but i presume that case is lesser

@krrishdholakia
Copy link
Contributor

499d626

should address this

@krrishdholakia
Copy link
Contributor

@ishaan-jaff close the ticket if this works for your case

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

No branches or pull requests

2 participants