Microsoft Azure OpenAI Service - Compliant GPT Model Interface

As we all know, we cannot access the official OpenAI service, but we can access the interface through a proxy or a third-party proxy

Now the new regulations prohibit the use of overseas AI large model interfaces for domestic customers, so we need to use domestic large model interfaces

The domestic effect is really poor. Now if you want to use the GPT large model, you can use the OpenAI service of Microsoft Azure.

Responsible AI

At Microsoft, we are committed to human-centered principles that drive the advancement of AI. Generative models such as those available in Azure OpenAI have significant potential advantages, but without careful design and thoughtful mitigations, such models have the potential to generate incorrect or even harmful content. Microsoft has made significant investments to help prevent abuse and accidental harm, including requiring applicants to demonstrate a well-defined use case, incorporating Microsoft's Principles for Responsible Use of AI, building content filters to support customers, and providing customers with responsible AI Implementation Guidance.

Microsoft has a compliant company in China, and the data content has been filtered. We can consider replacing OpenAI’s official website service

interface specification

We can refer to the call parameters of the following REST interface

After the service is successfully created on Azure, you will get two parameters ENDPOINT and API-KEY

How to call the chat interface

curl $AZURE_OPENAI_ENDPOINT/openai/deployments/gpt-35-turbo/chat/completions?api-version=2023-05-15 \
  -H "Content-Type: application/json" \
  -H "api-key: $AZURE_OPENAI_KEY" \
  -d '{"messages":[{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Does Azure OpenAI support customer managed keys?"},{"role": "assistant", "content": "Yes, customer managed keys are supported by Azure OpenAI."},{"role": "user", "content": "Do other Azure Cognitive Services support this too?"}]}'

The difference from the official OpenAI

The interface address is different, and the form of the key passed in the header parameter is also different.

Except for these two points, everything else is the same

Summarize

When we can use a third-party library, check whether the library is compatible with Azure OpenAI. If so, we can configure the domain name part and key part of the interface at the front end of the application layer to achieve compatibility on both sides.

Guess you like

Origin blog.csdn.net/taoshihan/article/details/131734381