Git Product home page Git Product logo

danny-avila / librechat Goto Github PK

View Code? Open in Web Editor NEW
11.0K 90.0 2.0K 30.16 MB

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

Home Page: https://librechat.ai/

License: MIT License

JavaScript 38.67% HTML 0.06% CSS 1.62% TypeScript 58.57% Dockerfile 0.04% Handlebars 0.89% Shell 0.14%
ai bing chatgpt clone plugins search chatgpt-clone librechat langchain anthropic

librechat's People

Contributors

alfredo-f avatar berry-13 avatar bsu3338 avatar claraleigh avatar danny-avila avatar danorlando avatar dependabot[bot] avatar dncc89 avatar eburnette avatar eniyiweb avatar f1yn avatar fuegovic avatar hyunggyujang avatar ido777 avatar ineiti avatar itzraiss avatar jinzishuai avatar machinsoft avatar noahdragon avatar ocontant avatar peterdavehello avatar sailflorve avatar snekkenull avatar techwithanirudh avatar thunderbug1 avatar ventz avatar walbercardoso avatar wtlyu avatar ywkim avatar zhangsean avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

librechat's Issues

Support branching feature for Sydney

From time to time, I’d like to diverge to rather minor topic than the current one to explore some concept more deeply; after that I want to get back the original topic.
Such process is inherently having a tree structure, so with branching feature, we can achieve such use cases.

For now I’m relying on regeneration feature to emulate it, but it forces to regenerate semantically insignificant message just to mark a check point, also cannot branching from a message which has children already.

Fortunately enough, with #55, implementation is almost there, this extension should be straightforward by adding a button to AI generated message to be able to start from there afterward.

code view seems to be buggy

I found that the code view is somehow not stable enough,

  1. if the response is writing like
```some code here... still writing

then the code view disappear , until the end three dots comes.

  1. It cannot guess the language, but the official chatgpt can. ( I have checked )
  2. It cause a safety issue that the html code will be rendered directly , for example
    ```html\n' +
    <div class="container">\n' +
      <h1>Welcome to my website!</h1>\n' +
    </div>\n' +
    ```',

image

Pressing Return with an empty prompt to open assistants (models) menu

Currently, it's not possible to select an assistant using only the keyboard. Instead, you have to click on the assistant icon, which may not be obvious to all users. My proposal is to make the assistant menu appear when the user presses the "return" key without typing anything in the input field. This would make it easier to choose an assistant without needing to use the mouse, and it may also be more discoverable than having to click on the assistant icon manually

The "ENTER" key does not work as it should

Describe the bug
"I'm not sure if it's actually a bug or intentional, but when typing a message and hitting "ENTER" instead of sending the message, it just creates a new line, like when we press (SHIFT+ENTER)."

Expected behavior
I hope it works as it should, when typing a message and hitting "ENTER" it should send our request and not break to a new line. It should work like ChatGPT or any other chat bot does

Screenshot_2

Formatting of long answers of Sydney

It appears to me that there are some bugs with Sydney's and Bing's long answers. Maybe it is possible to fix them even if they are rooted in its hacked API? I regularly see formatting like this:
Screenshot 2023-03-14 at 22 57 54

I can't use chatgpt

I don't know why but when I try to chat with chatgpt-clone I get error, this is the error:

1
2

my .env file:
3

I can't use any options: ChatGPT, CustomGPT$..

What could be causing this problem?

Create default conversation before first replay

hi @danny-avila , I'm trying to make chatgpt-clone to create a temp conversation named 'New Chat' whenever user ask, especially before the first reply is complete. That is how official chatgpt behave. Do you have any idea on how to do that?

I noticed that in ask.js, the conversation is created based on gptResponse obj, and it require the conversationId.

Uncaught Error: `props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`.

example question: 如何在react中使用contenteditable

Uncaught Error: `props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://reactjs.org/link/dangerously-set-inner-html for more information.
    at assertValidProps (react-dom.development.js:2952:1)
    at setInitialProperties (react-dom.development.js:9920:1)
    at finalizeInitialChildren (react-dom.development.js:10950:1)
    at completeWork (react-dom.development.js:22193:1)
    at completeUnitOfWork (react-dom.development.js:26596:1)
    at performUnitOfWork (react-dom.development.js:26568:1)
    at workLoopSync (react-dom.development.js:26466:1)
    at renderRootSync (react-dom.development.js:26434:1)
    at recoverFromConcurrentError (react-dom.development.js:25850:1)
    at performSyncWorkOnRoot (react-dom.development.js:26096:1)
