Open LayZeeDK opened 1 year ago
Thanks for the suggestion @LayZeeDK. I'm interested by your request. What's motivating it?
I certainly agree that this project should be generalized to support different LLM APIs in the future. If we want to implement Azure, I'd be curious to learn:
Azure OpenAI service supports enterprise-grade security, policies, compliance, and regional availability. Would you be interested in API access?
API reference for Azure OpenAI service:
Yup this is definitely something I'd be interested in making happen! I tagged the issue as help wanted
Instead of https://api.openai.com/v1/completions
, the endpoint URL would be in the format https://{resource_name}.openai.azure.com/openai/deployments/{deployment_id}/completions?api-version=<api_version>
with 2022-12-01
being the latest API version so we must make the endpoint URL for completions configurable.
Instead of an Authorization
header in the format Authorization: Bearer <api_key>
, we would have the header api-key: <api_key>
In the Azure OpenAI Service API, a completions request does not support a model
parameter. Instead, this is represented by the {deployment_id}
URL parameter.
The OpenAI API response object has a usage
property but the Azure OpenAI Service API does not.
The model
property in the example response displays "ada"
. The models available for the Azure OpenAI Service are listed in Model Summary table and region availability. These are deployed then targeted in the {deployment_id}
URL parameter for the completions endpoint. I'm not sure all the models supported by the Azure OpenAI Service are listed in https://github.com/zurawiki/gptcommit/blob/6ee5bc587de6b7f2126d1cf073b8dc6e0b4d121c/src/openai.rs#L91-L101
At least not if "ada"
is a valid model
response value.
Thanks for the context.
Currently, I'm blocked because I don't have access to the Azure OpenAI services. I applied but haven't heard back from Microsoft
Currently blocked on async-openai supporting Azure: https://github.com/64bit/async-openai/issues/32
You can try this project that converts Azure to OpenAI API.
https://github.com/haibbo/cf-openai-azure-proxy/blob/main/README_en.md
then edit the gptchat's config file(~/.config/gptcommit/config.toml
)
Note: api_key
should be azure openai service's key, not openai's api key.
Please add support for Azure OpenAI service that now has General Availability (GA), including the GPT-3 model.