Repository navigation
feat: Add Copilot chat and embeddings via LiteLLM - #2634
Merged
Merged
Conversation
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
4 tasks done
Gaudy Blanco (gaudyb)
approved these changes
Nov 25, 2026
Preserve upstream LiteLLM response typing and provider embedding-model normalization. Co-authored-by: Copilot App <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Allow LiteLLM completion and embedding providers to own authentication explicitly
through
auth_method: provider. This supports providers such as LiteLLM'sgithub_copilotwithout requiring a GraphRAG-configured API key or a separateSDK completion provider.
Requests continue through GraphRAG -> LiteLLM -> the provider API. LiteLLM owns
login, credential caching, refresh, and transport; GraphRAG does not copy or
manage provider tokens. Existing API-key and Azure-managed-identity modes remain.
Related Issues
Related earlier approach: #2616 (closed). This same-repository contribution
supersedes the separate Copilot SDK provider proposal with provider-managed
authentication in the existing LiteLLM completion and embedding integrations.
It is a different implementation, not a relocation of the SDK patch.
Proposed Changes
AuthMethod.Providerand configuration validation. Omit GraphRAG'sapi_keyargument in both synchronous and asynchronous completion/embeddingrequests when this mode is selected.
overrides, and authentication headers in provider mode at configuration and
request boundaries, while retaining non-authentication headers and arguments.
Log a warning and omit unavailable cost metrics rather than reporting zero.
the model sent in the request, preserving any returned model identifier.
device login, and generated-settings changes needed to remove API-key
placeholders. Add a minor release note and focused regression tests.
tests do not inherit its temporary directory.
Checklist
Additional Notes
Validation
Validation below applies to branch head
2387a929f46f5fc0e2f77c36e78e3cbd1449a250, not the original SDK provider.uv run --no-sync pytest tests\unit\language_model\test_provider_auth.py tests\unit\language_model\test_provider_costs.py tests\unit\config -q-- passed locally: 87 tests.
uv run --no-sync poe check-- passed locally: 679 files formatted,Ruff clean, Pyright 0 errors/0 warnings.
uv run poe test_unit-- passed (Linux: 438 passed, 1 skipped);uv run poe test_verbs-- passed (Linux: 15 passed).The workflow succeeded on Linux and Windows.
uv run poe checkanduv build --all-packages-- passed acrossPython 3.11/3.13 on Linux and Windows.
spellcheck,
and semver checks -- passed.
and smoke CI
-- failed. Linux logs show 11 failed/1 passed notebooks and 2 failed
smoke cases, rejecting missing Azure
api_basebefore inference. These areAzure test configurations, not evidence of live Copilot provider compatibility.
Creating a same-repository PR does not itself establish that these checks pass;
results from its newly triggered runs must be evaluated separately.
performed as part of this PR preparation. Mocked regressions and existing CI
are not a live model/endpoint compatibility guarantee.
Authentication and provider limitations
type: litellm,model_provider: github_copilot, andauth_method: providerfor the relevant completion and embedding models.Remove
api_keyentirely, including generated${GRAPHRAG_API_KEY}entries.Copilot CLI login. Provision the provider's authentication before unattended
execution. Provider mode does not imply every LiteLLM provider supports
keyless authentication, nor does it disable environment variables or
credential stores used internally by LiteLLM.
support, and generation capabilities remain dependent on the selected
LiteLLM provider/model and workflow requirements. This patch does not add
native SDK schema enforcement, a new JSON-output contract, or the original
SDK adapter's runtime/session behavior.
a zero-cost or Copilot subscription-billing estimate.