feat(github-copilot): Add Embedding API support #17278
Merged
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.
Title
Adds Embedding API support for GitHub Copilot's embedding models. According to the GitHub Copilot API, you can specify model ID as:
text-embedding-ada-002text-embedding-3-smalltext-embedding-3-small-inference(They seem to have the same underlying model anyway).
I'm new to this project and the coding work is aided by AI. Please let me know if the current implementation fits the coding standard.
Relevant issues
Fixes #13564
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
tests/litellm/directory, Adding at least 1 test is a hard requirement - see detailsmake test-unitType
🆕 New Feature
Changes
Added support for GitHub Copilot Embeddings API. The implementation:
GithubCopilotEmbeddingConfigto handle embedding requests for models liketext-embedding-ada-002andtext-embedding-3-small.main.pyto ensurecustom_llm_provider="github_copilot"is respected even for known OpenAI model names.common_utils.py, so it could be shared for different model implementations for GitHub Copilot.A working LiteLLM proxy configuration: