VS Code
Run your Erebine models as native VS Code chat models. The downloaded bundle ships a model manifest plus a ready-to-run Language Model Chat Provider extension that streams answers and tool calls through the standard OpenAI-compatible endpoint.
Overview
VS Code has no configuration file that registers chat
models on its own. Models are contributed by an
extension that registers a
Language Model Chat Provider
and returns its models in code. The Erebine vscode
bundle ships both halves: a
chatLanguageModels.json manifest (the data)
and a ready-to-run provider extension under
erebine-lm-provider/ (the code that loads
it).
The extension reads the manifest from your workspace, registers each model in the VS Code chat model picker, and proxies requests to your Erebine Chat Completions endpoint. Streaming and tool calls travel through the standard OpenAI-compatible adapter.
Two surfaces, one bundle. The same
vscode bundle also carries an
MCP server config
(.vscode/mcp.json) for the workspace
tool catalog. Models flow through the provider
extension; tools flow through MCP. They are
independent and can be used together.
Prerequisites
- VS Code 1.104 or newer (the Language Model Chat Provider API)
- A Erebine account with an active endpoint
- An API key with
inferencescope - For packaging the extension:
npx @vscode/vsce(no global install required)
Downloading the Bundle
From your Erebine dashboard, open the workspace
Client tab and download the
VS Code configuration bundle. The
bundle is generated for the selected workspace and
endpoint, so the manifest already carries your
baseURL, model list, and a freshly minted
API key.
Finding Your Endpoint URL
The endpoint URL follows the format:
https://api.erebine.ai/proj_ABC123/WORKSPACE_ID/ENDPOINT_SLUG/v1
Replace WORKSPACE_ID with your
ws_-prefixed workspace ID and
ENDPOINT_SLUG with the slug shown on your
endpoint's detail page. The project ID
(proj_ABC123) is visible in your
dashboard URL and project settings. The workspace prefix
scopes the request to that workspace; this is the form the
downloaded manifest uses.
To route across every generative endpoint in a workspace instead of naming one slug, use the semantic-routed base URL. The router picks the endpoint that best matches each request:
https://api.erebine.ai/proj_ABC123/WORKSPACE_ID/_semantic/router/v1
Replace WORKSPACE_ID with your
ws_-prefixed workspace ID. See
Semantic Router
for the full request shape.
The router picks the endpoint per request, so the serving model can change
between turns. The
X-Erebine-Routed-Model
response header names what served each turn, and
Pin a Conversation
covers how a multi-turn thread is held on one model.
Bundle Contents
The downloaded VS Code bundle contains:
| File | Destination | Purpose |
|---|---|---|
chatLanguageModels.json |
.vscode/chatLanguageModels.json |
The model manifest the provider extension loads. |
erebine-lm-provider/ |
anywhere (load via F5 or package) | The ready-to-run provider extension (package.json + extension.js). |
vscode-mcp.json |
.vscode/mcp.json |
The workspace MCP server config. See MCP. |
copilot-instructions.md |
.github/copilot-instructions.md |
Project-rules block that nudges Copilot Chat to use the workspace MCP tools. |
README.txt |
(read me) | Setup, install paths, and troubleshooting for this bundle. |
The manifest carries your API key.
Add .vscode/chatLanguageModels.json to
your project's .gitignore so the key
does not land in version control. Re-downloading
the bundle rotates the key.
Model Manifest
Save chatLanguageModels.json at
.vscode/chatLanguageModels.json in your
project. Its shape mirrors VS Code's
LanguageModelChatInformation so the
provider maps each entry across one-to-one.
{
"vendor": "erebine",
"displayName": "Erebine - proj_ABC123",
"provider": {
"baseURL": "https://api.erebine.ai/proj_ABC123/WORKSPACE_ID/my-endpoint/v1",
"apiKey": "ere_my-project_abc123",
"headers": {
"X-Erebine-Augment-Corrective-Retries": "on"
}
},
"models": [
{
"id": "my-endpoint-slug",
"name": "deepseek-r1-distill-llama-70b",
"family": "deepseekr1",
"version": "1.0.0",
"maxInputTokens": 131072,
"maxOutputTokens": 32000,
"capabilities": {
"toolCalling": true,
"imageInput": false
}
}
]
}
Capabilities are data-driven.
toolCalling reflects whether the
deployed model's family exposes a tool-call parser.
imageInput is false; the
platform is text-only for now.
maxInputTokens and
maxOutputTokens are emitted from the
endpoint's advertised context and output ceilings.
Provider Extension
The erebine-lm-provider/ folder is a
complete, plain-JavaScript VS Code extension. There is
no build step: package.json points
main at extension.js, which
runs directly in VS Code's Node runtime.
The extension's package.json declares the provider:
{
"main": "./extension.js",
"engines": { "vscode": "^1.104.0" },
"activationEvents": ["onStartupFinished"],
"contributes": {
"languageModelChatProviders": [
{ "vendor": "erebine", "displayName": "Erebine" }
]
}
}
On activation the extension calls
vscode.lm.registerLanguageModelChatProvider("erebine", provider)
and implements the three provider methods:
provideLanguageModelChatInformationreads.vscode/chatLanguageModels.jsonfrom the active workspace and returns oneLanguageModelChatInformationpermodels[]entry.provideLanguageModelChatResponsetranslates the VS Code messages and tools into OpenAI shape, POSTs toprovider.baseURL+/chat/completionswithAuthorization: Bearer <apiKey>plus anyprovider.headerscarried in the manifest, and streams text and tool-call frames back through the progress reporter.provideTokenCountreturns a length-based estimate.
Generated reference code. The
extension is yours to adapt. A production build can
move the API key into VS Code SecretStorage and
keep only baseURL + models in the
manifest; the shipped extension.js
reads the key from the manifest for zero setup.
Installing the Extension
Pick whichever path fits your workflow.
Quick try (Extension Development Host)
Open the erebine-lm-provider folder in VS
Code and press F5. A second VS Code window
launches with the provider active. Open your project in
that window so it can see
.vscode/chatLanguageModels.json.
Install for everyday use
From inside the erebine-lm-provider folder:
npx @vscode/vsce package
code --install-extension erebine-lm-provider-0.0.1.vsix
Reload VS Code, then open the chat model picker. The Erebine models appear under the Erebine provider.
Proposed-API fallback. If
activation reports the provider API is a proposed
API on your build, add
"enabledApiProposals": ["languageModelChatProvider"]
to package.json and launch with
--enable-proposed-api erebine.erebine-lm-provider.
If it instead reports an unknown proposal, your
build already has the stable API; remove that line.
MCP
The bundle also carries the Erebine MCP server config
for the workspace tool catalog (memory, intelligence,
artifacts, code, governed execution). VS Code reads MCP
server definitions from the top-level
servers field.
{
"servers": {
"erebine": {
"type": "http",
"url": "https://api.erebine.ai/proj_ABC123/v1/mcp",
"headers": {
"Authorization": "Bearer ere_my-project_abc123",
"X-Erebine-Workspace": "<workspace_external_id>"
}
}
}
}
Replace <workspace_external_id> with the
ws_-prefixed workspace identifier (list
candidates with erectl workspaces list); the
project id belongs only in the URL path.
Save it at .vscode/mcp.json and reload the
window so the Copilot Chat MCP picker refreshes. The
MCP block coexists with the provider extension: chat
completions flow through the extension while tool-call
traffic reaches the workspace surface over MCP. See the
general MCP integration
documentation for the full tool catalog and the
security gates that apply to every MCP request.
Field Reference
The following tables describe each field in chatLanguageModels.json.
// rootProvider Block
| Field | Type | Description |
|---|---|---|
vendor |
string | Provider id. Matches the vendor in the extension's contributes.languageModelChatProviders and the registration call. Always erebine. |
displayName |
string | Human-readable provider label. The bundle uses Erebine - <workspace_external_id>. |
provider.baseURL |
string | Erebine endpoint URL including project ID, workspace ID, and endpoint slug. Must end with /v1. The extension appends /chat/completions. |
provider.apiKey |
string | Bearer API key. The extension sends it as Authorization: Bearer <apiKey>. |
provider.headers |
object | Optional constant headers the extension forwards on every request. The bundle ships X-Erebine-Augment-Corrective-Retries: on here so a malformed or empty model turn is retried a bounded number of times. Remove it for strict passthrough; do NOT put the API key here (see provider.apiKey). |
// models[]Model Fields
Each entry in models[] maps to a VS Code
LanguageModelChatInformation shown in the
chat model picker.
| Field | Type | Description |
|---|---|---|
id |
string | Stable model identifier within the provider (the endpoint slug). Sent as model in the request body. |
name |
string | Display name shown in the model picker. |
family |
string | Model-family grouping label (the deployed model's architecture, e.g. deepseekr1). Falls back to the vendor when unknown. |
version |
string | Model version label. The bundle emits a stable placeholder; adjust freely. |
maxInputTokens |
integer | Maximum context-window size in tokens. Emitted from the endpoint's advertised context ceiling. |
maxOutputTokens |
integer | Maximum output tokens per request. Emitted from the endpoint's advertised output ceiling. |
capabilities.toolCalling |
boolean | true when the deployed model's family exposes a tool-call parser. |
capabilities.imageInput |
boolean | Always false; the platform is text-only for now. |
Supported Features
The provider extension talks to the Erebine API over the OpenAI-compatible Chat Completions endpoint.
Streaming (SSE)
The extension requests stream: true and
reports each text delta to VS Code as a
LanguageModelTextPart:
- Content is read from
choices[].delta.content - The
data: [DONE]sentinel terminates the stream - Cancelling the chat request aborts the underlying HTTP request
Tool Calling
When VS Code supplies tools, the extension forwards them
as OpenAI tools with
tool_choice: "auto", accumulates streamed
tool_calls frames, and emits each completed
call as a LanguageModelToolCallPart:
- VS Code tools map to
{ type: "function", function: { name, description, parameters } } - Streaming tool calls accumulate
argumentsacross chunks before being reported - Prior-turn tool results are passed back as OpenAI
tool-role messages
Model support required. Tool
calling must be supported by the model deployed on
your endpoint. The manifest's
capabilities.toolCalling reflects that
for each model.
Limitations
Text Only
capabilities.imageInput is
false for every model. Image and audio
inputs are not part of the current integration.
Reference Implementation
extension.js is generated reference code,
not a published extension. It is validated for syntax
but is intended to be loaded in the Extension
Development Host or packaged locally, and adapted to
your needs.
API Key in the Manifest
For zero-setup, the manifest embeds the workspace API
key and the extension reads it from there. A hardened
build should move the key into VS Code SecretStorage
and keep only baseURL + models in the
manifest.
Augmentation Headers
The downloaded manifest ships one augmentation header under
provider.headers:
X-Erebine-Augment-Corrective-Retries: on. The
extension forwards it on every request, letting Erebine retry a
malformed or empty model turn a bounded number of times before
returning it, so a single bad generation does not surface as a
failed request. Remove that entry from provider.headers
for strict passthrough, or add other
X-Erebine-Augment-* headers to opt into more; see
Passthrough and Augmentation.
max_tokens
Your max_tokens is sent to the model
verbatim. If it does not fit alongside the input inside
the model's context window, the request returns
400 context_length_exceeded rather than a
quietly shortened answer. Lower the value, or send
X-Erebine-Augment-Max-Output-Tokens-Clamp: on
to have Erebine fit it to the remaining context. See
Passthrough and
Augmentation.
Troubleshooting
Models Do Not Appear in the Picker
- Confirm
chatLanguageModels.jsonis saved at.vscode/chatLanguageModels.jsonin the open workspace folder. - Confirm the extension is loaded (Extension Development Host window, or installed via
code --install-extension), then reload the window. - Check that
models[]is a non-empty array.
Provider API Not Available
The Language Model Chat Provider API requires VS Code 1.104 or newer.
- Update VS Code, or follow the proposed-API fallback if your build exposes the API as a proposal.
401 Unauthorized
The API key is missing, invalid, or lacks the
inference scope.
- Verify
provider.apiKeyin the manifest is set and current. Re-download the bundle to rotate the key. - Check that the key has the
inferencescope in your dashboard.
404 Not Found
- Verify
provider.baseURLincludes your project ID, workspace ID, and endpoint slug, and ends with/v1. - Check that the endpoint is active in your dashboard.
Tool Calls Not Working
- Verify the model deployed on your endpoint supports function calling, and that
capabilities.toolCallingistruein the manifest. - Check your endpoint status in the dashboard for any errors.
Verifying Connectivity
Use curl to test your endpoint independently of VS Code:
curl https://api.erebine.ai/proj_ABC123/WORKSPACE_ID/my-endpoint/v1/chat/completions \
-H "Authorization: Bearer ere_my-project_abc123" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-r1-distill-llama-70b",
"messages": [{"role": "user", "content": "Hello!"}],
"max_tokens": 50
}'
If this returns a valid response, the issue is in the extension or manifest. If it returns an error, resolve the API issue first.