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

Fix model switcher for Azure #508

Closed
wants to merge 293 commits into from
Closed

Conversation

itbm
Copy link
Contributor

@itbm itbm commented Apr 11, 2023

Reverts #499

I suggest reverting this as it isn't necessary and breaks model switching between GPT-3.5, GPT-4 and GPT-4-32K in the UI. Should be merged with #509.

See #498 (comment)

mckaywrigley and others added 30 commits March 18, 2023 17:55
Updated ChatInput.tsx text area to autoextend for larger prompt size
Correct the improper context being used when it exceeds the limit.
User message should not render as Markdown
Co-authored-by: dev <dev@ptfprod7>
* feat: Add conditional search input for conversation list

* style and ux adjust

---------

Co-authored-by: Tekle Ayele <[email protected]>
* Update .gitignore

* Update next.config.js

* Enable GPT-4

* Update index.ts

* Fix logic

* Fix error

* Add set openai key instruction

* Fix menu safari

* Revert changes

* new line

---------

Co-authored-by: Sonny <[email protected]>
* mobile ui updates

* fixes sidebar btn

* return if null

* mobile input blur

* handle mobile enter key

* new convo name

* new delete mechanism

* test height

* revert

* change padding

* remove overflow

* check relative

* padding

* done

* retry

* test

* test

* should work now

* test

* test

* more

* max h

* revert

* done
* use tiktoken for api limit

* model conditional char limits on frontend

* adjust for completion tokens

---------

Co-authored-by: Alan Pogrebinschi <[email protected]>
@kleptog
Copy link

kleptog commented Apr 20, 2023

This isn't correct. The deployment name in the URL is unrelated to the model name and must be configured. I don't think there is a way to get a list of available deployments unless you can access the Azure API.

@itbm
Copy link
Contributor Author

itbm commented Apr 20, 2023

@kleptog it is correct. The azure api returns both the model name and the deployment name. The code already checks against the model (model field), then translates it to the deployment name (id field) for use in the URL.

See https://github.com/mckaywrigley/chatbot-ui/blob/main/pages/api/models.ts#L53.

With this PR it doesn't matter what the deployment is called, as it looks for the model and updates the URL accordingly.

@itbm
Copy link
Contributor Author

itbm commented Apr 20, 2023

@mckaywrigley I’ve fixed merge conflicts. Would it be possible to get this reviewed and merged?

@ivanfioravanti
Copy link
Contributor

This works! Great job @itbm

@brandco
Copy link

brandco commented Apr 26, 2023

It looks like the Azure deployment name would need to match the model name for this to work. Is that correct?

I'm not sure why someone would use a deployment name that doesn't match the model name in setting up Azure OpenAI, but it is possible. Perhaps this is useful for fine tuned models, I'm not sure.

@itbm
Copy link
Contributor Author

itbm commented Apr 26, 2023

With this PR they can be different. Chatbot UI will use the model name internally up until it makes the request to Azure, at which point it will use the deployment name in the URL.

@tobigue
Copy link

tobigue commented Jun 8, 2023

Currently always the default model (configured in AZURE_DEPLOYMENT_ID) is used instead of the model the user picked in the interface when using Azure as backend, so would be great to get this merged! :)

@Kush-agra-wal
Copy link

It looks like the Azure deployment name would need to match the model name for this to work. Is that correct?

I'm not sure why someone would use a deployment name that doesn't match the model name in setting up Azure OpenAI, but it is possible. Perhaps this is useful for fine tuned models, I'm not sure.

Still facing this issue, when deployment name is not = model name the default model assigned at start of conversation is not assigning the model id from azure instead gives fallback one. if one of the deployments is named gpt-35-turbo it is able to work fine for other deployments which dont have name same as model name

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

Successfully merging this pull request may close these issues.

None yet