assertValidProps @ react-dom.development.js:2952
setInitialProperties @ react-dom.development.js:9920
finalizeInitialChildren @ react-dom.development.js:10950
completeWork @ react-dom.development.js:22193
completeUnitOfWork @ react-dom.development.js:26596
performUnitOfWork @ react-dom.development.js:26568
workLoopSync @ react-dom.development.js:26466
renderRootSync @ react-dom.development.js:26434
recoverFromConcurrentError @ react-dom.development.js:25850
performSyncWorkOnRoot @ react-dom.development.js:26096
flushSyncCallbacks @ react-dom.development.js:12042
(anonymous) @ react-dom.development.js:25651
XMLHttpRequest.send (async)
SSE.stream @ sse.js:200
(anonymous) @ TextChat.jsx:222
commitHookEffectListMount @ react-dom.development.js:23150
commitPassiveMountOnFiber @ react-dom.development.js:24926
commitPassiveMountEffects_complete @ react-dom.development.js:24891
commitPassiveMountEffects_begin @ react-dom.development.js:24878
commitPassiveMountEffects @ react-dom.development.js:24866
flushPassiveEffectsImpl @ react-dom.development.js:27039
flushPassiveEffects @ react-dom.development.js:26984
commitRootImpl @ react-dom.development.js:26935
commitRoot @ react-dom.development.js:26682
performSyncWorkOnRoot @ react-dom.development.js:26117
flushSyncCallbacks @ react-dom.development.js:12042
(anonymous) @ react-dom.development.js:25651

Add options to remember code snippets in conversations

Hello Danny, great initiative, it would be super amazing to have the ability to remember code snippets within the conversations, both those that come as input and those that are generated, as it helps chatgpt not lose the context when doing technical work.

Currently, for instance, I have to copy and paste a thousand times, otherwise, it loses context too quickly, so I have to refresh it every time I ask a new question. Just being able to click to insert previous snippets would be awesome!

Support for not local installations

Hello, I hope this message finds you well. I was exploring the chatgpt-clone project and noticed that it appears to be designed to run on a local machine and only be accessed from there. It would be incredibly beneficial if it were possible to install the project on an external machine as well. I attempted this in my home lab environment, but unfortunately, I was unable to make it work. Thank you for your time and consideration

Using Sydney mode and triggering the censorship block causes error "Error message: Cannot read properties of undefined (reading 'match')"

In the web GUI this appears as:

"An error occurred. Please try again in a few moments.

Error message: Cannot read properties of undefined (reading 'match')"

I've included the debug info from the console below. As best I can tell this is because the censorship causes the final response to have the text field as 'undefined' which then breaks the detectCode function.

We are clearly still receiving the real uncensored response since I can see the words of the real answer printed before they are replaced with the error. I think the solution might be to detect this missing text field and just assume the data received while the response was in-progress is the real text?

Prompt to reproduce: "Describe a man sexually". Can replace "man" with "woman" or "person".

SYDNEY RESPONSE {
  jailbreakConversationId: 'redacted',
  conversationId: '51D|BingProd|redacted',
  conversationSignature: 'redacted',
  clientId: 'redacted',
  invocationId: 1,
  messageId: 'redacted',
  conversationExpiryTime: '2023-03-17Tredacted',
  response: undefined,
  details: {
    author: 'bot',
    createdAt: '2023-03-17Tredacted',
    timestamp: '2023-03-17Tredacted',
    messageId: 'redacted',
    requestId: 'redacted',
    offense: 'None',
    adaptiveCards: [ [Object] ],
    sourceAttributions: [],
    feedback: { tag: null, updatedOn: null, type: 'None' },
    contentOrigin: 'Apology',
    scores: [ [Object] ],
    privacy: null,
    suggestedResponses: [ [Object], [Object], [Object] ]
  }
}
Error in detectCode function
 TypeError: Cannot read properties of undefined (reading 'match')
    at detectCode (C:\Users\user\Documents\chatgpt\chatgpt-clone\api\app\detectCode.js:10:15)
    at handleText (C:\Users\user\Documents\chatgpt\chatgpt-clone\api\server\routes\handlers.js:57:16)
    at ask (C:\Users\user\Documents\chatgpt\chatgpt-clone\api\server\routes\askSydney.js:144:27)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async C:\Users\user\Documents\chatgpt\chatgpt-clone\api\server\routes\askSydney.js:43:10
