# GitHub Copilot

This document explains how to configure GitHub Copilot (shared seat) as the LLM provider for yCrash AI chat.

Note

After you create ycbuddy-config.json, place it in the upload directory and restart yCrash as described in the Introduction.

Use a single GitHub account that has an active Copilot subscription. yCrash exchanges that GitHub token for a short-lived Copilot session token and streams chat completions from GitHub Copilot's API.

This is a shared-seat setup: all yCrash AI chat usage is billed against that one Copilot subscription.


# Step 1: Get a GitHub Token with Copilot Access

Create a GitHub token for the shared Copilot seat. Supported token types:

Token prefix Supported
gho_ (OAuth access token) Yes
ghu_ (user-to-server token) Yes
github_pat_ (fine-grained PAT with Copilot access) Yes - sent directly to the Copilot API (no session-token exchange)
ghp_ (classic PAT) No

Store the token in a secrets manager or restricted server directory. Treat it like a password - do not email it, commit it to Git, or share it in tickets.


# Step 2: Add the Copilot Settings

Paste the following JSON into ycbuddy-config.json and replace your-github-token-with-copilot with the token from Step 1:

{
  "llmProvider": "copilot",
  "llmApiKey": "your-github-token-with-copilot",
  "llmModelName": "gpt-4o",
  "llmEmbeddingModelName": "local-all-minilm-l6-v2-q",
  "llmMaxOutputTokens": 4096
}
1
2
3
4
5
6
7
Field Required Notes
llmProvider Yes Must be "copilot"
llmApiKey Yes GitHub token for the shared Copilot seat (gho_, ghu_, or fine-grained github_pat_ with Copilot access). You can also set LLM_API_KEY, COPILOT_GITHUB_TOKEN, or GH_TOKEN.
llmModelName Yes Copilot-hosted model id (e.g. gpt-4o, gpt-4.1). Availability depends on the Copilot plan.
llmEmbeddingModelName Yes Prefer local-all-minilm-l6-v2-q so RAG does not need a separate Gemini/OpenAI embedding key.
llmMaxOutputTokens No Soft cap on completion tokens (default 4096)
llmEndpoint No Optional Copilot API base override (defaults to https://api.githubcopilot.com, or the endpoint returned by token exchange).

Notes:

  • Copilot has no provider Files API. Chat attachments are stored locally (LOCAL_ONLY) and included in chat via existing context extraction.
  • Placement, restart, and verification steps are the same as in the Introduction.

# Step 3: Place the File and Restart

Place ycbuddy-config.json in the yCrash upload directory and restart the server. See the Introduction for file location, restart, and verification steps.


# Troubleshooting

Symptom Likely cause
Log: Unsupported LLM provider Typo in llmProvider (must be exactly copilot)
Auth / token exchange failures Classic ghp_ PAT used (not supported); token missing Copilot access; or Copilot subscription inactive
403 from Copilot API Shared seat has no Copilot license, or the token scopes do not include Copilot

Also confirm:

  • llmProvider is "copilot" (lowercase)
  • Token is gho_, ghu_, or github_pat_ - not ghp_
  • Outbound HTTPS from the yCrash server to GitHub Copilot is allowed (api.githubcopilot.com)

For shared file-placement and restart checks, see the Introduction troubleshooting checklist.