Docs

VS Code and Copilot.

In VS Code, models come in through Copilot Chat, so configuring VS Code and configuring Copilot are the same thing. Copilot accepts models of your own through its Custom Endpoint provider, which speaks the OpenAI format. That is exactly what NaN serves.

What changes and what does not

This affects chat and agent mode. Inline completion, those grey suggestions as you type, stays Copilot’s and cannot be redirected. Same with semantic search and anything that depends on GitHub’s embeddings: they still need your account.

What you need

A version of VS Code with the Custom Endpoint provider (it arrived in 1.122; before that there was a github.copilot.chat.customOAIModels setting which is now deprecated), the Copilot Chat extension installed, and your NaN API key.

Configuration

Open the model editor

In the chat’s model picker, click the gear. Or open the command palette and look for Chat: Manage Language Models.

Add a provider

Choose Add Models and then Custom Endpoint.

It will ask for a group name, a display name and the API key. Put NaN as the name and paste your key, the one that starts with sk-.

When it asks for the API type, choose Chat Completions.

Declare the models

A chatLanguageModels.json file opens. Leave it like this:

[
  {
    "name": "NaN",
    "vendor": "customendpoint",
    "apiKey": "${input:nanApiKey}",
    "apiType": "chat-completions",
    "models": [
      {
        "id": "deepseek-v4-flash",
        "name": "DeepSeek V4 Flash",
        "url": "https://api.nan.builders/v1/chat/completions",
        "toolCalling": true,
        "vision": true,
        "maxInputTokens": 1015807,
        "maxOutputTokens": 32768
      },
      {
        "id": "glm5.3-flash",
        "name": "GLM 5.3 Flash",
        "url": "https://api.nan.builders/v1/chat/completions",
        "toolCalling": true,
        "vision": true,
        "maxInputTokens": 1015808,
        "maxOutputTokens": 32768
      },
      {
        "id": "qwen3.8-flash",
        "name": "Qwen 3.8 Flash",
        "url": "https://api.nan.builders/v1/chat/completions",
        "toolCalling": true,
        "vision": true,
        "maxInputTokens": 229376,
        "maxOutputTokens": 32768
      },
      {
        "id": "mimo-v2.5",
        "name": "Xiaomi MiMo V2.5",
        "url": "https://api.nan.builders/v1/chat/completions",
        "toolCalling": true,
        "vision": true,
        "maxInputTokens": 1015808,
        "maxOutputTokens": 32768
      },
      {
        "id": "gemma4",
        "name": "Gemma 4",
        "url": "https://api.nan.builders/v1/chat/completions",
        "toolCalling": true,
        "vision": true,
        "maxInputTokens": 196608,
        "maxOutputTokens": 65536
      },
      {
        "id": "qwen3.6",
        "name": "Qwen 3.6",
        "url": "https://api.nan.builders/v1/chat/completions",
        "toolCalling": true,
        "vision": true,
        "maxInputTokens": 196608,
        "maxOutputTokens": 65536
      },
      {
        "id": "glm5.3",
        "name": "GLM 5.3 (premium)",
        "url": "https://api.nan.builders/v1/chat/completions",
        "toolCalling": true,
        "vision": false,
        "maxInputTokens": 1015808,
        "maxOutputTokens": 32768
      }
    ]
  }
]

Pick the model and try it

Open the chat, drop down the model picker and choose one of the ones you just added. Ask it for something short. If it answers, it is going out through the cluster.

Three details that matter

  • The url is the full one, with /chat/completions at the end. This is unlike the other tools, where you only put the base. VS Code appends the path on its own depending on the API type, and giving it the whole thing keeps it from getting that wrong.
  • toolCalling: true is what enables agent mode. Without it, the model shows up in chat but cannot use tools or edit files.
  • maxInputTokens is the window minus the output budget. VS Code ADDS the two and treats the sum as the context window, so the numbers above are context - maxOutputTokens. Publishing the full window as the input budget with an output budget on top, which is what these docs did before, made VS Code believe the model held 25% more than it does: it showed context usage against that number and let the conversation grow until the proxy returned a context-length error mid-session, with no compaction warning and pointing at the wrong thing.

The key

"apiKey": "${input:nanApiKey}" makes VS Code ask you for it and keep it in its secret store, instead of leaving it written in the file. That is what you want: that file easily ends up in a repository or a backup.

glm5.3-flash for agent mode, which is where long context matters. deepseek-v4-flash for chat questions. qwen3.8-flash if you prefer fast answers.

glm5.3 only answers if you have the premium tier. It is in the block with "vision": false, which is not a preference: it is the one model that does not accept images.

Known issues
  • Autocomplete does not change. It is Copilot’s and cannot be redirected to another provider. If what you want is for inline suggestions to come out of NaN, the tool is Zed, which does allow it.
  • Some features still ask for a GitHub account, such as semantic search over the repository. It is not a problem with your key.
  • The provider arrived in 1.122. Earlier versions had a github.copilot.chat.customOAIModels setting which is now deprecated: if you have it set, remove it and use the provider.
  • If the model shows up but does not edit files, it is almost always toolCalling missing or set to false.
Copilot outside VS Code

This page covers Copilot inside VS Code, which is where the Custom Endpoint provider lives. Copilot in JetBrains, in Visual Studio or in its CLI does not offer the same custom endpoint mechanism.

If you work in JetBrains, the way to use NaN is another plugin that accepts an OpenAI base URL, or Continue, which does have a JetBrains version.

nan.builders © 2026
Copied to clipboard