TypeError: Cannot read properties of undefined (reading 'match')
    at handleText (C:\Users\user\Documents\chatgpt\chatgpt-clone\api\server\routes\handlers.js:63:23)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async ask (C:\Users\user\Documents\chatgpt\chatgpt-clone\api\server\routes\askSydney.js:144:21)
    at async C:\Users\user\Documents\chatgpt\chatgpt-clone\api\server\routes\askSydney.js:43:10

bug: lost unfinished reply

  1. ask a question
  2. leave the conversation before finished
  3. goback the the conversation before finish
  4. we will not see the reply, unless refresh.

"Prompt empty or too short" error for cjk languages

When I entered "你好" in Chinese, an error message such as "Prompt empty or too short" appeared.
"你好" means hello, and its length is only 2 characters in Chinese.
When we use Chinese input, the length of the phrases we use can be very short, and in these cases, the program may indicate an error.

image

I can't click the submit button at the right bottom corner .

When I open the dev mode on my console , and click the submit bottom , then it report following issue
Im using the node version is v.19.0.0
Uncaught TypeError: crypto.randomUUID is not a function
at submitMessage (TextChat.jsx:155)
at handleKeyDown (TextChat.jsx:261)
at HTMLUnknownElement.callCallback (react-dom.development.js:4164)
at Object.invokeGuardedCallbackDev (react-dom.development.js:4213)
at invokeGuardedCallback (react-dom.development.js:4277)
at invokeGuardedCallbackAndCatchFirstError (react-dom.development.js:4291)
at executeDispatch (react-dom.development.js:9041)
at processDispatchQueueItemsInOrder (react-dom.development.js:9073)
at processDispatchQueue (react-dom.development.js:9086)
at dispatchEventsForPlugins (react-dom.development.js:9097)

Suggestion - choice of openai models

It would be really nice to be able to choose between different models like gpt-3.5-tubo, text-davinci-003, (the upcoming) gpt-4....

It could be as an option in the customGPT

Thanks, the project is amazing!

Error message: citationRegex is not defined

When I ask a question using Bing, I find the following error:
image

ReferenceError: citationRegex is not defined
    at ask (/home/runner/chatGPT/chatgpt-clone/api/server/routes/askBing.js:99:50)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async /home/runner/chatGPT/chatgpt-clone/api/server/routes/askBing.js:43:10

And there are no issues when I ask a question using Sydney.

image

Multi-user system

Hi @danny-avila , I wanna if you need a PR containing a multi-user system? I have wrote a simple one and it's somehow extendable for future development.

