Christopher-Hayes / vscode-chatgpt-reborn

Refactor, improve, and debug your code in VSCode with GPT-3 and GPT-4.
https://marketplace.visualstudio.com/items?itemName=chris-hayes.chatgpt-reborn
ISC License
207 stars 38 forks source link

Can Azure OpenAI Endpoint Work? #55

Closed rambalachandran closed 3 weeks ago

rambalachandran commented 7 months ago

Describe the feature

Given the current turmoil at OpenAI, can we change the Api Base Url in settings to Azure endpoint and will it work? Will like to get a confirmation before creating an Azure account.

Christopher-Hayes commented 7 months ago

This has been a work-in-progress. So, not yet.

The main blocker is that Azure handles models differently. You get a separate endpoint for each model. So, some code refactoring is needed (including the UI). I'll try to get this finished off in the next month or so.

If you urgently want to use another service, you can use one of the "openai proxies" available on github, where you can use any service (Anthropic, Azure, etc) and the proxy converts API requests between the OpenAI format and the Azure/Anthropic/etc format. In this extension you would change the apiBaseUrl config setting to point to your personal proxy server. You would have to host that yourself though and may have bugginess I probably can't help with.

rambalachandran commented 7 months ago

Thank you @Christopher-Hayes . I will give the openai proxies a try for now. Happy to test the Azure implementation once you think it is ready.

ChuckJonas commented 6 months ago

All that's really needed here is the ability to:

  1. Set the api-key header instead of Authorization: "Bearer
  2. Apply the API key version URL param ?api-version={{api-version}}

The extension should at least then work for /chat/completion use cases... Which I imagine is pretty much everything at this point? Even co-pilot is apparently using GPT-4 for it's code completions now

Christopher-Hayes commented 3 weeks ago

Azure OpenAI API support added in v3.24.0. For Azure, you need to specify the "endpoint", the "deployment ID", and the "API version".

More info in the release discussion: #74