Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Cannot setup Deepseek model using Azure Foundry #3902

Open
3 tasks
DhruveSR opened this issue Jan 30, 2025 · 14 comments
Open
3 tasks

Cannot setup Deepseek model using Azure Foundry #3902

DhruveSR opened this issue Jan 30, 2025 · 14 comments
Assignees
Labels
ide:vscode Relates specifically to VS Code extension kind:bug Indicates an unexpected problem or unintended behavior "needs-triage"

Comments

@DhruveSR
Copy link

Before submitting your bug report

Relevant environment info

- OS: Windows 11
- Continue version: 0.8.66
- IDE version: VSCode 1.93.1
- Model: Deepseek-R1
- config.json:
  
  "models": [
    {
      "title": "Deepseek R1",
      "model": "Deepseek-R1",
      "provider": "azure",
      "apiBase": "https://DeepSeek-R1-hwgxs.eastus2.models.ai.azure.com",
      "apiType": "azure",
      "apiKey": "<API-KEY>"
    }
  ]

Description

I am not able to use Deepseek-R1 model deployed using azure foundry.

When i try sending a message, following error occurs in logs:
Error: HTTP 404 Not Found from https://deepseek-r1-hwgxs.eastus2.models.ai.azure.com/openai/deployments/Deepseek-R1/chat/completions?api-version=2023-07-01-preview

To reproduce

No response

Log output

@sestinj sestinj self-assigned this Jan 30, 2025
@dosubot dosubot bot added ide:vscode Relates specifically to VS Code extension kind:bug Indicates an unexpected problem or unintended behavior labels Jan 30, 2025
@George-Const
Copy link

same problem here. It would be nice to have a way to define the complete endpoint in the config file directly...

@chriskringle
Copy link

Same issue, cannot add deepseek-r1 model from azure.

@nekopanic
Copy link

Try with "apiType": "openai" I've had some luck with that.

@George-Const
Copy link

Try with "apiType": "openai" I've had some luck with that.

strangely it works but only with "hello". As soon as I ask another prompt, I get return code 400...

@George-Const
Copy link

Try with "apiType": "openai" I've had some luck with that.

strangely it works but only with "hello". As soon as I ask another prompt, I get return code 400...

it seems that it works and the errors are from backend side not from continue. Thanks.

@DhruveSR
Copy link
Author

DhruveSR commented Feb 4, 2025

Try with "apiType": "openai" I've had some luck with that.

Sometimes it works, sometimes it doesn't. It would randomly send 404 or 400 error and sometimes it would just keep running without actually generating any text.

@vladiliescu
Copy link

You need to suffix the url with /models. Something like this:

{
      "title": "DeepSeek-R1",
      "apiBase": "https://YYY.services.ai.azure.com/models",
      "apiKey": "XXX",
      "provider": "azure",
      "apiType": "openai",
      "systemMessage": "ZZZ",
      "contextLength": 128000,
      "model": "DeepSeek-R1",
      "apiVersion": "2024-05-01-preview"
    }

@CodesBySivaSankar
Copy link

hey @vladiliescu - I try the solution you provided but am still facing the below error. I also tried adding the /v1 endpoint, but it did not work. Could you provide the current continue version you are using?

Extension Host] Error handling webview message: {
"msg": {
"messageId": "028ed5d3-ee3f-439b-a5ea-37ae9287e8b1",
"messageType": "llm/streamChat",
"data": {
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "hi"
}
]
},
{
"role": "assistant",
"content": ""
}
],
"title": "DeepSeek-R1",
"completionOptions": {}
}
}
}

Error: HTTP 404 Not Found from https://deepseek-r1-model01.eastus.models.ai.azure.com/models/chat/completions

This may mean that you forgot to add '/v1' to the end of your 'apiBase' in config.json.

@vladiliescu
Copy link

vladiliescu commented Feb 6, 2025

@CodesBySivaSankar what's the deepseek-r1-model01 bit in your endpoint? It doesn't look like a deployment name, is there a chance you've put the model name there?

If it helps, I've documented my approach for both DeepSeek-R1 and o3-mini here

@CodesBySivaSankar
Copy link

Yes, @vladiliescu , I believe deepseek-r1-model01 is a deployment name. Could you check the attached screenshot to confirm if I have picked the deployment name from the correct location?

Image

@vladiliescu
Copy link

@CodesBySivaSankar That's the model name -- you need to use the Endpoint Target URI on the right of that screen

@CodesBySivaSankar
Copy link

@vladiliescu - I used the Target URI itself, and deepseek-r1-model01 is part of the URI path, but I'm still getting a 404 error. Could you confirm if the deployment name is supposed to be in the URI path on your end? Also, has anyone else managed to resolve this issue?

@achaphiv
Copy link

achaphiv commented Feb 6, 2025

This config worked for me yesterday (2025-02-05):

    {
      "apiKey": "REDACTED",
      "apiBase": "https://<<REDACTED>>.services.ai.azure.com/models",
      "apiType": "openai",
      "model": "DeepSeek-R1",
      "title": "AZURE deepseek R1",
      "apiVersion": "2024-05-01-preview",
      "provider": "azure"
    }

It stopped working today (2025-02-06).

Logs show:

{ "error": { "code": "Timeout", "message": "The operation was timeout." } }

I think azure is overloaded.

@CodesBySivaSankar
Copy link

It worked for me even without adding the /models endpoint, but I ran into a content filtering issue (jailbreak) on Azure.

Error
`Error: HTTP 400 Bad Request from https://deepseek-r1-model01.eastus.models.ai.azure.com/chat/completions {"error":{"message":"The response was filtered due to the prompt triggering Microsoft's content management policy. Please modify your prompt and retry.","type":null,"param":"prompt","code":"content_filter","status":400,"innererror":{"code":"ResponsibleAIPolicyViolation","content_filter_result":{"hate":{"filtered":false,"severity":"safe"},

"jailbreak":{"filtered":true

,"detected":true},"self_harm":{"filtered":false,"severity":"safe"},"sexual":{"filtered":false,"severity":"safe"},"violence":{"filtered":false,"severity":"safe"}}}}}`

The above error indicated that my prompt triggered the jailbreak filter, so I adjusted the DeepSeek prompts mentioned here by removing certain strict terms like "only" and "refuse," which seemed to override AI safety mechanisms. After making these changes, everything worked fine.

I'm also curious about how things behave when we specify the /models endpoint in the URI. @achaphiv I am also experienced the azure models' slow performances.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
ide:vscode Relates specifically to VS Code extension kind:bug Indicates an unexpected problem or unintended behavior "needs-triage"
Projects
None yet
Development

No branches or pull requests

8 participants