You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
BYOK Copilot CLI not working anymore with Deepseek #4840
BYOK is not working in Copilot CLI anymore. GPT5.4 is selected and an error is coming: 400 Failed to deserialize the JSON body into the target type: tools[4].type: unknownvariant custom, expected function at line 1 column 47113
I’ve configured DeepSeek as a custom model in Copilot CLI, and it worked until version 1.0.83. Since upgrading, I can still see deepseek-flash (custom) under Recent models, but selecting it does not switch to the model.
Is anyone else seeing this with custom models? The screenshots show my custom model configuration and what appears in the model selector.
My current workaround is to start Copilot using:
copilot --prefer-version 1.0.83 --no-auto-update
The base URL should be https://api.deepseek.com/anthropic
export COPILOT_MODEL=deepseek-flash
Official docs say deepseek-v4-flash, though I also believe I had to remove the -v4 part (at least it works with deepseek-flash), so this should be good.
export COPILOT_MODEL=deepseek-v4-pro
This overrides the previous line - you're not appending configurations, you're setting an environment variable for the session. Copilot CLI will be running v4 Pro after this.
I also tested with COPILOT_MODEL=gpt-4.1-mini, and with COPILOT_PROVIDER_MODEL_ID=gpt-4o-mini plus COPILOT_PROVIDER_WIRE_MODEL=gpt-4.1-mini. All failed the same way.
Symptom
On the first prompt, Copilot CLI fails with:
400 Invalid value: 'custom'.
Debug log observations
With --log-level all, the runtime logs show the model still being treated as custom/uncataloged even when COPILOT_PROVIDER_MODEL_ID is set:
Immediately after connecting to the Azure OpenAI host, the log records model.call_failure.
Why this seems related
This issue reports a BYOK request being rejected because custom is being sent in a place the provider expects a standard OpenAI-compatible shape. My Azure case also fails with Invalid value: 'custom', and the logs suggest Copilot CLI continues to classify the model/provider path as custom despite the documented COPILOT_PROVIDER_MODEL_ID / COPILOT_PROVIDER_WIRE_MODEL split.
It also looks related to the broader class of bugs where BYOK requests include model options unsupported by the target model/provider, e.g. reasoning_effort: "medium" being sent to non-reasoning models.
Expected behavior
For Azure BYOK with COPILOT_PROVIDER_MODEL_ID=gpt-4 and COPILOT_PROVIDER_WIRE_MODEL=gpt-4.1-mini, I would expect Copilot CLI to use the known model ID only for internal capability/profile selection and send an Azure-compatible chat-completions request to the wire model/deployment, without unsupported custom/tool/reasoning fields.
Activity
[-]BYOK Copilot CLI not working anymore[/-][+]BYOK Copilot CLI not working anymore with Deepseek[/+]Rogn commentedon Sep 22, 2026
I’ve configured DeepSeek as a custom model in Copilot CLI, and it worked until version 1.0.83. Since upgrading, I can still see deepseek-flash (custom) under Recent models, but selecting it does not switch to the model.
Is anyone else seeing this with custom models? The screenshots show my custom model configuration and what appears in the model selector.
My current workaround is to start Copilot using:
copilot --prefer-version 1.0.83 --no-auto-update
Lerbaek commentedon Sep 24, 2026
It works for me, though I did have to do some reconfiguration around the same time.
Try following the official instructions.
As per your specific configuration:
The base URL should be
https://api.deepseek.com/anthropicOfficial docs say
deepseek-v4-flash, though I also believe I had to remove the-v4part (at least it works withdeepseek-flash), so this should be good.This overrides the previous line - you're not appending configurations, you're setting an environment variable for the session. Copilot CLI will be running v4 Pro after this.
timomta commentedon Oct 2, 2026
I’m seeing what looks like the same BYOK
customrequest-shape failure, but against Azure OpenAI.Environment
1.0.91gpt-4.1-mini2025-04-14chatCompletion=trueresponses=trueagentsV2=trueassistants=trueEnv vars
I also tested with
COPILOT_MODEL=gpt-4.1-mini, and withCOPILOT_PROVIDER_MODEL_ID=gpt-4o-miniplusCOPILOT_PROVIDER_WIRE_MODEL=gpt-4.1-mini. All failed the same way.Symptom
On the first prompt, Copilot CLI fails with:
Debug log observations
With
--log-level all, the runtime logs show the model still being treated as custom/uncataloged even whenCOPILOT_PROVIDER_MODEL_IDis set:The emitted wire request includes:
{ "model": "gpt-4.1-mini", "reasoning_effort": "medium", "temperature": 1, "stream_options": { "include_usage": true }, "stream": true }The wire request did not include a top-level
toolsarray in my captured log, but it did include this Copilot-specific field:Immediately after connecting to the Azure OpenAI host, the log records
model.call_failure.Why this seems related
This issue reports a BYOK request being rejected because
customis being sent in a place the provider expects a standard OpenAI-compatible shape. My Azure case also fails withInvalid value: 'custom', and the logs suggest Copilot CLI continues to classify the model/provider path as custom despite the documentedCOPILOT_PROVIDER_MODEL_ID/COPILOT_PROVIDER_WIRE_MODELsplit.It also looks related to the broader class of bugs where BYOK requests include model options unsupported by the target model/provider, e.g.
reasoning_effort: "medium"being sent to non-reasoning models.Expected behavior
For Azure BYOK with
COPILOT_PROVIDER_MODEL_ID=gpt-4andCOPILOT_PROVIDER_WIRE_MODEL=gpt-4.1-mini, I would expect Copilot CLI to use the known model ID only for internal capability/profile selection and send an Azure-compatible chat-completions request to the wire model/deployment, without unsupported custom/tool/reasoning fields.