* mkdocs plugins: add plugin for social cards and plugin that allow to exclude a folder
* docs: fix hyperlinks
* mkdocs: social cards (descriptions) for 'contributions' and 'deployment' guides
* mkdocs: social cards (descriptions) for all 'index.md'
* mkdocs: social cards (descriptions) for 'features' and 'plugins'
* mkdocs: social cards (descriptions) for 'general_info'
* mkdocs: social cards (descriptions) for 'configuration'
* mkdocs: social cards (descriptions) for 'installation'
* mkdocs: minor fixes
* update librechat.svg
* update how_to_contribute.md
add reference to the official GitHub documentation
* feat(AzureOpenAI): Vision Support
* chore(ci/OpenAIClient.test): update test to reflect Azure now uses chatCompletion method as opposed to getCompletion, while still testing the latter method
* docs: update documentation mainly revolving around Azure setup, but also reformatting the 'Tokens and API' section completely
* docs: add images and links to ai_setup.md
* docs: ai setup reference
* WIP: initial logging changes
add several transports in ~/config/winston
omit messages in logs, truncate long strings
add short blurb in dotenv for debug logging
GoogleClient: using logger
OpenAIClient: using logger, handleOpenAIErrors
Adding typedef for payload message
bumped winston and using winston-daily-rotate-file
moved config for server paths to ~/config dir
Added `DEBUG_LOGGING=true` to .env.example
* WIP: Refactor logging statements in code
* WIP: Refactor logging statements and import configurations
* WIP: Refactor logging statements and import configurations
* refactor: broadcast Redis initialization message with `info` not `debug`
* refactor: complete Refactor logging statements and import configurations
* chore: delete unused tools
* fix: circular dependencies due to accessing logger
* refactor(handleText): handle booleans and write tests
* refactor: redact sensitive values, better formatting
* chore: improve log formatting, avoid passing strings to 2nd arg
* fix(ci): fix jest tests due to logger changes
* refactor(getAvailablePluginsController): cache plugins as they are static and avoids async addOpenAPISpecs call every time
* chore: update docs
* chore: update docs
* chore: create separate meiliSync logger, clean up logs to avoid being unnecessarily verbose
* chore: spread objects where they are commonly logged to allow string truncation
* chore: improve error log formatting
* Update azure_cognitive_search.md
* Updated: Azure Cognitive Search Plugin to Azure AI Search Plugin.
Update Docs: Azure Cognitive Search Plugin to Azure AI Search Plugin.
Updated:.env.example Azure Cognitive Search to Azure AI Search
Updated: mkdocs.yml link
Updated: SDK Azure 11.3.2 to 12.0.0
* fix:.env AZURE- to AZURE_
* Update azure_ai_search.md
* Updated:(api/package.json, package-lock.json): updated for new version the
plugin (@azure/search-documents)
* fix:Resolved incorrect file name AzureAISearch
* fix:.env Azure AI Search
* fix:"-" to "_"
* Update Docs: Azure AI Search ith an improved tutorial featuring images and easier-to-understand instructions
fix: Change name of plugin "Azure Ai Search" to "Azure AI Search" i
* Update:Version of REST API versions (Azure AI Search)
* Update azure_ai_search.md
* Update azure_ai_search.md
* Update azure_ai_search.md
* fix: docs Azure AI Seach Images were not appearing.
* fix:Updated to the new repository with working APIs
* Update: Added Compatibility for Previous Environment Variable Names in AzureAISearch Plugin
* Update: Added Compatibility for Previous Environment Variable Names in AzureAISearch Plugin
* Update: Added Compatibility for Previous Environment Variable Names in AzureAISearch Plugin
* Update: Added Compatibility for Previous Environment Variable Names in AzureAISearch Plugin
* Update: o AzureAiSearch.js
* Atualizar o AzureAISearch.js
* Update/fix:EnvironmentVariablesForDeprecation
* fix:The file is outdated and needs to be updated.
* fix:The file is outdated and needs to be updated.
* update: translation portuguese brazilian
* Refactor:Improve Readability and Cleanliness of AzureAISearch Class
* Update AzureAiSearch.js
* Update AzureAISearch.js
* refactor(Chains/llms): allow passing callbacks
* refactor(BaseClient): accurately count completion tokens as generation only
* refactor(OpenAIClient): remove unused getTokenCountForResponse, pass streaming var and callbacks in initializeLLM
* wip: summary prompt tokens
* refactor(summarizeMessages): new cut-off strategy that generates a better summary by adding context from beginning, truncating the middle, and providing the end
wip: draft out relevant providers and variables for token tracing
* refactor(createLLM): make streaming prop false by default
* chore: remove use of getTokenCountForResponse
* refactor(agents): use BufferMemory as ConversationSummaryBufferMemory token usage not easy to trace
* chore: remove passing of streaming prop, also console log useful vars for tracing
* feat: formatFromLangChain helper function to count tokens for ChatModelStart
* refactor(initializeLLM): add role for LLM tracing
* chore(formatFromLangChain): update JSDoc
* feat(formatMessages): formats langChain messages into OpenAI payload format
* chore: install openai-chat-tokens
* refactor(formatMessage): optimize conditional langChain logic
fix(formatFromLangChain): fix destructuring
* feat: accurate prompt tokens for ChatModelStart before generation
* refactor(handleChatModelStart): move to callbacks dir, use factory function
* refactor(initializeLLM): rename 'role' to 'context'
* feat(Balance/Transaction): new schema/models for tracking token spend
refactor(Key): factor out model export to separate file
* refactor(initializeClient): add req,res objects to client options
* feat: add-balance script to add to an existing users' token balance
refactor(Transaction): use multiplier map/function, return balance update
* refactor(Tx): update enum for tokenType, return 1 for multiplier if no map match
* refactor(Tx): add fair fallback value multiplier incase the config result is undefined
* refactor(Balance): rename 'tokens' to 'tokenCredits'
* feat: balance check, add tx.js for new tx-related methods and tests
* chore(summaryPrompts): update prompt token count
* refactor(callbacks): pass req, res
wip: check balance
* refactor(Tx): make convoId a String type, fix(calculateTokenValue)
* refactor(BaseClient): add conversationId as client prop when assigned
* feat(RunManager): track LLM runs with manager, track token spend from LLM,
refactor(OpenAIClient): use RunManager to create callbacks, pass user prop to langchain api calls
* feat(spendTokens): helper to spend prompt/completion tokens
* feat(checkBalance): add helper to check, log, deny request if balance doesn't have enough funds
refactor(Balance): static check method to return object instead of boolean now
wip(OpenAIClient): implement use of checkBalance
* refactor(initializeLLM): add token buffer to assure summary isn't generated when subsequent payload is too large
refactor(OpenAIClient): add checkBalance
refactor(createStartHandler): add checkBalance
* chore: remove prompt and completion token logging from route handler
* chore(spendTokens): add JSDoc
* feat(logTokenCost): record transactions for basic api calls
* chore(ask/edit): invoke getResponseSender only once per API call
* refactor(ask/edit): pass promptTokens to getIds and include in abort data
* refactor(getIds -> getReqData): rename function
* refactor(Tx): increase value if incomplete message
* feat: record tokenUsage when message is aborted
* refactor: subtract tokens when payload includes function_call
* refactor: add namespace for token_balance
* fix(spendTokens): only execute if corresponding token type amounts are defined
* refactor(checkBalance): throws Error if not enough token credits
* refactor(runTitleChain): pass and use signal, spread object props in create helpers, and use 'call' instead of 'run'
* fix(abortMiddleware): circular dependency, and default to empty string for completionTokens
* fix: properly cancel title requests when there isn't enough tokens to generate
* feat(predictNewSummary): custom chain for summaries to allow signal passing
refactor(summaryBuffer): use new custom chain
* feat(RunManager): add getRunByConversationId method, refactor: remove run and throw llm error on handleLLMError
* refactor(createStartHandler): if summary, add error details to runs
* fix(OpenAIClient): support aborting from summarization & showing error to user
refactor(summarizeMessages): remove unnecessary operations counting summaryPromptTokens and note for alternative, pass signal to summaryBuffer
* refactor(logTokenCost -> recordTokenUsage): rename
* refactor(checkBalance): include promptTokens in errorMessage
* refactor(checkBalance/spendTokens): move to models dir
* fix(createLanguageChain): correctly pass config
* refactor(initializeLLM/title): add tokenBuffer of 150 for balance check
* refactor(openAPIPlugin): pass signal and memory, filter functions by the one being called
* refactor(createStartHandler): add error to run if context is plugins as well
* refactor(RunManager/handleLLMError): throw error immediately if plugins, don't remove run
* refactor(PluginsClient): pass memory and signal to tools, cleanup error handling logic
* chore: use absolute equality for addTitle condition
* refactor(checkBalance): move checkBalance to execute after userMessage and tokenCounts are saved, also make conditional
* style: icon changes to match official
* fix(BaseClient): getTokenCountForResponse -> getTokenCount
* fix(formatLangChainMessages): add kwargs as fallback prop from lc_kwargs, update JSDoc
* refactor(Tx.create): does not update balance if CHECK_BALANCE is not enabled
* fix(e2e/cleanUp): cleanup new collections, import all model methods from index
* fix(config/add-balance): add uncaughtException listener
* fix: circular dependency
* refactor(initializeLLM/checkBalance): append new generations to errorMessage if cost exceeds balance
* fix(handleResponseMessage): only record token usage in this method if not error and completion is not skipped
* fix(createStartHandler): correct condition for generations
* chore: bump postcss due to moderate severity vulnerability
* chore: bump zod due to low severity vulnerability
* chore: bump openai & data-provider version
* feat(types): OpenAI Message types
* chore: update bun lockfile
* refactor(CodeBlock): add error block formatting
* refactor(utils/Plugin): factor out formatJSON and cn to separate files (json.ts and cn.ts), add extractJSON
* chore(logViolation): delete user_id after error is logged
* refactor(getMessageError -> Error): change to React.FC, add token_balance handling, use extractJSON to determine JSON instead of regex
* fix(DALL-E): use latest openai SDK
* chore: reorganize imports, fix type issue
* feat(server): add balance route
* fix(api/models): add auth
* feat(data-provider): /api/balance query
* feat: show balance if checking is enabled, refetch on final message or error
* chore: update docs, .env.example with token_usage info, add balance script command
* fix(Balance): fallback to empty obj for balance query
* style: slight adjustment of balance element
* docs(token_usage): add PR notes
* refactor: require Auth middleware in route index files
* feat: concurrent message limiter
* feat: complete concurrent message limiter with caching
* refactor: SSE response methods separated from handleText
* fix(abortMiddleware): fix req and res order to standard, use endpointOption in req.body
* chore: minor name changes
* refactor: add isUUID condition to saveMessage
* fix(concurrentLimiter): logic correctly handles the max number of concurrent messages and res closing/finalization
* chore: bump keyv and remove console.log from Message
* fix(concurrentLimiter): ensure messages are only saved in later message children
* refactor(concurrentLimiter): use KeyvFile instead, could make other stores configurable in the future
* feat: add denyRequest function for error responses
* feat(utils): add isStringTruthy function
Introduce the isStringTruthy function to the utilities module to check if a string value is a case-insensitive match for 'true'
* feat: add optional message rate limiters by IP and userId
* feat: add optional message rate limiters by IP and userId to edit route
* refactor: rename isStringTruthy to isTrue for brevity
* refactor(getError): use map to make code cleaner
* refactor: use memory for concurrent rate limiter to prevent clearing on startup/exit, add multiple log files, fix error message for concurrent violation
* feat: check if errorMessage is object, stringify if so
* chore: send object to denyRequest which will stringify it
* feat: log excessive requests
* fix(getError): correctly pluralize messages
* refactor(limiters): make type consistent between logs and errorMessage
* refactor(cache): move files out of lib/db into separate cache dir
>> feat: add getLogStores function so Keyv instance is not redundantly created on every violation
feat: separate violation logging to own function with logViolation
* fix: cache/index.js export, properly record userViolations
* refactor(messageLimiters): use new logging method, add logging to registrations
* refactor(logViolation): make userLogs an array of logs per user
* feat: add logging to login limiter
* refactor: pass req as first param to logViolation and record offending IP
* refactor: rename isTrue helper fn to isEnabled
* feat: add simple non_browser check and log violation
* fix: open handles in unit tests, remove KeyvMongo as not used and properly mock global fetch
* chore: adjust nodemon ignore paths to properly ignore logs
* feat: add math helper function for safe use of eval
* refactor(api/convos): use middleware at top of file to avoid redundancy
* feat: add delete all static method for Sessions
* fix: redirect to login on refresh if user is not found, or the session is not found but hasn't expired (ban case)
* refactor(getLogStores): adjust return type
* feat: add ban violation and check ban logic
refactor(logViolation): pass both req and res objects
* feat: add removePorts helper function
* refactor: rename getError to getMessageError and add getLoginError for displaying different login errors
* fix(AuthContext): fix type issue and remove unused code
* refactor(bans): ban by ip and user id, send response based on origin
* chore: add frontend ban messages
* refactor(routes/oauth): add ban check to handler, also consolidate logic to avoid redundancy
* feat: add ban check to AI messaging routes
* feat: add ban check to login/registration
* fix(ci/api): mock KeyvMongo to avoid tests hanging
* docs: update .env.example
> refactor(banViolation): calculate interval rate crossover, early return if duration is invalid
ci(banViolation): add tests to ensure users are only banned when expected
* docs: improve wording for mod system
* feat: add configurable env variables for violation scores
* chore: add jsdoc for uaParser.js
* chore: improve ban text log
* chore: update bun test scripts
* refactor(math.js): add fallback values
* fix(KeyvMongo/banLogs): refactor keyv instances to top of files to avoid memory leaks, refactor ban logic to use getLogStores instead
refactor(getLogStores): get a single log store by type
* fix(ci): refactor tests due to banLogs changes, also make sure to clear and revoke sessions even if ban duration is 0
* fix(banViolation.js): getLogStores import
* feat: handle 500 code error at login
* fix(middleware): handle case where user.id is _id and not just id
* ci: add ban secrets for backend unit tests
* refactor: logout user upon ban
* chore: log session delete message only if deletedCount > 0
* refactor: change default ban duration (2h) and make logic more clear in JSDOC
* fix: login and registration limiters will now return rate limiting error
* fix: userId not parsable as non ObjectId string
* feat: add useTimeout hook to properly clear timeouts when invoking functions within them
refactor(AuthContext): cleanup code by using new hook and defining types in ~/common
* fix: login error message for rate limits
* docs: add info for automated mod system and rate limiters, update other docs accordingly
* chore: bump data-provider version
* feat(AzureCognitiveSearchPlugin)
* feat(tools/AzureCognitiveSearch.js): Add a new plugin (not structured
version)
* feat(tools/structured/AzureCognitiveSearch.js): Add a new plugin (structured version)
* feat(tools/manifest.json, tools/index.js, tools/util/handleTools.js):
Add configurations for the plugin
* feat(api/package.json, package-lock.json): Installed a new package for the
plugin (@azure/search-documents)
* feat(.env.example): Add new environment variables for the plugin
Here is the link to the corresponding discussion page:
https://github.com/danny-avila/LibreChat/discussions/567
* docs(AzureCognitiveSearchPlugin)
* docs(features/plugins/azure_cognitive_search.md): Add a new document
for the plugin
* (fix:.env.example)
* reverted extra whitespaces removed by the editor
* docs(mkdocs.yml)
* Add the Azure Cognitive Search Plugin's documentation item to
mkdocs.yml.
* docs: wip: digitalocean guide
* feat(deployed-update.js): add script for updating deployed instance
docs(deployment/digitalocean.md): update instructions for Digital Ocean deployment
* fix(deployed-update.js): change docker-compose pull command to only pull api image
fix(digitalocean.md): update instructions to add user to docker group and start docker before running installation/update script
* feat(package.json): add 'update:deployed' script for deployed updates
docs: wip: digitalocean
* chore(package.json): add start:deployed and stop:deployed scripts for deploying with docker-compose
* docs(deployment/digitalocean.md): add instructions for stopping and starting the docker container
* docs(deployment/digitalocean.md): add instructions for stopping and starting the docker container
docs(deployment/digitalocean.md): add command for checking active docker containers
docs(deployment/digitalocean.md): provide guidance for troubleshooting before creating a new issue
* fix(deployed-update.js): refactor code to use getCurrentBranch function
feat(deployed-update.js): add support for rebasing current branch onto main branch
docs(digitalocean.md): update instructions for deploying with Docker on remote Ubuntu server
package.json: add rebase:deployed script to run deployed-update.js with --rebase flag
* fix(deployed-update.js): fix variable scope issue in deployed-update.js
docs(digitalocean.md): fix grammar and clarify instructions for editing NGINX file
* docs(deployment): add warning about potential merge conflicts when editing branch
docs(deployment): clarify that code changes in environment won't be reflected
* docs: Update digitalocean.md with images and revised instructions
* docs(digitalocean.md): formatting
* docs(digitalocean.md): add ToC
* docs(digitalocean.md): fix ToC
* Update mkdocs.yml
* Update documents for mkdocs compatibility
* documents update
* documents update
* Update README.md
* Update README.md
add link to "https://docs.librechat.ai" on the logo
* document updates
* docs - badge updates
* docs - badge updates
* docs - badge updates
* Update docker_install.md
* Update .env.example
update default MONGO_URI to port 27018 so local install can communicate with the docker db
* Update windows_install.md
fix typo