For now, that's what in my implementation:

  1. add a multi-user system, including login, logout and an API /api/me
  2. UI will display username at the left bottom
  3. Conversation will be connected to the username, so they will not see others' conversation.
  4. The multi-user system is super simple, it based on session.user, containing {display, username}. the display will be used as display name, and the username will be used as a unique string in database.
  5. The login and logout endpoint is not truly implemented, because I use OIDC to connect to my own user center server, so login and logout will redirect to the right place. (but I cannot provide the OIDC part. it's plugin design in order to using any other external auth system, just implement the login and logout, and set the session.user as expected.)

new chat - first message, ai responds, seemingly completes but then receive status 429 (seems like issue with saving as conversation)

WSL2 Environment
ran docker instructions w/ updated tokens
set up a free instance of mongodb atlas e.g. connection string: mongodb+srv://user:[email protected]#s.mongodb.net/?retryWrites=true
upon finishing the first message in convo

happens for both bing and chatgpt models, exact same error message
"An error occurred. Please try again in a few moments.

Error message: Request failed with status code 429"
removed keys from chatgpt-clone-issue-1.txt

IMO, it's trying to save the response as a conversation but runs 429 "too many requests" while doing so

Error in gpt-4

I tried changing model to gpt-4 but it gives me this error:

L'errore è questo:

Error message: Failed to send message. HTTP 404 - {
"error": {
"message": "This is a chat model and not supported in the v1/completions endpoint. Did you mean to use v1/chat/completions?",
"type": "invalid_request_error",
"param": "model",
"code": null
}
}

Not exactly an issue, I can't for the life of me work out how the convo variable is populated....

As title, I've been trying to implement @waylaidwanderers jailbreak client for Bing for a full day and my head is spinning lol.

All it needs is to pass jailbreakConversationId as true on first message, and track it and parentMessageId the same as you would conversationId usually, it doesn't require conversationId, invocationId or conversationSignature or anything like the original bing client does.

I can add in the jailbreakConversationId as true on the first message before it's sent, but I cannot seem to work out how it's building the convo object before the message is being sent.

Just looking for a bit of help on where to look so I can add it...

incompatible with Docker-compose when enable host and proxy params.

From Issue #15

Here is the copy from @Kristovich and his test:

Kristovich

I'm using the docker compose from da62e9a. I built the api and client containers as instructed on the readme.

I also added console.log(`Line 11, host${host}port${port}`); line inside api/server/index.js. When - HOST="0.0.0.0" is set I get:

api_1      |
api_1      | > [email protected] start
api_1      | > node server/index.js
api_1      |
api_1      | Line 11, host"0.0.0.0"port3080
api_1      | node:events:490
api_1      |       throw er; // Unhandled 'error' event
api_1      |       ^
api_1      |
api_1      | Error: getaddrinfo ENOTFOUND "0.0.0.0"
api_1      |     at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26)
api_1      | Emitted 'error' event on Server instance at:
api_1      |     at GetAddrInfoReqWrap.doListen [as callback] (node:net:1934:12)
api_1      |     at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:17) {
api_1      |   errno: -3008,
api_1      |   code: 'ENOTFOUND',
api_1      |   syscall: 'getaddrinfo',
api_1      |   hostname: '"0.0.0.0"'
api_1      | }

If - HOST=0.0.0.0 then

api_1      | 
api_1      | > [email protected] start
api_1      | > node server/index.js
api_1      | 
api_1      | Line 11, host0.0.0.0port3080
api_1      | Server listening at http://0.0.0.0:3080

And while I'm at it: If - PROXY="" is present inside the docker-compose.yml, then the server will work but requests to openai or bing will fail with

api_1      | ask log {
api_1      |   model: 'chatgpt',
api_1      |   id: '[uuid]',
api_1      |   sender: 'User',
api_1      |   text: 'this is a test',
api_1      |   parentMessageId: undefined,
api_1      |   conversationId: undefined,
api_1      |   chatGptLabel: '',
api_1      |   promptPrefix: ''
api_1      | }
api_1      | TypeError [ERR_INVALID_URL]: Invalid URL
api_1      |     at new NodeError (node:internal/errors:399:5)
api_1      |     at new URL (node:internal/url:588:13)
api_1      |     at new ProxyAgent (/api/node_modules/undici/lib/proxy-agent.js:67:25)
api_1      |     at ChatGPTClient.getCompletion (file:///api/node_modules/@waylaidwanderer/chatgpt-api/src/ChatGPTClient.js:168:31)
api_1      |     at ChatGPTClient.sendMessage (file:///api/node_modules/@waylaidwanderer/chatgpt-api/src/ChatGPTClient.js:297:24)
api_1      |     at async askClient (/api/app/chatgpt-client.js:28:15)
api_1      |     at async /api/server/routes/ask.js:90:23 {
api_1      |   input: '""',
api_1      |   code: 'ERR_INVALID_URL'
api_1      | }

So I had to remove the PROXY env out of the docker-compose file for it to work.

I hope this helps.

chatgpt-clone-api-1 exited with code 1

First off. This is an amazing project. Thanks for putting this together.

I downloaded the latest update (this morning) and I get the following error when deploying with Docker Compose:

chatgpt-clone-api-1     | node:events:490
chatgpt-clone-api-1     |       throw er; // Unhandled 'error' event
chatgpt-clone-api-1     |       ^
chatgpt-clone-api-1     | 
chatgpt-clone-api-1     | Error: getaddrinfo EAI_AGAIN "localhost"
chatgpt-clone-api-1     |     at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26)
chatgpt-clone-api-1     | Emitted 'error' event on Server instance at:
chatgpt-clone-api-1     |     at GetAddrInfoReqWrap.doListen [as callback] (node:net:1934:12)
chatgpt-clone-api-1     |     at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:17) {
chatgpt-clone-api-1     |   errno: -3001,
chatgpt-clone-api-1     |   code: 'EAI_AGAIN',
chatgpt-clone-api-1     |   syscall: 'getaddrinfo',
chatgpt-clone-api-1     |   hostname: '"localhost"'
chatgpt-clone-api-1     | }
chatgpt-clone-api-1     | 
chatgpt-clone-api-1     | Node.js v19.7.0

