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.
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.