Skip to content

feat(github-copilot): Add Embedding API support - #17278

Merged
1 commit merged into
BerriAI:mainfrom
codgician:ghcopilot-embeddings
Dec 2, 2025
Merged

feat(github-copilot): Add Embedding API support#17278
1 commit merged into
BerriAI:mainfrom
codgician:ghcopilot-embeddings

Conversation

@codgician

@codgician codgician commented Nov 29, 2025

Copy link
Copy Markdown
Contributor

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-002
  • text-embedding-3-small
  • text-embedding-3-small-inference

(They seem to have the same underlying model anyway).

image

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

  • I have Added testing in the tests/litellm/ directory, Adding at least 1 test is a hard requirement - see details
  • I have added a screenshot of my new test passing locally
  • My PR passes all unit tests on make test-unit
  • My PR's scope is as isolated as possible, it only solves 1 specific problem

Type

🆕 New Feature

Changes

Added support for GitHub Copilot Embeddings API. The implementation:

  • Created GithubCopilotEmbeddingConfig to handle embedding requests for models like text-embedding-ada-002 and text-embedding-3-small.
  • Fixed a routing precedence issue in main.py to ensure custom_llm_provider="github_copilot" is respected even for known OpenAI model names.
  • Implemented automatic list wrapping for string inputs to match API requirements.
  • Reused existing OAuth authenticator for seamless integration.
  • Extracted some common constants and copilot default headers into common_utils.py, so it could be shared for different model implementations for GitHub Copilot.

A working LiteLLM proxy configuration:

model_list:
- model_name: text-embedding-ada-002
  model_info:
    mode: embedding
  litellm_params:
    extra_headers:
      editor-plugin-version: copilot/1.388.0
      editor-version: vscode/1.106.2
    model: github_copilot/text-embedding-ada-002
- model_name: text-embedding-3-small
  model_info:
    mode: embedding
  litellm_params:
    extra_headers:
      editor-plugin-version: copilot/1.388.0
      editor-version: vscode/1.106.2
    model: github_copilot/text-embedding-3-small
- model_name: text-embedding-3-small-inference
  model_info:
    mode: embedding
  litellm_params:
    extra_headers:
      editor-plugin-version: copilot/1.388.0
      editor-version: vscode/1.106.2
    model: github_copilot/text-embedding-3-small-inference

@vercel

vercel Bot commented Nov 29, 2025

Copy link
Copy Markdown

@codgician is attempting to deploy a commit to the CLERKIEAI Team on Vercel.

A member of the Team first needs to authorize it.

@CLAassistant

CLAassistant commented Nov 29, 2025

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@codgician
codgician force-pushed the ghcopilot-embeddings branch 4 times, most recently from 01b858e to b4fb69b Compare November 29, 2025 15:41
@codgician
codgician marked this pull request as ready for review November 29, 2025 15:55
@codgician
codgician marked this pull request as draft November 29, 2025 16:05
@codgician
codgician force-pushed the ghcopilot-embeddings branch from b4fb69b to 00dd3f5 Compare November 29, 2025 16:09
@codgician
codgician force-pushed the ghcopilot-embeddings branch from 00dd3f5 to a483416 Compare November 29, 2025 16:31
@codgician
codgician marked this pull request as ready for review November 29, 2025 16:37
@codgician

Copy link
Copy Markdown
Contributor Author

The failing test tests/test_litellm/llms/bedrock/test_anthropic_beta_support.py is unrelated to this change and fails without this commit.

@ghost

ghost commented Dec 2, 2025

Copy link
Copy Markdown

@codgician this looks good to me. can you file a follow up PR to document embedding api support on here -

?

This will allow others to know this exists as well

@ghost
ghost merged commit e09e309 into BerriAI:main Dec 2, 2025
4 of 6 checks passed
@codgician

Copy link
Copy Markdown
Contributor Author

@codgician this looks good to me. can you file a follow up PR to document embedding api support on here -

?

This will allow others to know this exists as well

Sure, I'll look into it this week.

This pull request was closed.
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.

[Feature]: Github Copilot support /embeddings endpoint

2 participants