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

Simplify API Token usage #31

Merged
merged 1 commit into from
Jun 15, 2024
Merged

Simplify API Token usage #31

merged 1 commit into from
Jun 15, 2024

Conversation

petermuller
Copy link
Contributor

We were accidentally only supporting the Azure format keys emitted from the Continue plugin instead of supporting keys how the OpenAI API natively uses them. OpenAI uses the Authorization: Bearer ${token} format for its keys, which is what we already support for IdP auth. To support this, it just means that we need to check the Bearer token is an API key before trying to validate that it's a token from the identity provider instead.

This set of changes makes it so that we do pay attention to the Bearer token as a potential API token source, and that allows us to simplify our instructions and examples since the bearer token header will be added automatically for any OpenAI library that solicits an api_key as a parameter. The README, example notebook, and custom Embeddings client have been updated to reflect these changes.

NOTE: we still need the "ignored" API keys for the LiteLLM settings, since that's the serverside configuration, and none of our hosted models require a key on their end. It is only the REST API container that demands the API key (or form of auth), which is what these changes target.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@petermuller petermuller requested a review from estohlmann June 14, 2024 23:25
@petermuller petermuller self-assigned this Jun 14, 2024
@petermuller petermuller merged commit e9572b7 into main Jun 15, 2024
2 checks passed
@petermuller petermuller deleted the feature/openai-tokens branch June 15, 2024 00:25
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.

2 participants