Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[Feature Request] 请求适配 Azure AI 的 DeepSeek-R1 模型 #6178

Open
zhanbao2000 opened this issue Feb 7, 2025 · 16 comments
Open

[Feature Request] 请求适配 Azure AI 的 DeepSeek-R1 模型 #6178

zhanbao2000 opened this issue Feb 7, 2025 · 16 comments
Labels
enhancement New feature or request

Comments

@zhanbao2000
Copy link

🥰 Feature Description

目前,Azure(非 Azure OpenAI 服务)已支持 DeepSeek-R1 模型及其推理功能。非常希望能将其添加进 NextChat 中!

我的具体需求如下:

  • 将 Azure 与 Azure OpenAI 独立,从而能正确调用 API
  • 实现 DeepSeek-R1 推理时思考内容可折叠与计时

🧐 Proposed Solution

Azure 调用终结点与 Azure OpenAI 的调用十分类似,但是在 path 中没有 deployments/{deployName}

https://{serviceName}.services.ai.azure.com/models/chat/completions?api-version={ApiVersion}

其 API-Key 放置于请求头 api-key 字段中,与 Azure OpenAI 相同

请求 JSON 与 Azure OpenAI 相同:

{
    "model": "模型名",
    "stream": true,
    "messages": [
        {
            "role": "system",
            "content": "你是一个帮助用户查找信息的 AI 助手。"
        },
        {
            "role": "user",
            "content": "你好"
        }
    ],
    "temperature": 0.7,
    "top_p": 0.95,
    "frequency_penalty": 0,
    "presence_penalty": 0,
    "max_tokens": 800,
    "stop": null
}

Azure DeepSeek-R1 返回的消息中,会将思考内容包括在 <think> </think> 块内

Azure 的所谓 ”模型名“ 是可以任意自取的,因此不能完全依靠名称来反向推导其 ServiceProvider,这会导致误判断。比如在 getSummarizeModel() 函数中:

NextChat/app/store/chat.ts