I have also tried filling in - HOST="" in the Docker Compose file with the proper hostname and it is still not working.

Any ideas?

Please use the 'main' branch!

There were some breaking changes with the latest node-chatgpt-api release. Will need time to review those changes on master, which may have suffered from auto-merging issues.

The now renamed and default main branch is confirmed to be working as expected so you can use this as the base.

Thank you for your sponsorship and your great project! 💖

Hey, I saw that you sponsored me! While checking out your profile, I came across your project and wanted to say that it looks great! I really like your prompt template feature.

Your idea of having an icon in the text input to switch between AI clients is brilliant, and I may borrow it for my own web client.

Thanks for the sponsor, and keep up the good work!

Enable default focus on input field in prompt line to improve user experience

Presently, the prompt line does not have automatic focus by default. Consequently, you are required to manually click on the input field before they can begin typing, which leads to slower performance and disallows the use of keyboard-only interactions.

In contrast, in the original ChatGPT interface, as well as in the default Bing and Poe interfaces, the input field has automatic focus from the outset, allowing for immediate keyboard use without the need for any additional clicks.

Bug of chatgptCustom

bug 1:
When save and submit a new chatgptCustom, there is nothing added to the model menu, unless refresh

bug2:
when have multiple chatgptCustom, deleted one of them, it looks like another one is deleted. (but after refresh, everything got correct)

BTW, what's the differencee between save and submit? I got confused.

ask error

api_1 | CLIENT RESPONSE {
api_1 | response: 'Hello there! Did you mean to type BAAI? If so, what can I assist you with regarding that term?',
api_1 | conversationId: '1f35b103-a084-4246-af3d-',
api_1 | parentMessageId: 'd275df1b-bae1-4128-97e7-
',
api_1 | messageId: 'ae141143-74f6-4df3-b5a5-****',
api_1 | details: {}
api_1 | }
api_1 | TypeError: Cannot read properties of undefined (reading 'includes')
api_1 | at ask (/api/server/routes/ask.js:134:25)
api_1 | at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
api_1 | at async /api/server/routes/ask.js:51:10
api_1 | The client has disconnected.

scroll to bottom, looks to be hesitantly

when new message is receiving, especially add new lines too quick, the auto scroll to end behaves to be hesitantly, and cannot scroll fast enough to the end.

this is mostly happened in mobile version. you can try write me a poem

here is a video. you can see the scroll cannot match the end starting from the second response, while responding.

I think it's because we call scrolltoend too much.
maybe we can detect scrolltop of the end element and skip some scrolltoend call if not changed. (might not fix completely)

using Customize ChatGPT Prompt have issue

I got this error when I using Customize ChatGPT Prompt

An error occurred. Please try again in a few moments.

Error message: Cannot read properties of undefined (reading 'includes')

question: dynamic language support

i noticed when using official chatgpt, i will get title with the same language.
but in this project, only English title will be generated. even though i talk with chatgpt using Chinese

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.