dust-tt / dust

Amplify your team's potential with customizable and secure AI assistants.
https://dust.tt
MIT License
938 stars 107 forks source link

Can't select a model on Azure Open AI in DUST App interface #2811

Closed milstan closed 9 months ago

milstan commented 9 months ago

I configured an Azure OpenAI instance (successfully), and then when I try to direct my DUST App to it, I can't deploy the app beacuse the 'select model' is empty. Clicking on it offers 0 options.

image

What I expected

milstan commented 9 months ago

More info: tested the API call from this line of code, with the same endpoint/API key, and successfully got:

{
  "data": [
    {
      "scale_settings": {
        "scale_type": "standard"
      },
      "model": "gpt-35-turbo",
      "owner": "organization-owner",
      "id": "gpt_35_turbo",
      "status": "succeeded",
      "created_at": 1702114559,
      "updated_at": 1702144202,
      "object": "deployment"
    }
  ],
  "object": "list"
}

Not usre where it gets lost later, but when the frontend makes the call: .../providers/azure_openai/models?chat=false&embed=false

The response is an empty list:

{"models":[]}

Also, the the azure openai instance responds correctly in a curl call:

 curl <my_endpoint>openai/deployments/gpt_35_turbo/completions?api-version=2023-05-15 \
>   -H "Content-Type: application/json" \
>   -H "api-key: <my_API_key" \
>   -d "{\"prompt\": \"Once upon a time\"}"

yields:

{"id":"...","object":"text_completion","created":1702155159,"model":"gpt-35-turbo","choices":
[{"text":" there was a persevering, tireless customer services professional, whose job was to","index":0,"finish_reason":"length","logprobs":null}],"usage":{"prompt_tokens":4,"completion_tokens":16,"total_tokens":20}}

Without going throught details of the code, I suspect the fact the model is called gpt-35-turbo without the dot between 3.5 might be at odds with this part here.

These are the model names Azure proposes (at least in my princing plan): image

spolu commented 9 months ago

Hi @milstan

The model selection in Dust requires a deployment to be active on your azure account.

What name did you use for your deployment ooc?

milstan commented 9 months ago

Hi @spolu , thanks for the fast response!

I do believe I have an active deployment under the name gpt_35_turbo. It's possible that I still have to configure something more on Azure, but see curl calls in my previous message, I do manage to get a response from it. The name is returned by Azure openai/deployments? endpoint as

"id": "gpt_35_turbo",

The model however is susspciousely named gpt-35-turbo without the dot, which I suspect to be the problem here.

spolu commented 9 months ago

The selector should be able to accept any model name. Keeping the original model is nonetheless advised as it'll be used to decide whether it's a chat model or not.

spolu commented 9 months ago

If you have the wrong model name and are using the Chat block then the behavior is expected.

You should see the model under the Model block.

milstan commented 9 months ago

If you have the wrong model name and are using the Chat block then the behavior is expected.

You should see the model under the Model block.

I'm using the LLM block. Still the same result: image

Unfortunately in my Azure interface I don't think I have any control over the model names. I can only pick one from the drop-down, the only 3 options being:

image