Lines 147 to 148 in bf265d3

} else if (currentModel.startsWith("deepseek-")) {
return [DEEPSEEK_SUMMARIZE_MODEL, ServiceProvider.DeepSeek];

📝 Additional Information

参考 API: 如何使用 DeepSeek-R1 推理模型 (2025/02/07)

@zhanbao2000 zhanbao2000 added the enhancement New feature or request label Feb 7, 2025
@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Title: [Feature Request] Request DeepSeek-R1 model adapted to Azure AI

🥰 Feature Description

Currently, Azure (non-Azure OpenAI service) supports the DeepSeek-R1 model and its inference capabilities. Very much hope to add it to NextChat!

My specific needs are as follows:

  • Separate Azure from Azure OpenAI to correctly call APIs
  • Implement DeepSeek-R1 thinking about content that can be folded and timed when inference

🧐 Proposed Solution

Azure call endpoints are very similar to those of Azure OpenAI, but there is no deployments/{deployName} in the path:

https://{serviceName}.services.ai.azure.com/models/chat/completions?api-version={ApiVersion}

Its API-Key is placed in the api-key field of the request header, the same as Azure OpenAI

Request JSON is the same as Azure OpenAI:

{
    "model": "model name",
    "stream": true,
    "messages": [
        {
            "role": "system",
            "content": "You are an AI assistant that helps users find information."
        },
        {
            "role": "user",
            "content": "Hello"
        }
    ],
    "temperature": 0.7,
    "top_p": 0.95,
    "frequency_penalty": 0,
    "presence_penalty": 0,
    "max_tokens": 800,
    "stop": null
}

The message returned by Azure DeepSeek-R1 will include the thinking content in the <think> </think> block

Azure's so-called "model name" can be taken arbitrarily, so it cannot rely entirely on the name to inversely deduce its ServiceProvider, which will lead to misjudgment. For example, in the getSummarizeModel() function:

NextChat/app/store/chat.ts

Lines 147 to 148 in bf265d3

} else if (currentModel.startsWith("deepseek-")) {
return [DEEPSEEK_SUMMARIZE_MODEL, ServiceProvider.DeepSeek];

📝 Additional Information

Reference API: [How to use DeepSeek-R1 inference model](https://learn.microsoft.com/zh-cn/azure/ai-studio/how-to/deploy-models-deepseek?pivots=programming-languag e-python ) (2025/02/07)

@ceshitian
Copy link

🥰 Feature Description

目前,Azure(非 Azure OpenAI 服务)已支持 DeepSeek-R1 模型及其推理功能。非常希望能将其添加进 NextChat 中!

我的具体需求如下:

  • 将 Azure 与 Azure OpenAI 独立,从而能正确调用 API
  • 实现 DeepSeek-R1 推理时思考内容可折叠与计时

🧐 Proposed Solution

Azure 调用终结点与 Azure OpenAI 的调用十分类似,但是在 path 中没有 deployments/{deployName}

https://{serviceName}.services.ai.azure.com/models/chat/completions?api-version={ApiVersion}

其 API-Key 放置于请求头 api-key 字段中,与 Azure OpenAI 相同

请求 JSON 与 Azure OpenAI 相同:

{
"model": "模型名",
"stream": true,
"messages": [
{
"role": "system",
"content": "你是一个帮助用户查找信息的 AI 助手。"
},
{
"role": "user",
"content": "你好"
}
],
"temperature": 0.7,
"top_p": 0.95,
"frequency_penalty": 0,
"presence_penalty": 0,
"max_tokens": 800,
"stop": null
}
Azure DeepSeek-R1 返回的消息中,会将思考内容包括在 <think> </think> 块内

Azure 的所谓 ”模型名“ 是可以任意自取的,因此不能完全依靠名称来反向推导其 ServiceProvider,这会导致误判断。比如在 getSummarizeModel() 函数中:

NextChat/app/store/chat.ts

Lines 147 to 148 in bf265d3

} else if (currentModel.startsWith("deepseek-")) {
return [DEEPSEEK_SUMMARIZE_MODEL, ServiceProvider.DeepSeek];

📝 Additional Information

参考 API: 如何使用 DeepSeek-R1 推理模型 (2025/02/07)

原来是不支持啊,我昨天搞了大半天,azuer部署的apenai的接口可以,deepseek报error

@ceshitian
Copy link

🥰 Feature Description

目前,Azure(非 Azure OpenAI 服务)已支持 DeepSeek-R1 模型及其推理功能。非常希望能将其添加进 NextChat 中!

我的具体需求如下:

  • 将 Azure 与 Azure OpenAI 独立,从而能正确调用 API
  • 实现 DeepSeek-R1 推理时思考内容可折叠与计时

🧐 Proposed Solution

Azure 调用终结点与 Azure OpenAI 的调用十分类似,但是在 path 中没有 deployments/{deployName}

https://{serviceName}.services.ai.azure.com/models/chat/completions?api-version={ApiVersion}

其 API-Key 放置于请求头 api-key 字段中,与 Azure OpenAI 相同

请求 JSON 与 Azure OpenAI 相同:

{
"model": "模型名",
"stream": true,
"messages": [
{
"role": "system",
"content": "你是一个帮助用户查找信息的 AI 助手。"
},
{
"role": "user",
"content": "你好"
}
],
"temperature": 0.7,
"top_p": 0.95,
"frequency_penalty": 0,
"presence_penalty": 0,
"max_tokens": 800,
"stop": null
}
Azure DeepSeek-R1 返回的消息中,会将思考内容包括在 <think> </think> 块内

Azure 的所谓 ”模型名“ 是可以任意自取的,因此不能完全依靠名称来反向推导其 ServiceProvider,这会导致误判断。比如在 getSummarizeModel() 函数中:

NextChat/app/store/chat.ts

Lines 147 to 148 in bf265d3

} else if (currentModel.startsWith("deepseek-")) {
return [DEEPSEEK_SUMMARIZE_MODEL, ServiceProvider.DeepSeek];

📝 Additional Information

参考 API: 如何使用 DeepSeek-R1 推理模型 (2025/02/07)

强烈附议,目前通过微软部署的deepseek是已知比较稳定且免费的方式,这个适配需求比较大。

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


🥰 Feature Description

Currently, Azure (non-Azure OpenAI service) supports the DeepSeek-R1 model and its inference capabilities. Very much hope to add it to NextChat!

My specific needs are as follows:

  • Separate Azure from Azure OpenAI to correctly call APIs
  • Implement DeepSeek-R1 thinking about content that can be folded and timed when inference

🧐 Proposed Solution

Azure call endpoints are very similar to those of Azure OpenAI, but there is no deployments/{deployName} in the path:

https://{serviceName}.services.ai.azure.com/models/chat/completes?api-version={ApiVersion}

Its API-Key is placed in the api-key field in the request header, the same as Azure OpenAI

Request JSON is the same as Azure OpenAI:

{
"model": "model name",
"stream": true,
"messages": [
{
"role": "system",
"content": "You are an AI assistant that helps users find information."
},
{
"role": "user",
"content": "Hello"
}
],
"temperature": 0.7,
"top_p": 0.95,
"frequency_penalty": 0,
"presence_penalty": 0,
"max_tokens": 800,
"stop": null
}
The message returned by Azure DeepSeek-R1 will include the thinking content in the <think> </think> block

Azure's so-called "model name" can be taken at will, so it cannot rely entirely on the name to infer its ServiceProvider in reverse, which will lead to misjudgment. For example, in the getSummarizeModel() function:

[NextChat/app/store/chat.ts](https://github.com/ChatGPTNextWeb/NextChat/blob/bf265d33759dfada0d91248cbcb5ae22326e745f/app/store/c hat.ts#L147-L148)

Lines 147 to 148 in bf265d3

} else if (currentModel.startsWith("deepseek-")) {
return [DEEPSEEK_SUMMARIZE_MODEL, ServiceProvider.DeepSeek];

📝 Additional Information

Reference API: [How to use DeepSeek-R1 inference model](https://learn.microsoft.com/zh-cn/azure/ai-studio/how-to/deploy-models-deepseek?pivots=programming-langua ge- python) (2025/02/07)

It is strongly recommended that deepseek currently deployed through Microsoft is a relatively stable and free method, and this adaptation demand is relatively large.

@dustookk
Copy link
Contributor

请问作者这个项目还更新么.. 怎么感觉好久没动了呢

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Is the author still updated this project? Why do I feel like I haven't moved for a long time?

@bzssm
Copy link

bzssm commented Feb 14, 2025

-e AZURE_URL='https://xxx.services.ai.azure.com/models/chat/completions#' -e AZURE_API_KEY="xxxxxx" -e AZURE_API_VERSION=2024-05-01-preview -e CUSTOM_MODELS="-all,+DeepSeek-R1@Azure=DeepSeek-R1"

注意Azure url最后面一定要加#

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


-e AZURE_URL='https://xxx.services.ai.azure.com/models/chat/completions#' -e AZURE_API_KEY="xxxxxx" -e AZURE_API_VERSION=2024-05-01-preview -e CUSTOM_MODELS="-all,+DeepSeek-R1@Azure=DeepSeek-R1"

@zptqghsw
Copy link

有人解决了吗?

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Has anyone solved it?

@itcodes
Copy link

itcodes commented Feb 19, 2025

话说AZURE_URL 是固定的,如何同时部署了 gpt-4o 以及 azure 的 deepseek 呢。

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


By the way, AZURE_URL is fixed, how do you deploy gpt-4o and deepseek of azure at the same time?

@bzssm
Copy link

bzssm commented Feb 19, 2025

话说AZURE_URL 是固定的,如何同时部署了 gpt-4o 以及 azure 的 deepseek 呢。

我理解是,做不了,需要借助one-api之类的工具

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Speaking of which, AZURE_URL is fixed, how to deploy gpt-4o and deepseek of azure at the same time.

I understand that I can't do it, I need to use tools like one-api

@itcodes
Copy link

itcodes commented Feb 19, 2025

话说AZURE_URL 是固定的,如何同时部署了 gpt-4o 以及 azure 的 deepseek 呢。

我理解是,做不了,需要借助one-api之类的工具

懂了。微软真的是操蛋。。

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Speaking of which, AZURE_URL is fixed, how to deploy gpt-4o and azure deepseek at the same time.

I understand that I can't do it, I need to use tools like one-api

I understand. Microsoft is really fucking. .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

7 participants