Enhanced ChatGPT Clone: Features Agents, MCP, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active. https://librechat.ai/
Find a file
Danny Avila 4ca43fb53d
refactor: Encrypt & Expire User Provided Keys, feat: Rate Limiting (#874)
* docs: make_your_own.md formatting fix for mkdocs

* feat: add express-mongo-sanitize
feat: add login/registration rate limiting

* chore: remove unnecessary console log

* wip: remove token handling from localStorage to encrypted DB solution

* refactor: minor change to UserService

* fix mongo query and add keys route to server

* fix backend controllers and simplify schema/crud

* refactor: rename token to key to separate from access/refresh tokens, setTokenDialog -> setKeyDialog

* refactor(schemas): TEndpointOption token -> key

* refactor(api): use new encrypted key retrieval system

* fix(SetKeyDialog): fix key prop error

* fix(abortMiddleware): pass random UUID if messageId is not generated yet for proper error display on frontend

* fix(getUserKey): wrong prop passed in arg, adds error handling

* fix: prevent message without conversationId from saving to DB, prevents branching on the frontend to a new top-level branch

* refactor: change wording of multiple display messages

* refactor(checkExpiry -> checkUserKeyExpiry): move to UserService file

* fix: type imports from common

* refactor(SubmitButton): convert to TS

* refactor(key.ts): change localStorage map key name

* refactor: add new custom tailwind classes to better match openAI colors

* chore: remove unnecessary warning and catch ScreenShot error

* refactor: move userKey frontend logic to hooks and remove use of localStorage and instead query the DB

* refactor: invalidate correct query key, memoize userKey hook, conditionally render SetKeyDialog to avoid unnecessary calls, refactor SubmitButton props and useEffect for showing 'provide key first'

* fix(SetKeyDialog): use enum-like object for expiry values
feat(Dropdown): add optionsClassName to dynamically change dropdown options container classes

* fix: handle edge case where user had provided a key but the server changes to env variable for keys

* refactor(OpenAI/titleConvo): move titling to client to retain authorized credentials in message lifecycle for titling

* fix(azure): handle user_provided keys correctly for azure

* feat: send user Id to OpenAI to differentiate users in completion requests

* refactor(OpenAI/titleConvo): adding tokens helps minimize LLM from using the language in title response

* feat: add delete endpoint for keys

* chore: remove throttling of title

* feat: add 'Data controls' to Settings, add 'Revoke' keys feature in Key Dialog and Data controls

* refactor: reorganize PluginsClient files in langchain format

* feat: use langchain for titling convos

* chore: cleanup titling convo, with fallback to original method, escape braces, use only snippet for language detection

* refactor: move helper functions to appropriate langchain folders for reusability

* fix: userProvidesKey handling for gptPlugins

* fix: frontend handling of plugins key

* chore: cleanup logging and ts-ignore SSE

* fix: forwardRef misuse in DangerButton

* fix(GoogleConfig/FileUpload): localize errors and simplify validation with zod

* fix: cleanup google logging and fix user provided key handling

* chore: remove titling from google

* chore: removing logging from browser endpoint

* wip: fix menu flicker

* feat: useLocalStorage hook

* feat: add Tooltip for UI

* refactor(EndpointMenu): utilize Tooltip and useLocalStorage, remove old 'New Chat' slide-over

* fix(e2e): use testId for endpoint menu trigger

* chore: final touches to EndpointMenu before future refactor to declutter component

* refactor(localization): change select endpoint to open menu and add translations

* chore: add final prop to error message response

* ci: minor edits to facilitate testing

* ci: new e2e test which tests for new key setting/revoking features
2023-09-06 10:46:27 -04:00
.devcontainer docs: Add Azure Instructions (Terraform) to Cloud Deployments Guide (#738) 2023-08-04 14:23:41 -04:00
.github Release v0.5.8 (#854) 2023-08-28 14:24:10 -04:00
.husky test: frontend jest ci/cd & minor fixes post-release (#478) 2023-06-11 00:00:48 -04:00
api refactor: Encrypt & Expire User Provided Keys, feat: Rate Limiting (#874) 2023-09-06 10:46:27 -04:00
client refactor: Encrypt & Expire User Provided Keys, feat: Rate Limiting (#874) 2023-09-06 10:46:27 -04:00
config update: install script (#858) 2023-09-01 14:20:51 -04:00
docs refactor: Encrypt & Expire User Provided Keys, feat: Rate Limiting (#874) 2023-09-06 10:46:27 -04:00
e2e refactor: Encrypt & Expire User Provided Keys, feat: Rate Limiting (#874) 2023-09-06 10:46:27 -04:00
packages/data-provider refactor: Encrypt & Expire User Provided Keys, feat: Rate Limiting (#874) 2023-09-06 10:46:27 -04:00
pyserver feat: Add Code Interpreter Plugin (#837) 2023-08-28 09:13:50 -04:00
.dockerignore chore: Update docker, Minor Styling fix (#528) 2023-06-17 11:38:48 -04:00
.env.example refactor: Encrypt & Expire User Provided Keys, feat: Rate Limiting (#874) 2023-09-06 10:46:27 -04:00
.eslintrc.js refactor(client): Refactors recent typescript changes for best practices (#763) 2023-08-05 16:45:26 -04:00
.gitignore ci: add e2e workflow, optimize client code for testing (#771) 2023-08-08 11:17:15 -04:00
CODE_OF_CONDUCT.md docs: fix outdated references (#480) 2023-06-11 11:18:32 -04:00
CONTRIBUTING.md docs: fix outdated references (#480) 2023-06-11 11:18:32 -04:00
deploy-compose.yml chore(docker-compose.yml): comment out meilisearch ports in docker-compose.yml (#807) 2023-08-14 10:23:00 -04:00
docker-compose.yml chore(docker-compose.yml): comment out meilisearch ports in docker-compose.yml (#807) 2023-08-14 10:23:00 -04:00
Dockerfile Add podman installation instructions. Update dockerfile to stub env (#819) 2023-08-24 20:20:37 -04:00
Dockerfile.multi chore(Dockerfile.multi): add data-provider package build and copy step 2023-07-30 11:50:24 -04:00
index.html Update index.html to replace ChatGPT Clone with LibreChat (#724) 2023-07-28 19:14:58 -04:00
LICENSE.md docs: fix outdated references (#480) 2023-06-11 11:18:32 -04:00
lint-staged.config.js ci(backend-review.yml): add linter step to the backend review workflow (#625) 2023-07-14 09:36:49 -04:00
mkdocs.yml doc: Hugging Face Deployment (#867) 2023-09-01 08:12:35 -04:00
package-lock.json refactor: Encrypt & Expire User Provided Keys, feat: Rate Limiting (#874) 2023-09-06 10:46:27 -04:00
package.json Release v0.5.8 (#854) 2023-08-28 14:24:10 -04:00
prettier.config.js refactor: Settings/Presets UI Restructure, convert many files to TS (#740) 2023-08-04 13:56:44 -04:00
README.md docs: fix docker install guide broken link (#877) 2023-09-04 16:32:11 -04:00
SECURITY.md docs: fix outdated references (#480) 2023-06-11 11:18:32 -04:00

LibreChat

All-In-One AI Conversations with LibreChat

LibreChat brings together the future of assistant AIs with the revolutionary technology of OpenAI's ChatGPT. Celebrating the original styling, LibreChat gives you the ability to integrate multiple AI models. It also integrates and enhances original client features such as conversation and message search, prompt templates and plugins.

With LibreChat, you no longer need to opt for ChatGPT Plus and can instead use free or pay-per-call APIs. We welcome contributions, cloning, and forking to enhance the capabilities of this advanced chatbot platform.

Watch the video Click on the thumbnail to open the video☝️

Features

  • Response streaming identical to ChatGPT through server-sent events
  • UI from original ChatGPT, including Dark mode
  • AI model selection: OpenAI API, BingAI, ChatGPT Browser, PaLM2, Anthropic (Claude), Plugins
  • Create, Save, & Share custom presets - More info on prompt presets here
  • Edit and Resubmit messages with conversation branching
  • Search all messages/conversations - More info here
  • Plugins now available (including web access, image generation and more)

⚠️ Breaking Changes ⚠️

Please read this before updating from a previous version


Changelog

Keep up with the latest updates by visiting the releases page - Releases


Table of Contents

Getting Started
General Information
Features
Cloud Deployment
Contributions

Star History

Star History Chart


Sponsors

Sponsored by @mjtechguy, @SphaeroX, @DavidDev1334, @fuegovic, @Pharrcyde


Contributors

Contributions and suggestions bug reports and fixes are welcome! Please read the documentation before you do!


For new features, components, or extensions, please open an issue and discuss before sending a PR.

This project exists in its current state thanks to all the people who contribute