danny-avila / LibreChat

Enhanced ChatGPT Clone: Features Anthropic, AWS, OpenAI, Assistants API, Azure, Groq, o1, GPT-4o, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, langchain, DALL-E-3, ChatGPT Plugins, OpenAI Functions, Secure Multi-User System, Presets, completely open-source for self-hosting. Actively in public development.

Home Page:https://librechat.ai/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug]: Cannot Use OpenAI Assistants if sidePanel or modelSelect is set to false

mrn-linak opened this issue · comments

What happened?

If either the side panel or the model selection menu is disabled, it is not possible to use the Assistants endpoint.

Steps to Reproduce

Here is the librechat config:

interface:
  endpointsMenu: false
  modelSelect: false
  parameters: false
  sidePanel: true
  presets: false
  prompts: true
  bookmarks: false
  multiConvo: false

Furthermore, here is the modelSpec for the AI assistant (confirmed working):

modelSpecs:
    enforce: true
    prioritize: true
    list:
        -   name: "*****_assistant"
        label: "*****Technical Assistant"
        description: "Has access to documentation."
        iconURL: ""
        preset:
            default: false
            endpoint: "assistants"
            modelLabel: "****** Technical Assistant"
            assistant_options:
              assistant_id: "*********"
            greeting: |
                Hi! What can I help you with today? ******

The file is censored, but is confirmed working correctly. With this configuration it is not possible to use this assistant, although it is possible to select it from the dropdown in the top-left corner. Normal models work fine, just not assistants. The chat input is greyed out and asks the user to select an assistant from the right-hand Side Panel.

What browsers are you seeing the problem on?

Microsoft Edge

Relevant log output

No log output generated, as no error happens.

Screenshots

assistants_bug

Code of Conduct

  • I agree to follow this project's Code of Conduct

This might not help but I wanted to quickly note that I have seen this behavior in our LibreChat instances as well.
All configs (endpoints and ModelSpecs seem to be set correctly, yet when selecting a model or an assistant the input box won't let you enter anything but only reads "Please select an Assistant from the right hand Side Panel.".

It seems that this is a UI bug. When I press CTRL+F5 first, then switch the selection to a different model (we've defined a couple through modelSpecs) and then back to the desired assistant, it tends to work.

Not sure if you have anything else in your selection but I'd give it a try with defining a regular model (like GPT-4o) via modelSpecs, so you can switch to it and then back to the assistant.

Confirming that I am seeing the same thing.

I tried the page-refresh suggested by @dareima but I am unable to replicate the behaviour. We have several regular models working, but switching to them (and back to the assistant) after hard-refresh (ctrl+f5) doesn't allow me to use the assistants still.

Which browser are you using @dareima?

I had the same problem, but was able to solve it by setting the endpoint and the assistant_id at preset level.

modelSpecs:
  enforce: true
  prioritize: true
  list:
    - name: "bot-name"
      label: "Bot-Label"
      preset:
        endpoint: "azureAssistants"
        assistant_id: "asst_xxxxxxxxx"

I had the same problem, but was able to solve it by setting the endpoint and the assistant_id at preset level.

modelSpecs:
  enforce: true
  prioritize: true
  list:
    - name: "bot-name"
      label: "Bot-Label"
      preset:
        endpoint: "azureAssistants"
        assistant_id: "asst_xxxxxxxxx"

This doesn't change anything for us - which version of LibreChat are you using?

I had the same problem, but was able to solve it by setting the endpoint and the assistant_id at preset level.

modelSpecs:
  enforce: true
  prioritize: true
  list:
    - name: "bot-name"
      label: "Bot-Label"
      preset:
        endpoint: "azureAssistants"
        assistant_id: "asst_xxxxxxxxx"

This doesn't change anything for us - which version of LibreChat are you using?

v0.7.5-rc2

I had the same problem, but was able to solve it by setting the endpoint and the assistant_id at preset level.

modelSpecs:
  enforce: true
  prioritize: true
  list:
    - name: "bot-name"
      label: "Bot-Label"
      preset:
        endpoint: "azureAssistants"
        assistant_id: "asst_xxxxxxxxx"

This doesn't change anything for us - which version of LibreChat are you using?

v0.7.5-rc2

Hm, That's very curious! Here is the modelSpec:

        -   name: "technical_assistant"
            label: "Technical Assistant"
            description: "Has access to documentation."
            iconURL: ""
            preset:
                default: false
                endpoint: "assistants"
                assistant_id: "*********"
                modelLabel: "Technical Assistant"
                greeting: |
                    Hi! What can I help you with today?

Do you notice anything different from your modelSpec @oza-c?

Hm, That's very curious! Here is the modelSpec:

        -   name: "technical_assistant"
            label: "Technical Assistant"
            description: "Has access to documentation."
            iconURL: ""
            preset:
                default: false
                endpoint: "assistants"
                assistant_id: "*********"
                modelLabel: "Technical Assistant"
                greeting: |
                    Hi! What can I help you with today?

Do you notice anything different from your modelSpec @oza-c?

No, not really, endpoints are different but probably not the main cause of the problem. Can you change the modelSpecs to a bare minimum (only one label, no greeting, remove default), otherwise I have no idea?

I'm marking this as fixed. I do not get this issue any longer after doing the following changes:

        -   name: "assistant"
            label: "Technical Assistant"
            description: "Has access to documentation."
            iconURL: ""
            preset:
                default: false
                endpoint: "assistants"
                model: "gpt-4o"
                assistant_id: "asst_"

When I didn't include the "model" in the modelspec it would return an error which, when I checked the debug logs, stemed from Librechat trying to use chatgpt-4o-latest and the assistant api doesn't allow that. Furthermore I updated our image to librechat-dev:latest, which might also have played a role.

So for others getting the same issue:

  • Ensure that your modelSpec is pointing to an assistant which can be accessed by your openAI api key
  • Make sure the model is specified in the modelspec for the assistant
  • Don't use the "assistant_options:" tag in the yaml file.

Finally took a look at this, and I can confirm that assistants will correctly load with the side panel disabled and the preset field correctly configured.

When I didn't include the "model" in the modelspec it would return an error

This shouldn't be the case, and I'm pushing a fix where you can omit the model field as configuring an assistant already has a model defined and it should use that. In the case where it's provided by the model spec, the defined model will be used instead of the assistant model.

I can see how the current documentation is confusing, and it will be updated.

image

interface:
  sidePanel: false
modelSpecs:
  enforce: false
  prioritize: false
  list:
  - name: "Test Assistant"
    label: "Test Assistant"
    description: "a test asst."
    preset:
      assistant_id: asst_2MWAmJ7ywqnT4dFqpvSPryvo
      instructions: "End every message with [END_MESSAGE]"
      endpoint: "assistants"