Downsizing logodownsizing
Documentation

Using Downsizing with GitHub Copilot

Route GitHub Copilot Chat in VS Code through Downsizing using Copilot's "Bring Your Own Key" (BYOK) Custom Endpoint provider.


Prerequisites

Install the Downsizing CLI — see the CLI guide if you haven't already.

Link GitHub Copilot

GitHub Copilot Chat has a documented BYOK "Custom Endpoint" provider: choose Chat: Manage Language Models from the Command Palette (or the gear icon in the Chat model picker), then Add Models → Custom Endpoint. VS Code opens a plain, user-editable JSON file — chatLanguageModels.json— under its own "User" config directory. ds link github-copilot writes to that same file for you:

bash
ds link github-copilot

This adds a "Downsizing" provider entry using the Anthropic Messages API (apiType: "messages") — VS Code's own documented example for this feature is itself an Anthropic Messages-API entry, so no OpenAI/Chat-Completions bridge is needed. It never touches any other custom endpoints you've already configured (e.g. your own Ollama or OpenRouter entries) — it only adds or replaces the single array element named "Downsizing", and takes a one-time backup (chatLanguageModels.json.ds-backup) the first time it runs.

Reload or restart VS Code, then open the Chat view and pick Downsizing from the model picker.

Important limitation

Per GitHub's own documentation, BYOK only applies to Copilot Chat — the chat panel and Agent/Plan/Edit modes. It does notapply to inline code completions ( "ghost text" suggestions as you type), which always run on GitHub's own infrastructure and cannot be redirected to an external endpoint. This is a limitation of GitHub Copilot itself, not of Downsizing's proxy.

Copilot also offers a separate BYOK preview for JetBrains IDEs and Xcode, but it is configured through GitHub organization/enterprise Copilot policy settings on github.com — a server-side, admin-managed provider allow-list, not a local, per-user config file. There is nothing for ds to write there, so this integration covers VS Code only.

Manual Setup

You can configure GitHub Copilot manually without running the CLI. Run Chat: Manage Language Models → Add Models → Custom Endpoint in VS Code, then edit the JSON file it opens to add an entry like:

json
{
  "name": "Downsizing",
  "vendor": "customendpoint",
  "apiKey": "YOUR_DOWNSIZING_API_KEY",
  "apiType": "messages",
  "models": [
    {
      "id": "claude-opus-4-8",
      "name": "Downsizing (claude-opus-4-8)",
      "url": "https://api.downsizing.dev/YOUR_ROUTER_ID/anthropic/v1/messages",
      "toolCalling": true,
      "vision": true,
      "maxInputTokens": 200000,
      "maxOutputTokens": 64000
    }
  ]
}

Find your Router ID and API key on the Inference API page.

Verify

Open the Copilot Chat view in VS Code, select Downsizing in the model picker, and send a message to confirm traffic is routing through Downsizing. If Copilot responds normally, Downsizing is set up correctly. You can also check your savings dashboard to see the request appear in your usage metrics.

Unlinking

Removes just the "Downsizing" entry from chatLanguageModels.json, leaving any other custom endpoints you've configured untouched:

bash
ds unlink github-copilot

Spot an error or something not working? Tell us on Discord or email docs@downsizing.dev.