Skip to main content
ValarCode routes VS Code through GitHub Copilot Chat’s bring-your-own-key Custom Endpoint provider. Enabling registers a Valar provider group in Copilot Chat, and you pick a Valar model from its model picker. The group speaks the Anthropic Messages API; the gateway maps whatever model it sends to the target your routing resolves to. See Set up ValarCode for the shared setup and the client-id model.
The VS Code integration uses the copilot harness, so the command is valar copilot. valar vscode is an alias you can use interchangeably; attribution is recorded under the copilot harness either way.

Prerequisites

  • VS Code (the stable build) with GitHub Copilot Chat signed in, and a version new enough to offer the Custom Endpoint provider. Insiders and forks keep their own config and are not routed.
  • A Valar coding key (vlrcode_…) and the valar CLI (install).

Enable routing

Run once per machine:
Then reload the VS Code window and pick a Valar model in Copilot Chat’s model picker. If the group is not listed yet, reload again. Check the state any time:

What gets written

The CLI registers a provider group in Copilot Chat’s model config, chatLanguageModels.json, in the VS Code user directory (~/Library/Application Support/Code/User on macOS, ~/.config/Code/User on Linux), plus one file per additional VS Code profile under profiles/*/. The file is a JSON array of provider groups; the CLI adds a group named Valar:
In detail, enabling:
  • Registers a Valar group under the built-in customendpoint vendor, with apiType: "messages" so the group speaks the Anthropic Messages dialect. The group’s models list is the picker; you choose a Valar model there yourself.
  • Writes the full per-model endpoint https://api.valarhq.ai/v1/messages on each model, since this vendor has no separate base-URL field.
  • Carries the coding key in the x-api-key request header rather than the vendor’s apiKey field. That field is stored in the OS keychain and cannot be populated by an external writer, so the key rides as a request header instead; the gateway authenticates it like a bearer token.
  • Adds X-Valar-Harness: copilot, X-Valar-Client-Id and X-Valar-Cli-Version to each model’s requestHeaders for attribution.
On the first enable, the files it touches are snapshotted to ~/.valar/copilot/backup.json. A VS Code profile you create later is routed by the next on and un-routed by off on the Valar marker, without a snapshot of its own.
The client id defaults to your OS username, so the header reads X-Valar-Client-Id: jdoe. Use --user-id RANDOM for an opaque vc_… id instead. See per-engineer attribution.
A chatLanguageModels.json that contains comments (JSONC) is skipped and reported rather than rewritten, so a hand-edited file is never clobbered. Remove the comments and re-run on to route that profile.

Turn off routing

This restores the pre-enable snapshot and removes the Valar group from any profile it was added to. Reload the VS Code window if the Valar models are still listed in Copilot Chat.

Next steps

Model routing

How cohorts and the split decide which model serves each request.

Analytics

Per-engineer usage and savings, attributed by client id.