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.
https://librechat.ai/
MIT License
17.91k stars 2.98k forks source link

Enhancement: OpenAI Assistants API V2 support #2490

Open danny-avila opened 5 months ago

danny-avila commented 5 months ago

Initial support added in https://github.com/danny-avila/LibreChat/pull/2781

5/19/24

Read the PR notes for more details on what changed, and what is still to be done.


Discussed in https://github.com/danny-avila/LibreChat/discussions/2489

Originally posted by **sathyarajv** April 22, 2024 OpenAI updated the Assistants API to V2 with changes to the tools and files. Refer the Migration steps [here](https://platform.openai.com/docs/assistants/migration/what-has-changed) ![image](https://github.com/danny-avila/LibreChat/assets/9957258/e3717564-24a7-443e-99ea-2cb8565028dd) Known issues: The attached files of an existing Assistants are not loading in the UI but its available on the OpenAI platform. Migrating to V2 will resolve this issue. Any plan on this migration?
scottbetza commented 5 months ago

Will this enhancement planned for v0.7.3 milestone completion allow for > 20 files?

danny-avila commented 5 months ago

Will this enhancement planned for v0.7.3 milestone completion allow for > 20 files?

yes I think it's possible through vector stores

danny-avila commented 4 months ago

Due to several undocumented, breaking and non-breaking changes, as well as gpt-4o support being exclusive to v2, this is a priority item for this week.

danny-avila commented 4 months ago

Just a quick preview of what will be possible with Assistants V2 (also using gpt-4o):

https://github.com/danny-avila/LibreChat/assets/110412045/20a42ba8-bfbf-498d-8914-f72d7b5d4d1c

danny-avila commented 4 months ago

I've made a lot of progress, and the initial support is almost done but not quite ready.

Azure integration breaks with the latest openai SDK versions, so I need to write old v1 methods for Azure file handling. Because of the differences with Azure, even later on, I've decided to make Azure Assistants its own endpoint, and there are also a few things to touch on to complete that process.

The way file attachments now work for tool resources is not fully complete for Code Interpreter, but is nearly done (just need to handle deleting from its tool_resources)

This is saying nothing of the new File Search vector store handling. This needs a completely new UI and file management system, which I've already started earlier this week.

My goal is to release the initial support tomorrow, with the ability to use all v2 features including file search, but no way manage/attach vector stores for file search yet, other than attaching files at the thread level.

I've addressed a lot of fixes for Assistants in the process, so I'm excited to get this out soon!

danny-avila commented 4 months ago

Merging soon, read the full notes if you're interested!

https://github.com/danny-avila/LibreChat/pull/2781

illgitthat commented 4 months ago

@danny-avila thanks so much for your work on this. I saw that Azure OpenAI announced support for assistants v2 today.

Passing this on in case it would (hopefully) be a comparatively easy task to add Azure support.

danny-avila commented 4 months ago

@danny-avila thanks so much for your work on this. I saw that Azure OpenAI announced support for assistants v2 today.

Passing this on in case it would (hopefully) be a comparatively easy task to add Azure support.

Cool! i'll see if it's as easy as flipping a switch at this point

danny-avila commented 4 months ago

Right now, I'm able to get v2 working which enables streaming for Azure Assistants, but it is really unreliable with files, even in playground. For anyone that wants to try: https://github.com/danny-avila/LibreChat/pull/2820

BennyMorton28 commented 4 months ago

Has anyone gotten gpt-4o working with Assistants in Librechat yet?

danny-avila commented 4 months ago

Has anyone gotten gpt-4o working with Assistants in Librechat yet?

Yup. On the latest build, it's fully functional: image

BennyMorton28 commented 4 months ago

Sorry to keep troubling on this issue, I can't get it to work. I updated my assistant on OpenAI to be gpt-4o, and in my librechat.yaml file, and then when I rebuild I get the error below. I am using Docker, but I think there might be an update issue to the latest Librechat, but I'm not sure how to update/get the latest build? Thanks for any help

Screenshot 2024-05-29 at 4 02 42 PM
danny-avila commented 4 months ago

Sorry to keep troubling on this issue, I can't get it to work. I updated my assistant on OpenAI to be gpt-4o, and in my librechat.yaml file, and then when I rebuild I get the error below. I am using Docker, but I think there might be an update issue to the latest Librechat, but I'm not sure how to update/get the latest build? Thanks for any help

I think you have a merge conflict while trying to update. Send an email to danny@librechat.ai and we can setup a time to troubleshoot live.

djuillard commented 3 months ago

I experience the same issue as the one above-mentioned. Is there any chance the error comes from wrong settings ni the librechat.yaml file ?

danny-avila commented 3 months ago

I experience the same issue as the one above-mentioned. Is there any chance the error comes from wrong settings ni the librechat.yaml file ?

Only if its azure, the error above was not related to azure

djuillard commented 3 months ago

I experience the same issue as the one above-mentioned. Is there any chance the error comes from wrong settings ni the librechat.yaml file ?

Only if its azure, the error above was not related to azure

Yes, I'm on Azure.

xfoggi commented 2 months ago

OpenAI released GPT-4o-mini. Unfortunately, it runs only on V2. Any plans to migrate? :)

Error updating assistant 400 The requested model 'gpt-4o-mini' cannot be used with the Assistants API in v1. Follow the migration guide to upgrade to v2: https://platform.openai.com/docs/assistants/migration.
kezzzsVS commented 1 month ago

Just to add my voice on this, Azure OpenAI Assistants V2 support would be incredibly helpful. I would really like to be using GPT-4o for these (and soon GPT-4o mini)

scottbetza commented 1 month ago

Are vector stores now supported in v0.74?

danny-avila commented 1 month ago

Are vector stores now supported in v0.74?

No, what you're asking for is a file browser for an OpenAI integration. Something like this will come for a native Agents integration before it's done for OpenAI, where you can already configure this on their dashboard