-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No brotli in zlib #267
Comments
Bun doesn't currently include a brotli implementation, but it really should |
The Node API of The helper function definition here shows the options, but then has a |
Any progress for Brotli support? |
This is the only thing that prevents us from using Bun :/ |
We're in the same boat, this is the last thing lacking on the compatibility list. |
@bmansfie do you work for Bun? Because this should be good news for me, I can't even try to make the binding by myself because event the @axios team didn't say anything that could help me to solve this issue, I'm so disappointed about how both teams has been managing this issue during two years If you don't be a staff member of Bun, should someone tell me what's the requirements to be met? Or if you have a lib chosen to be bound to Bun now, will be great to write these stuffs in an issue, otherwise I should to deal with it manually |
This line determines whether the current environment supports brotli: const isBrotliSupported = utils.isFunction(zlib.createBrotliDecompress); The current (imperfect) workaround is to manually edit this line in file Not a clean solution, but works for me. |
Hey mister @colinhacks @paperdave @Jarred-Sumner @antongolub I was reading that Brotli is implemented, but it's unoptimized, what you know about this? I should end this task |
Is this optimization issue related to #6299? |
You can disable default axios's compressing and set option |
I would rather any other compression algorithm supported in caniuse.com import pickle
import requests
import timeit
import sys
import zlib
import zstandard as zstd
import brotli
url = 'https://your.url/here'
# Assuming 'data' holds the information you want to compress
response = requests.get(url)
data = response.json()
serialized_data = pickle.dumps(data)
# Benchmarking function
def benchmark(function, iterations=10):
r = timeit.repeat(function, repeat=3, number=iterations)
return sum(r) / len(r) # Average time per iteration
# Benchmark serialization and compression for Gzip across different levels
gzip_results = {}
for level in range(1, 10):
compressed_data = zlib.compress(serialized_data, level)
compression_ratio = (sys.getsizeof(compressed_data) / sys.getsizeof(serialized_data)) * 100
compressed_size = sys.getsizeof(compressed_data)
gzip_results[level] = {
'compression_time': benchmark(lambda: zlib.compress(serialized_data, level), iterations=5),
'decompression_time': benchmark(lambda: zlib.decompress(compressed_data), iterations=5),
'compression_ratio': compression_ratio,
'compressed_size': compressed_size
}
# Benchmark serialization and compression for Deflate across different levels
deflate_results = {}
for level in range(1, 10):
compressed_data = zlib.compress(serialized_data, level)
compression_ratio = (sys.getsizeof(compressed_data) / sys.getsizeof(serialized_data)) * 100
compressed_size = sys.getsizeof(compressed_data)
deflate_results[level] = {
'compression_time': benchmark(lambda: zlib.compress(serialized_data, level), iterations=5),
'decompression_time': benchmark(lambda: zlib.decompress(compressed_data), iterations=5),
'compression_ratio': compression_ratio,
'compressed_size': compressed_size
}
# Benchmark serialization and compression for Zstandard across different levels
zstd_results = {}
for level in range(1, 23):
cctx = zstd.ZstdCompressor(level=level)
compressed_data = cctx.compress(serialized_data)
compression_ratio = (sys.getsizeof(compressed_data) / sys.getsizeof(serialized_data)) * 100
compressed_size = sys.getsizeof(compressed_data)
zstd_results[level] = {
'compression_time': benchmark(lambda: cctx.compress(serialized_data), iterations=5),
'decompression_time': benchmark(lambda: zstd.ZstdDecompressor().decompress(compressed_data),
iterations=5),
'compression_ratio': compression_ratio,
'compressed_size': compressed_size
}
# Benchmark serialization and compression for Brotli across different quality levels
brotli_results = {}
for quality in range(1, 12):
compressed_data = brotli.compress(serialized_data, quality=quality)
compression_ratio = (sys.getsizeof(compressed_data) / sys.getsizeof(serialized_data)) * 100
compressed_size = sys.getsizeof(compressed_data)
brotli_results[quality] = {
'compression_time': benchmark(lambda: brotli.compress(serialized_data, quality=quality),
iterations=5),
'decompression_time': benchmark(lambda: brotli.decompress(compressed_data), iterations=5),
'compression_ratio': compression_ratio,
'compressed_size': compressed_size
}
# Print benchmark results for Gzip
print("Gzip Serialization (compression/decompression) results:")
for level, result in gzip_results.items():
print(f"Gzip (Level {level}):")
print(f" Compression Time: {result['compression_time']:.6f} seconds")
print(f" Decompression Time: {result['decompression_time']:.6f} seconds")
print(f" Compression Ratio: {result['compression_ratio']:.2f}%")
print(f" Compressed Size: {result['compressed_size']} bytes\n")
# Print benchmark results for Deflate
print("\nDeflate Serialization (compression/decompression) results:")
for level, result in deflate_results.items():
print(f"Deflate (Level {level}):")
print(f" Compression Time: {result['compression_time']:.6f} seconds")
print(f" Decompression Time: {result['decompression_time']:.6f} seconds")
print(f" Compression Ratio: {result['compression_ratio']:.2f}%")
print(f" Compressed Size: {result['compressed_size']} bytes\n")
# Print benchmark results for Zstandard
print("\nZstandard Serialization (compression/decompression) results:")
for level, result in zstd_results.items():
print(f"Zstandard (Level {level}):")
print(f" Compression Time: {result['compression_time']:.6f} seconds")
print(f" Decompression Time: {result['decompression_time']:.6f} seconds")
print(f" Compression Ratio: {result['compression_ratio']:.2f}%")
print(f" Compressed Size: {result['compressed_size']} bytes\n")
# Print benchmark results for Brotli
print("\nBrotli Serialization (compression/decompression) results:")
for quality, result in brotli_results.items():
print(f"Brotli (Quality {quality}):")
print(f" Compression Time: {result['compression_time']:.6f} seconds")
print(f" Decompression Time: {result['decompression_time']:.6f} seconds")
print(f" Compression Ratio: {result['compression_ratio']:.2f}%")
print(f" Compressed Size: {result['compressed_size']} bytes\n") Gzip Serialization (compression/decompression) results:
Gzip (Level 1):
Compression Time: 0.131746 seconds
Decompression Time: 0.046795 seconds
Compression Ratio: 36.89%
Compressed Size: 1167235 bytes
Gzip (Level 2):
Compression Time: 0.148521 seconds
Decompression Time: 0.044622 seconds
Compression Ratio: 35.26%
Compressed Size: 1115833 bytes
Gzip (Level 3):
Compression Time: 0.192732 seconds
Decompression Time: 0.046630 seconds
Compression Ratio: 33.97%
Compressed Size: 1074807 bytes
Gzip (Level 4):
Compression Time: 0.213282 seconds
Decompression Time: 0.047072 seconds
Compression Ratio: 32.40%
Compressed Size: 1025204 bytes
Gzip (Level 5):
Compression Time: 0.348723 seconds
Decompression Time: 0.046816 seconds
Compression Ratio: 31.36%
Compressed Size: 992237 bytes
Gzip (Level 6):
Compression Time: 0.493173 seconds
Decompression Time: 0.045413 seconds
Compression Ratio: 30.97%
Compressed Size: 980071 bytes
Gzip (Level 7):
Compression Time: 0.541998 seconds
Decompression Time: 0.043903 seconds
Compression Ratio: 30.92%
Compressed Size: 978442 bytes
Gzip (Level 8):
Compression Time: 0.609642 seconds
Decompression Time: 0.044365 seconds
Compression Ratio: 30.90%
Compressed Size: 977862 bytes
Gzip (Level 9):
Compression Time: 0.589004 seconds
Decompression Time: 0.042475 seconds
Compression Ratio: 30.90%
Compressed Size: 977862 bytes
Deflate Serialization (compression/decompression) results:
Deflate (Level 1):
Compression Time: 0.128636 seconds
Decompression Time: 0.046544 seconds
Compression Ratio: 36.89%
Compressed Size: 1167235 bytes
Deflate (Level 2):
Compression Time: 0.148510 seconds
Decompression Time: 0.043960 seconds
Compression Ratio: 35.26%
Compressed Size: 1115833 bytes
Deflate (Level 3):
Compression Time: 0.191041 seconds
Decompression Time: 0.043908 seconds
Compression Ratio: 33.97%
Compressed Size: 1074807 bytes
Deflate (Level 4):
Compression Time: 0.197751 seconds
Decompression Time: 0.044402 seconds
Compression Ratio: 32.40%
Compressed Size: 1025204 bytes
Deflate (Level 5):
Compression Time: 0.309715 seconds
Decompression Time: 0.043225 seconds
Compression Ratio: 31.36%
Compressed Size: 992237 bytes
Deflate (Level 6):
Compression Time: 0.478999 seconds
Decompression Time: 0.041243 seconds
Compression Ratio: 30.97%
Compressed Size: 980071 bytes
Deflate (Level 7):
Compression Time: 0.523563 seconds
Decompression Time: 0.041796 seconds
Compression Ratio: 30.92%
Compressed Size: 978442 bytes
Deflate (Level 8):
Compression Time: 0.591571 seconds
Decompression Time: 0.044189 seconds
Compression Ratio: 30.90%
Compressed Size: 977862 bytes
Deflate (Level 9):
Compression Time: 0.591415 seconds
Decompression Time: 0.043805 seconds
Compression Ratio: 30.90%
Compressed Size: 977862 bytes
Zstandard Serialization (compression/decompression) results:
Zstandard (Level 1):
Compression Time: 0.014630 seconds
Decompression Time: 0.004104 seconds
Compression Ratio: 13.06%
Compressed Size: 413334 bytes
Zstandard (Level 2):
Compression Time: 0.011026 seconds
Decompression Time: 0.002880 seconds
Compression Ratio: 7.55%
Compressed Size: 238832 bytes
Zstandard (Level 3):
Compression Time: 0.010607 seconds
Decompression Time: 0.002330 seconds
Compression Ratio: 5.35%
Compressed Size: 169132 bytes
Zstandard (Level 4):
Compression Time: 0.010927 seconds
Decompression Time: 0.002252 seconds
Compression Ratio: 5.30%
Compressed Size: 167705 bytes
Zstandard (Level 5):
Compression Time: 0.022500 seconds
Decompression Time: 0.002075 seconds
Compression Ratio: 4.75%
Compressed Size: 150148 bytes
Zstandard (Level 6):
Compression Time: 0.030029 seconds
Decompression Time: 0.002032 seconds
Compression Ratio: 4.44%
Compressed Size: 140424 bytes
Zstandard (Level 7):
Compression Time: 0.035606 seconds
Decompression Time: 0.001970 seconds
Compression Ratio: 4.38%
Compressed Size: 138676 bytes
Zstandard (Level 8):
Compression Time: 0.042404 seconds
Decompression Time: 0.001982 seconds
Compression Ratio: 4.30%
Compressed Size: 135926 bytes
Zstandard (Level 9):
Compression Time: 0.041453 seconds
Decompression Time: 0.001819 seconds
Compression Ratio: 3.97%
Compressed Size: 125507 bytes
Zstandard (Level 10):
Compression Time: 0.055232 seconds
Decompression Time: 0.001803 seconds
Compression Ratio: 3.91%
Compressed Size: 123756 bytes
Zstandard (Level 11):
Compression Time: 0.067030 seconds
Decompression Time: 0.001763 seconds
Compression Ratio: 3.88%
Compressed Size: 122782 bytes
Zstandard (Level 12):
Compression Time: 0.074708 seconds
Decompression Time: 0.001779 seconds
Compression Ratio: 3.88%
Compressed Size: 122773 bytes
Zstandard (Level 13):
Compression Time: 0.320558 seconds
Decompression Time: 0.001800 seconds
Compression Ratio: 3.86%
Compressed Size: 122225 bytes
Zstandard (Level 14):
Compression Time: 0.514192 seconds
Decompression Time: 0.001885 seconds
Compression Ratio: 3.82%
Compressed Size: 120726 bytes
Zstandard (Level 15):
Compression Time: 0.776974 seconds
Decompression Time: 0.001669 seconds
Compression Ratio: 3.78%
Compressed Size: 119665 bytes
Zstandard (Level 16):
Compression Time: 0.745292 seconds
Decompression Time: 0.001817 seconds
Compression Ratio: 3.72%
Compressed Size: 117706 bytes
Zstandard (Level 17):
Compression Time: 0.882279 seconds
Decompression Time: 0.001811 seconds
Compression Ratio: 3.68%
Compressed Size: 116327 bytes
Zstandard (Level 18):
Compression Time: 0.785868 seconds
Decompression Time: 0.001999 seconds
Compression Ratio: 3.65%
Compressed Size: 115567 bytes
Zstandard (Level 19):
Compression Time: 1.235092 seconds
Decompression Time: 0.001685 seconds
Compression Ratio: 3.62%
Compressed Size: 114656 bytes
Zstandard (Level 20):
Compression Time: 1.140070 seconds
Decompression Time: 0.001782 seconds
Compression Ratio: 3.62%
Compressed Size: 114656 bytes
Zstandard (Level 21):
Compression Time: 1.689877 seconds
Decompression Time: 0.001728 seconds
Compression Ratio: 3.62%
Compressed Size: 114409 bytes
Zstandard (Level 22):
Compression Time: 2.818275 seconds
Decompression Time: 0.001952 seconds
Compression Ratio: 3.61%
Compressed Size: 114149 bytes
Brotli Serialization (compression/decompression) results:
Brotli (Quality 1):
Compression Time: 0.031643 seconds
Decompression Time: 0.018773 seconds
Compression Ratio: 17.61%
Compressed Size: 557157 bytes
Brotli (Quality 2):
Compression Time: 0.025418 seconds
Decompression Time: 0.007376 seconds
Compression Ratio: 5.78%
Compressed Size: 183002 bytes
Brotli (Quality 3):
Compression Time: 0.028109 seconds
Decompression Time: 0.006453 seconds
Compression Ratio: 5.55%
Compressed Size: 175494 bytes
Brotli (Quality 4):
Compression Time: 0.040346 seconds
Decompression Time: 0.005264 seconds
Compression Ratio: 4.38%
Compressed Size: 138659 bytes
Brotli (Quality 5):
Compression Time: 0.071548 seconds
Decompression Time: 0.006076 seconds
Compression Ratio: 4.03%
Compressed Size: 127586 bytes
Brotli (Quality 6):
Compression Time: 0.080487 seconds
Decompression Time: 0.005724 seconds
Compression Ratio: 3.89%
Compressed Size: 123166 bytes
Brotli (Quality 7):
Compression Time: 0.090228 seconds
Decompression Time: 0.005666 seconds
Compression Ratio: 3.82%
Compressed Size: 120802 bytes
Brotli (Quality 8):
Compression Time: 0.100304 seconds
Decompression Time: 0.005359 seconds
Compression Ratio: 3.77%
Compressed Size: 119300 bytes
Brotli (Quality 9):
Compression Time: 0.158134 seconds
Decompression Time: 0.005358 seconds
Compression Ratio: 3.74%
Compressed Size: 118328 bytes
Brotli (Quality 10):
Compression Time: 1.688359 seconds
Decompression Time: 0.005695 seconds
Compression Ratio: 3.51%
Compressed Size: 111109 bytes
Brotli (Quality 11):
Compression Time: 5.849162 seconds
Decompression Time: 0.006769 seconds
Compression Ratio: 3.74%
Compressed Size: 118307 bytes I'm surprised that Zstandard with level 22 is closer than Brotli with a quality of 11, I did other benchmarks with algorithms in theory I should have 3.xx% of compression ratio but for any reason I can't replicate that results, Bun already support gzip, but with those steps you should implement another algorithm or let Bun with Axios deal with this responsability |
How is bun announcing v1.x.x given that its stated purpose is to be a nodejs drop-in replacement and there's still hundreds of breaking issues like this one? Feels misleading at best |
Actually the only problem here is they have not documented what are the goals to be met before re-enable Brotli |
For anyone here having the issues with axios, here is a quick workaround to make Axios use gzip instead of Brotli:
Then all your axios instances will use gzip. Not ideal, but that's the only way I found to make it work with Bun. |
You are the best!!! Been struggling for a while. |
So for this problem that has existed for almost 2 years, there is no solution? |
You should expect this issue to be fixed in the next 2 months. We are really focused on Windows right now. I have a branch that mostly implements this already, but we cannot prioritize finishing it until Windows + more bugs are fixed. |
got it. thanks |
This wont solve everyones issue here, but iv been able to work around this issue with my app that uses I was experiencing this brotli issue with my app, now It is resolved. Brotli support will be nice, but its not critical for our app (this one is a CLI tool) You can simply specify in your request headers the encodings your request can accept, and leave out This simply tells the responding server you don't accept Brotli encoding and to choose another option (likely gzip) Example Axios headers
Normally, this would be
|
I have both installed. Thanks for the suggestion. |
TIL! |
* 🚀 feat: Support for GPT-4 Turbo/0125 Models (#1643) * 🧹 Clean Up OpenAI Config and Show 'Set Azure Key' for Plugins (#1649) * refactor(gptPlugins): prevent edge case where exact word `azure` could be found in azure api Key detection when not an azure key * refactor(SetKeyDialog): cleanup OpenAI config, show \'set azure key\' when `PLUGINS_USE_AZURE` env var is enabled * 🐞 fix: Bump `@langchain/google-genai` to Address Chinese Text Bug (#1654) * 📋 feat: Log Custom Config File and Add Known Model Limits to Custom Endpoint (#1657) * refactor(custom): add all recognized models to maxTokensMap for custom endpoint * feat(librechat.yaml): log the custom config file on initial load * fix(OpenAIClient): pass endpointType/endpoint to `getModelMaxTokens` call * 👤 fix: Avatar Check in User Auth (#1677) * 🌍 : Update Japanese translation (#1666) * Language translation: japanese * Language translation: japanese * 🔝fix: Re-order System Message to Top for Mistral API Payloads (#1678) * fix: re-order System Message if Mistral AI API as it only allows System Message at start of Payload * fix: re-introduce singular system message change role to `user` if `system` * 🛡️ : Security Enhancements (#1681) * fix: sanitize HTTP params and do not send whole error objects backs * fix: prevent path traversal * fix: send custom error message for tokenizer route * chore: handle info exposure vector * chore(oauth): skip check due to false positive as oauth routes are rate-limited * chore(app): disable `x-powered-by` * chore: disable false positives or flagging of hardcoded secrets when they are fake values * chore: add path traversal safety check * 📝 docs update: remove ChatGPTbrowser and other small fixes (#1686) * 🧼 docs: remove references to ChatGPTbrowser and PandoraNext * docs: clean up .env file Update OpenAI models with the list of automatically fetched models, update Plugin models with the list of models supporting functions, comment out ToC in custom_config.md since it conflicts with mkdock right sidebar ToC * 🖋️ docs: fix formatting in linux_install.md * docs: update example model lists in dotenv.md * docs: update breaking_changesv.md * 🤖 docs: add `copilot-gpt4-service` AI setup info (#1695) Adds information and setup details for [aaamon's copilot-gpt4-service](https://github.com/aaamoon/copilot-gpt4-service) to Unofficial APIs section of the documentation. Utilizes Github's Copilot to access OpenAI api. * 🥷 docs: Ninja - ChatGPT-browser reverse proxy (#1697) * 🥷 docs: Ninja ChatGPT-browser reverse proxy * 🥷 docs: breaking changes * 🌍 : Update German Translations (#1683) Co-authored-by: marlonka <marloc55@yahoo.de> * 🪙 feat: Use OpenRouter Model Data for Token Cost and Context (#1703) * feat: use openrouter data for model token cost/context * chore: add ttl for tokenConfig and refetch models if cache expired * 🚀 feat: Support for GPT-3.5 Turbo/0125 Model (#1704) * 🚀 feat: Support for GPT-3.5 Turbo/0125 Model * ci: fix tx test * 📷 fix: Pass Base64 to Gemini Vision Payload when using CDN URLs (#1705) * 🖌️feat: ScrolltoBottom & Mobile Improvements; Translation Update (#1651) * 🖌️feat: Scrolltobottom Style * 🖌️feat: ScrolltoBottom Style * 📱Settings tab now centered on mobile / selection bug fixed 🐞, 🌍 Updated Translation * 🛠️fix: Adjust the width of the settings dialog and address the issue of not seeing selection on the desktop. * 🎨 Update settings tabs background color for dark mode. Adjusts background color dynamically based on screen size. * 🛠️fix: Reverted changes in ScrolltoBottom file * 🪙 fix(getModelMaxTokens): Retrieve Correct Context Tokens for Azure OpenAI (#1710) * 🖊️ README.md: update button layout (#1709) change size and position of the one click deployment buttons * ♾️ style: Infinite Scroll Nav and Sort Convos by Date/Usage (#1708) * Style: Infinite Scroll and Group convos by date * Style: Infinite Scroll and Group convos by date- Redesign NavBar * Style: Infinite Scroll and Group convos by date- Redesign NavBar - Clean code * Style: Infinite Scroll and Group convos by date- Redesign NavBar - Redesign NewChat Component * Style: Infinite Scroll and Group convos by date- Redesign NavBar - Redesign NewChat Component * Style: Infinite Scroll and Group convos by date- Redesign NavBar - Redesign NewChat Component * Including OpenRouter and Mistral icon * refactor(Conversations): cleanup use of utility functions and typing * refactor(Nav/NewChat): use localStorage `lastConversationSetup` to determine the endpoint to use, as well as icons -> JSX components, remove use of `endpointSelected` * refactor: remove use of `isFirstToday` * refactor(Nav): remove use of `endpointSelected`, consolidate scrolling logic to its own hook `useNavScrolling`, remove use of recoil `conversation` * refactor: Add spinner to bottom of list, throttle fetching, move query hooks to client workspace * chore: sort by `updatedAt` field * refactor: optimize conversation infinite query, use optimistic updates, add conversation helpers for managing pagination, remove unnecessary operations * feat: gen_title route for generating the title for the conversation * style(Convo): change hover bg-color * refactor: memoize groupedConversations and return as array of tuples, correctly update convos pre/post message stream, only call genTitle if conversation is new, make `addConversation` dynamically either add/update depending if convo exists in pages already, reorganize type definitions * style: rename Header NewChat Button -> HeaderNewChat, add NewChatIcon, closely match main Nav New Chat button to ChatGPT * style(NewChat): add hover bg color * style: cleanup comments, match ChatGPT nav styling, redesign search bar, make part of new chat sticky header, move Nav under same parent as outlet/mobilenav, remove legacy code, search only if searchQuery is not empty * feat: add tests for conversation helpers and ensure no duplicate conversations are ever grouped * style: hover bg-color * feat: alt-click on convo item to open conversation in new tab * chore: send error message when `gen_title` fails --------- Co-authored-by: Walber Cardoso <walbercardoso@gmail.com> * 🔧 fix: Patch incorrect Package Installation (#1720) * 🐳 fix: Update `.devcontainer` Files (#1712) * fix: modify the base docker image for devcontainer * fix: restore package-lock.json from main * 📱 style: Settings UI Enhancements for Mobile (#1721) * Fix the interface for the mobile version. * Make uniform margins for buttons. * 🐳 docs: How to Authenticate MongoDB (#1724) * refactor: remove `--noauth` flag from `mongod` command * docs: add mongodb auth instructions * Update manage_your_database.md * chore: add example * Update manage_your_database.md * 🐳 docs: Formatting Fix (#1725) * 🐳 docs: Add deploy to Zeabur button and guide (#1727) * 🐳 docs: Add deploy to Zeabur button in README.md * 🐳 docs: Add deploy to Zeabur guide in docs * 🖋️ docs: Formatting Fix (#1726) * 🍃 docs: Formatting Fix * 🖋️ docs: Formatting Fix * 🖋️ docs: Formatting Fix * 🔒✉️ feat: allow only certain domain (#1562) * feat: allow only certain domain * Update dotenv.md * refactor( registrationController) & handle ALLOWED_REGISTRATION_DOMAINS not specified * cleanup and moved to AuthService for better error handling * refactor: replace environment variable with librechat config item, add typedef for custom config, update docs for new registration object and allowedDomains values * ci(AuthService): test for `isDomainAllowed` --------- Co-authored-by: Danny Avila <messagedaniel@protonmail.com> * 🔄🔐 refactor: auth; style: match OpenAI; feat: custom social login order (#1421) * refactor(Login & Registration) * fix(Registration) test errors * refactor(LoginForm & ResetPassword) * fix(LoginForm): display 'undefined' when loading page; style(SocialButton): match OpenAI's graphics * some refactor and style update for social logins * style: width like OpenAI; feat: custom social login order; refactor: alphabetical socials * fix(Registration & Login) test * Update .env.example * Update .env.example * Update dotenv.md * refactor: remove `SOCIAL_LOGIN_ORDER` for `socialLogins` configured from `librechat.yaml` - initialized by AppService, attached as app.locals property - rename socialLoginOrder and loginOrder to socialLogins app-wide for consistency - update types and docs - initialize config variable as array and not singular string to parse - bump data-provider to 0.3.9 --------- Co-authored-by: Danny Avila <messagedaniel@protonmail.com> * 🔧 fix: socialLogins default value (#1730) * fix: socialLogins default value * ci: add test for `AppService` * 📇 refactor(convoSchema): index `updatedAt` field (#1732) * 📖 docs: fix link pointing to dotenv guide (#1739) * ✏️ update dotenv.md (#1740) update the note about rebuilding LibreChat after configuration changes since the .env file is now mounted into the volume * 🛠️ chore: Refactor Update Script to Utilize Docker Compose v2 (#1752) * 👤 feat: User ID in Model Query; chore: cleanup ModelService (#1753) * feat: send the LibreChat user ID as a query param when fetching the list of models * chore: update bun * chore: change bun command for building data-provider * refactor: prefer use of `getCustomConfig` to access custom config, also move to `server/services/Config` * refactor: make endpoints/custom option for the config optional, add userIdQuery, and use modelQueries log store in ModelService * refactor(ModelService): use env variables at runtime, use default models from data-provider, and add tests * docs: add `userIdQuery` * fix(ci): import changed * 🦙 docs: Ollama Docs Update (#1756) * Update to use docker-compose.overridge.yml Add GPU Acceleration links * Update litellm.md * 🧩 feat: Support Alternate API Keys for Plugins (#1760) * refactor(DALL-E): retrieve env variables at runtime and not from memory * feat(plugins): add alternate env variable handling to allow setting one api key for multiple plugins * docs: update docs * 🐳 feat: Push Container Images to DockerHub (#1762) * ⬤ style: Circular Streaming Cursor (#1736) * Updated Style Cursor like ChatGPT * style(Markdown.tsx): add space before cursor when there is text * fix: revert OpenAIClient.tokens.js change * fix:(Markdown.tsx): revert change of unused file * fix(convos.spec.ts): test fix * chore: remove raw HTML for cursor animations --------- Co-authored-by: Danny Avila <danacordially@gmail.com> Co-authored-by: Danny Avila <messagedaniel@protonmail.com> * 🔌 fix: Minor Plugins Improvements (#1766) * fix(PluginsClient): don't invoke `getFunctionModelName` when using Azure OpenAI * fix: plugins styling fix with new cursor * ci(PluginsClient): test azure exception for getFunctionModelName * 🧪 ci: Fix Conversation Grouping Tests * 🖌️ style: Update conversation history groups (#1770) * style: Add month groups to conversation history * style: Change "Last x days" to "Previous x days" to match ChatGPT * style: Add "Yesterday" to conversation groups to match ChatGPT * fix: use startOfDay for Yesterday conversation group * fix: Output month name instead of number in conversation group name * test: Validate new conversation groups are created properly * fix: Formatting of month category string was wrong * 🎉 happy birthday LibreChat (#1768) * happy birthday LibreChat * Refactor endpoint condition in Landing component * Update birthday message in Eng.tsx * fix(/config): avoid nesting ternaries * refactor(/config): check birthday --------- Co-authored-by: Danny Avila <messagedaniel@protonmail.com> * 🐳 docs: update to compose v2 (#1767) * ✔️ docs: update custom_config.md (#1774) Add link to https://yamlchecker.com/ * 📝 docs: clarifications - override file & balance/token count (#1783) * 📝 docs: override file clarification * 📝 docs: override file clarification * 📝 docs: balance & token count clarification * ✨ Release: v0.6.9 (#1789) * chore: Update Docker build and push actions (#1790) * 🐋 chore: add tag for `latest` for ci/cd docker builds (#1791) * ✨ feat: Assistants API, General File Support, Side Panel, File Explorer (#1696) * feat: assistant name/icon in Landing & Header * feat: assistname in textarea placeholder, and use `Assistant` as default name * feat: display non-image files in user messages * fix: only render files if files.length is > 0 * refactor(config -> file-config): move file related configuration values to separate module, add excel types * chore: spreadsheet file rendering * fix(Landing): dark mode style for Assistant Name * refactor: move progress incrementing to own hook, start smaller, cap near limit \(1\) * refactor(useContentHandler): add empty Text part if last part was completed tool or image * chore: add accordion trigger border styling for dark mode * feat: Assistant Builder model selection * chore: use Spinner when Assistant is mutating * fix(get/assistants): return correct response object `AssistantListResponse` * refactor(Spinner): pass size as prop * refactor: make assistant crud mutations optimistic, add types for options * chore: remove assistants route and view * chore: move assistant builder components to separate directory * feat(ContextButton): delete Assistant via context button/dialog, add localization * refactor: conditionally show use and context menu buttons, add localization for create assistant * feat: save side panel states to localStorage * style(SidePanel): improve avatar menu and assistant select styling for dark mode * refactor: make NavToggle reusable for either side (left or right), add SidePanel Toggle with ability to close it completely * fix: resize handle and navToggle behavior * fix(/avatar/:assistant_id): await `deleteFile` and assign unique name to uploaded image * WIP: file UI components from PR #576 * refactor(OpenAIMinimalIcon): pass className * feat: formatDate helper fn * feat: DataTableColumnHeader * feat: add row selection, formatted row values, number of rows selected * WIP: add files to Side panel temporarily * feat: `LB_QueueAsyncCall`: Leaky Bucket queue for external APIs, use in `processDeleteRequest` * fix(TFile): correct `source` type with `FileSources` * fix(useFileHandling): use `continue` instead of return when iterating multiple files, add file type to extendedFile * chore: add generic setter type * refactor(processDeleteRequest): settle promises to prevent rejections from processing deletions, log errors * feat: `useFileDeletion` to reuse file deletion logic * refactor(useFileDeletion): make `setFiles` an optional param and use object as param * feat: useDeleteFilesFromTable * feat: use real `files` data and add deletion action to data table * fix(Table): make headers sticky * feat: add dynamic filtering for columns; only show to user Host or OpenAI storage type * style(DropdownMenu): replace `slate` with `gray` * style(DataTable): apply dark mode themes and other misc styling * style(Columns): add color to OpenAI Storage option * refactor(FileContainer): make file preview reusable * refactor(Images): make image preview reusable * refactor(FilePreview): make file prop optional for FileIcon and FilePreview, fix relative style * feat(Columns): add file/image previews, set a minimum size to show for file size in bytes * WIP: File Panel with real files and formatted * feat: open files dialog from panel * style: file data table mobile and general column styling fixes * refactor(api/files): return files sorted by the most recently updated * refactor: provide fileMap through context to prevent re-selecting files to map in different areas; remove unused imports commented out in PanelColumns * refactor(ExtendFile): make File type optional, add `attached` to prevent attached files from being deleted on remove, make Message.files a partial TFile type * feat: attach files through file panel * refactor(useFileHandling): move files to the start of cache list when uploaded * refactor(useDeleteFilesMutation): delete files from cache when successfully deleted from server * fix(FileRow): handle possible edge case of duplication due to attaching recently uploaded file * style(SidePanel): make resize grip border transparent, remove unnecessary styling on close sidepanel button * feat: action utilities and tests * refactor(actions): add `ValidationResult` type and change wording for no server URL found * refactor(actions): check for empty server URL * fix(data-provider): revert tsconfig to fix type issue resolution * feat(client): first pass of actions input for assistants * refactor(FunctionSignature): change method to output object instead of string * refactor(models/Assistant): add actions field to schema, use searchParams object for methods, and add `getAssistant` * feat: post actions input first pass - create new Action document - add actions to Assistant DB document - create /action/:assistant_id POST route - pass more props down from PanelSwitcher, derive assistant_id from switcher - move privacy policy to ActionInput - reset data on input change/validation - add `useUpdateAction` - conform FunctionSignature type to FunctionTool - add action, assistant doc, update hook related types * refactor: optimize assistant/actions relationship - past domain in metadata as hostname and not a URL - include domain in tool name - add `getActions` for actions retrieval by user - add `getAssistants` for assistant docs retrieval by user - add `assistant_id` to Action schema - move actions to own module as a subroute to `api/assistants` - add `useGetActionsQuery` and `useGetAssistantDocsQuery` hooks - fix Action type def * feat: show assistant actions in assistant builder * feat: switch to actions on action click, editing action styling * fix: add Assistant state for builder panel to allow immediate selection of newly created assistants as well as retaining the current assistant when switching to a different panel within the builder * refactor(SidePanel/NavToggle): offset less from right when SidePanel is completely collapsed * chore: rename `processActions` -> `processRequiredActions` * chore: rename Assistant API Action to RequiredAction * refactor(actions): avoid nesting actual API params under generic `requestBody` to optimize LLM token usage * fix(handleTools): avoid calling `validTool` if not defined, add optional param to skip the loading of specs, which throws an error in the context of assistants * WIP: working first pass of toolCalls generated from openapi specs * WIP: first pass ToolCall styling * feat: programmatic iv encryption/decryption helpers * fix: correct ActionAuth types/enums, and define type for AuthForm * feat: encryption/decryption helpers for Action AuthMetadata * refactor(getActions): remove sensitive fields from query response * refactor(POST/actions): encrypt and remove sensitive fields from mutation response * fix(ActionService): change ESM import to CJS * feat: frontend auth handling for actions + optimistic update on action update/creation * refactor(actions): use the correct variables and types for setAuth method * refactor: POST /:assistant_id action can now handle updating an existing action, add `saved_auth_fields` to determine when user explicitly saves new auth creds. only send auth metadata if user explicitly saved fields * refactor(createActionTool): catch errors and send back meaningful error message, add flag to `getActions` to determine whether to retrieve sensitive values or not * refactor(ToolService): add `action` property to ToolCall PartMetadata to determine if the tool call was an action, fix parsing function name issue with actionDelimiter * fix(ActionRequest): use URL class to correctly join endpoint parts for `execute` call * feat: delete assistant actions * refactor: conditionally show Available actions * refactor: show `retrieval` and `code_interpreter` as Capabilities, swap `Switch` for `Checkbox` * chore: remove shadow-stroke from messages * WIP: first pass of Assistants Knowledge attachments * refactor: remove AssistantsProvider in favor of FormProvider, fix selectedAssistant re-render bug, map Assistant file_ids to files via fileMap, initialize Knowledge component with mapped files if any exist * fix: prevent deleting files on assistant file upload * chore: remove console.log * refactor(useUploadFileMutation): update files and assistants cache on upload * chore: disable oauth option as not supported yet * feat: cancel assistant runs * refactor: initialize OpenAI client with helper function, resolve all related circular dependencies * fix(DALL-E): initialization * fix(process): openai client initialization * fix: select an existing Assistant when the active one is deleted * chore: allow attaching files for assistant endpoint, send back relevant OpenAI error message when uploading, deconstruct openAI initialization correctly, add `message_file` to formData when a file is attached to the message but not the assistant * fix: add assistant_id on newConvo * fix(initializeClient): import fix * chore: swap setAssistant for setOption in useEffect * fix(DALL-E): add processFileURL to loadTools call * chore: add customConfig to debug logs * feat: delete threads on convo delete * chore: replace Assistants icon * chore: remove console.dir() in `abortRun` * feat(AssistantService): accumulate text values from run in openai.responseText * feat: titling for assistants endpoint * chore: move panel file components to appropriate directory, add file checks for attaching files, change icon for Attach Files * refactor: add localizations to tools, plugins, add condition for adding/remove user plugins so tool selections don't affect this value * chore: disable `import from url` action for now * chore: remove textMimeTypes from default fileConfig for now * fix: catch tool errors and send as outputs with error messages * fix: React warning about button as descendant of button * style: retrieval and cancelled icon * WIP: pass isSubmitting to Parts, use InProgressCall to display cancelled tool calls correctly, show domain/function name * fix(meilisearch): fix `postSaveHook` issue where indexing expects a mongo document, and join all text content parts for meili indexing * ci: fix dall-e tests * ci: fix client tests * fix: button types in actions panel * fix: plugin auth form persisting across tool selections * fix(ci): update AppService spec with `loadAndFormatTools` * fix(clearConvos): add id check earlier on * refactor(AssistantAvatar): set previewURL dynamically when emtadata.avatar changes * feat(assistants): addTitle cache setting * fix(useSSE): resolve rebase conflicts * fix: delete mutation * style(SidePanel): make grip visible on active and hover, invisible otherwise * ci: add data-provider tests to workflow, also update eslint/tsconfig to recognize specs, and add `text/csv` to fileConfig * fix: handle edge case where auth object is undefined, and log errors * refactor(actions): resolve schemas, add tests for resolving refs, import specs from separate file for tests * chore: remove comment * fix(ActionsInput): re-render bug when initializing states with action fields * fix(patch/assistant): filter undefined tools * chore: add logging for errors in assistants routes * fix(updateAssistant): map actions to functions to avoid overwriting * fix(actions): properly handle GET paths * fix(convos): unhandled delete thread exception * refactor(AssistantService): pass both thread_id and conversationId when sending intermediate assistant messages, remove `mapMessagesToSteps` from AssistantService * refactor(useSSE): replace all messages with runMessages and pass latestMessageId to abortRun; fix(checkMessageGaps): include tool calls when syncing messages * refactor(assistants/chat): invoke `createOnTextProgress` after thread creation * chore: add typing * style: sidepanel styling * style: action tool call domain styling * feat(assistants): default models, limit retrieval to certain models, add env variables to to env.example * feat: assistants api key in EndpointService * refactor: set assistant model to conversation on assistant switch * refactor: set assistant model to conversation on assistant select from panel * fix(retrieveAndProcessFile): catch attempt to download file with `assistant` purpose which is not allowed; add logging * feat: retrieval styling, handling, and logging * chore: rename ASSISTANTS_REVERSE_PROXY to ASSISTANTS_BASE_URL * feat: FileContext for file metadata * feat: context file mgmt and filtering * style(Select): hover/rounded changes * refactor: explicit conversation switch, endpoint dependent, through `useSelectAssistant`, which does not create new chat if current endpoint is assistant endpoint * fix(AssistantAvatar): make empty previewURL if no avatar present * refactor: side panel mobile styling * style: merge tool and action section, optimize mobile styling for action/tool buttons * fix: localStorage issues * fix(useSelectAssistant): invoke react query hook directly in select hook as Map was not being updated in time * style: light mode fixes * fix: prevent sidepanel nav styling from shifting layout up * refactor: change default layout (collapsed by default) * style: mobile optimization of DataTable * style: datatable * feat: client-side hide right-side panel * chore(useNewConvo): add partial typing for preset * fix(useSelectAssistant): pass correct model name by using template as preset * WIP: assistant presets * refactor(ToolService): add native solution for `TavilySearchResults` and log tool output errors * refactor: organize imports and use native TavilySearchResults * fix(TavilySearchResults): stringify result * fix(ToolCall): show tool call outputs when not an action * chore: rename Prompt Prefix to custom instructions (in user facing text only) * refactor(EditPresetDialog): Optimize setting title by debouncing, reset preset on dialog close to avoid state mixture * feat: add `presetOverride` to overwrite active conversation settings when saving a Preset (relevant for client side updates only) * feat: Assistant preset settings (client-side) * fix(Switcher): only set assistant_id and model if current endpoint is Assistants * feat: use `useDebouncedInput` for updating conversation settings, starting with EditPresetDialog title setting and Assistant instructions setting * feat(Assistants): add instructions field to settings * feat(chat/assistants): pass conversation settings to run body * wip: begin localization and only allow actions if the assistant is created * refactor(AssistantsPanel): knowledge localization, allow tools on creation * feat: experimental: allow 'priming' values before assistant is created, that would normally require an assistant_id to be defined * chore: trim console logs and make more meaningful * chore: toast messages * fix(ci): date test * feat: create file when uploading Assistant Avatar * feat: file upload rate limiting from custom config with dynamic file route initialization * refactor: use file upload limiters on post routes only * refactor(fileConfig): add endpoints field for endpoint specific fileconfigs, add mergeConfig function, add tests * refactor: fileConfig route, dynamic multer instances used on all '/' and '/images' POST routes, data service and query hook * feat: supportedMimeTypesSchema, test for array of regex * feat: configurable file config limits * chore: clarify assistants file knowledge prereq. * chore(useTextarea): default to localized 'Assistant' if assistant name is empty * feat: configurable file limits and toggle file upload per endpoint * fix(useUploadFileMutation): prevent updating assistant.files cache if file upload is a message_file attachment * fix(AssistantSelect): set last selected assistant only when timeout successfully runs * refactor(queries): disable assistant queries if assistants endpoint is not enabled * chore(Switcher): add localization * chore: pluralize `assistant` for `EModelEndpoint key and value * feat: show/hide assistant UI components based on endpoint availability; librechat.yaml config for disabling builder section and setting polling/timeout intervals * fix(compactEndpointSchemas): use EModelEndpoint for schema access * feat(runAssistant): use configured values from `librechat.yaml` for `pollIntervalMs` and `timeout` * fix: naming issue * wip: revert landing * 🎉 happy birthday LibreChat (#1768) * happy birthday LibreChat * Refactor endpoint condition in Landing component * Update birthday message in Eng.tsx * fix(/config): avoid nesting ternaries * refactor(/config): check birthday --------- Co-authored-by: Danny Avila <messagedaniel@protonmail.com> * fix: landing * fix: landing * fix(useMessageHelpers): hardcoded check to use EModelEndpoint instead * fix(ci): convo test revert to main * fix(assistants/chat): fix issue where assistant_id was being saved as model for convo * chore: added logging, promises racing to prevent longer timeouts, explicit setting of maxRetries and timeouts, robust catching of invalid abortRun params * refactor: use recoil state for `showStopButton` and only show for assistants endpoint after syncing conversation data * refactor: optimize abortRun strategy using localStorage, refactor `abortConversation` to use async/await and await the result, refactor how the abortKey cache is set for runs * fix(checkMessageGaps): assign `assistant_id` to synced messages if defined; prevents UI from showing blank assistant for cancelled messages * refactor: re-order sequence of chat route, only allow aborting messages after run is created, cancel abortRun if there was a cancelling error (likely due already cancelled in chat route), and add extra logging * chore(typedefs): add httpAgent type to OpenAIClient * refactor: use custom implementation of retrieving run with axios to allow for timing out run query * fix(waitForRun): handle timed out run retrieval query * refactor: update preset conditions: - presets will retain settings when a different endpoint is selected; for existing convos, either when modular or is assistant switch - no longer use `navigateToConvo` on preset select * fix: temporary calculator hack as expects string input when invoked * fix: cancel abortRun only when cancelling error is a result of the run already being cancelled * chore: remove use of `fileMaxSizeMB` and total counterpart (redundant) * docs: custom config documentation update * docs: assistants api setup and dotenv, new custom config fields * refactor(Switcher): make Assistant switcher sticky in SidePanel * chore(useSSE): remove console log of data and message index * refactor(AssistantPanel): button styling and add secondary select button to bottom of panel * refactor(OpenAIClient): allow passing conversationId to RunManager through titleConvo and initializeLLM to properly record title context tokens used in cases where conversationId was not defined by the client * feat(assistants): token tracking for assistant runs * chore(spendTokens): improve logging * feat: support/exclude specific assistant Ids * chore: add update `librechat.example.yaml`, optimize `AppService` handling, new tests for `AppService`, optimize missing/outdate config logging * chore: mount docker logs to root of project * chore: condense axios errors * chore: bump vite * chore: vite hot reload fix using latest version * chore(getOpenAIModels): sort instruct models to the end of models list * fix(assistants): user provided key * fix(assistants): user provided key, invalidate more queries on revoke --------- Co-authored-by: Marco Beretta <81851188+Berry-13@users.noreply.github.com> * 🔧 fix(data-provider): add openapi-types dependency (#1797) * fix(data-provider): add openapi-types dependency * chore: Bump version to 0.4.1 in package.json * 🤖 docs(assistants): Additional Setup & Tool Selection Info (#1798) * 📝 docs: Enhance LibreChat Docker deployment guide (#1796) - Revise the description for clarity and conciseness. - Provide a direct comparison between the advanced Docker Compose deployment and the simpler `docker-compose.override.yml` setup. - Update screenshot link for visual reference. * ✏️ fix(Convo): Rename Title UX (#1793) * 🤖 chore: Improve Assistants Run Logging (#1801) * 👥 fix: Reinstate Default Social Login Values (#1811) * fix: social logins accidentally removed default in AppService, reinstated and added test * chore: move birthday to OTHER section and make disabled by default * 📝 docs: Update docker-compose.override.yml.example * fix: necessary font changes (#1818) * fix: necessary font changes * chore: minor bump * 🐋 chore: Add Docker Compose Build Latest Main Image workflow (#1819) * Update main-image-workflow.yml * Update main-image-workflow.yml * Update main-image-workflow.yml * Update main-image-workflow.yml * 🔀 fix: Endpoint Type Mismatch when Switching Conversations (#1834) * refactor(useUpdateUserKeysMutation): only invalidate the endpoint whose key is being updated by user * fix(assistants): await `getUserKeyExpiry` call * chore: fix spinner loading color * refactor(initializeClient): make known which endpoint api Key is missing * fix: prevent an `endpointType` mismatch by making it impossible to assign when the `endpointsConfig` doesn't have a `type` defined, also prefer `getQueryData` call to useQuery in useChatHelpers * 📝 docs: add env changes to breaking_changes.md and minor fixes (#1812) * 📝 docs: add env changes to breacking_changes.md * 📝 docs: replace example in docker_override.md * 📝 docs: fix images in zeabur.md * 🔗 chore: Add Stable Discord and Homepage Links (#1835) * 📝 chore: Update README.md * 📤 refactor: Utilize `intermediateReply` when `message.content` is Empty * 🛡️ feat: Model Validation Middleware (#1841) * refactor: add ViolationTypes enum and add new violation for illegal model requests * feat: validateModel middleware to protect the backend against illicit requests for unlisted models * ⬤ style: Uniform Display of Result-Streaming Cursor (#1842) * 📋 feat: Accumulate Text Parts to Clipboard for Assistant Outputs (#1847) * 🛠️ refactor: Model Loading and Custom Endpoint Error Handling (#1849) * fix: handle non-assistant role ChatCompletionMessage error * refactor(ModelController): decouple res.send from loading/caching models * fix(custom/initializeClient): only fetch custom endpoint models if models.fetch is true * refactor(validateModel): load models if modelsConfig is not yet cached * docs: update on file upload rate limiting * 🐛 fix: Preserve Default Model in Message Requests (#1857) * fix: do not remove default model from message request * chore: bump data-provider * 🐋 Feat: docker pre-built image by default (#1860) * 🐋 Feat: docker pre-built image by default * 🐋 Feat: docker LibreChat ports from .env * 🎨 feat: Create Avatars of Initials Locally (#1869) * ✏️docs: add tavily to env.example and dotenv.md (#1866) * update .env.example add "TAVILY_API_KEY=" to .env.example * update dotenv.md add Tavily to dotenv.md * 🗨️ fix: Prevent Resetting Title to 'New Chat' on Follow-Up Message (#1870) * fix: prevent reseting title to 'New Chat' on follow up message * chore(useSSE): remove empty line * 🐋 docs: update breaking_changes.md (#1864) add note about the use of the pre-built image in docker-compose.yml * 🔀 fix: Correct Expected Behavior for Modular Chat Feature (#1871) * 📒 docs: Add newline for list to be correctly rendered in UI (#1873) Currently in the documentation page the bullet list is not rendered correctly. (See first paragraph on this docs page: https://docs.librechat.ai/install/configuration/litellm.html) * 🔧 feat: optional librechat.yaml path via environment variable (#1858) Co-authored-by: afel <andreas.feldl@netlight.com> * 🅰️ feat: Azure Config to Allow Different Deployments per Model (#1863) * wip: first pass for azure endpoint schema * refactor: azure config to return groupMap and modelConfigMap * wip: naming and schema changes * refactor(errorsToString): move to data-provider * feat: rename to azureGroups, add additional tests, tests all expected outcomes, return errors * feat(AppService): load Azure groups * refactor(azure): use imported types, write `mapModelToAzureConfig` * refactor: move `extractEnvVariable` to data-provider * refactor(validateAzureGroups): throw on duplicate groups or models; feat(mapModelToAzureConfig): throw if env vars not present, add tests * refactor(AppService): ensure each model is properly configured on startup * refactor: deprecate azureOpenAI environment variables in favor of librechat.yaml config * feat: use helper functions to handle and order enabled/default endpoints; initialize azureOpenAI from config file * refactor: redefine types as well as load azureOpenAI models from config file * chore(ci): fix test description naming * feat(azureOpenAI): use validated model grouping for request authentication * chore: bump data-provider following rebase * chore: bump config file version noting significant changes * feat: add title options and switch azure configs for titling and vision requests * feat: enable azure plugins from config file * fix(ci): pass tests * chore(.env.example): mark `PLUGINS_USE_AZURE` as deprecated * fix(fetchModels): early return if apiKey not passed * chore: fix azure config typing * refactor(mapModelToAzureConfig): return baseURL and headers as well as azureOptions * feat(createLLM): use `azureOpenAIBasePath` * feat(parsers): resolveHeaders * refactor(extractBaseURL): handle invalid input * feat(OpenAIClient): handle headers and baseURL for azureConfig * fix(ci): pass `OpenAIClient` tests * chore: extract env var for azureOpenAI group config, baseURL * docs: azureOpenAI config setup docs * feat: safe check of potential conflicting env vars that map to unique placeholders * fix: reset apiKey when model switches from originally requested model (vision or title) * chore: linting * docs: CONFIG_PATH notes in custom_config.md * 🖌️ style: auth dark theme (#1862) * Remove minLength validation and update login link style * Add theme selector component and update login form styles * Update styling in Login and LoginForm components * Update ResetPassword component styles and text color * Refactor login component and add theme selector * Add ThemeSelector component to Registration, RequestPasswordReset, and ResetPassword pages * chore(Login.tsx): remove unused `useCallback` * chore(Login.tsx) import order * Update ResetPassword.tsx import order * Update RequestPasswordReset.tsx import order * Update Registration.tsx import order --------- Co-authored-by: Danny Avila <messagedaniel@protonmail.com> * 🔥chore: bump firebase dependency (#1900) * 🌍 : Update Portuguese Translations (#1867) * 🌍 : Update Portuguese Translations * 🌍 : Fix Portuguese Translations * fix(Br): lint errors --------- Co-authored-by: Berry-13 <81851188+Berry-13@users.noreply.github.com> * 🅰️ feat: Azure AI Studio, Models as a Service Support (#1902) * feat(data-provider): add Azure serverless inference handling through librechat.yaml * feat(azureOpenAI): serverless inference handling in api * docs: update docs with new azureOpenAI endpoint config fields and serverless inference endpoint setup * chore: remove unnecessary checks for apiKey as schema would not allow apiKey to be undefined * ci(azureOpenAI): update tests for serverless configurations * 🛠️ chore: Abort AI Requests on Close & Remove Verbose Logs for Plugins (#1914) * chore: remove verbose logging of ChatOpenAI * feat: abort AI requests on request close * 🤖 docs: Add Groq and other Compatible AI Endpoints (#1915) * chore: bump bun dependencies * feat: make `groq` a known endpoint * docs: compatible ai endpoints * Update ai_endpoints.md * Update ai_endpoints.md * 🍞 fix: Minor fixes and improved Bun support (#1916) * fix(bun): fix bun compatibility to allow gzip header: https://github.com/oven-sh/bun/issues/267#issuecomment-1854460357 * chore: update custom config examples * fix(OpenAIClient.chatCompletion): remove redundant call of stream.controller.abort() as `break` aborts the request and prevents abort errors when not called redundantly * chore: bump bun.lockb * fix: remove result-thinking class when message is no longer streaming * fix(bun): improve Bun support by forcing use of old method in bun env, also update old methods with new customizable params * fix(ci): pass tests * 🔗 feat: NavLinks customization for Help & Faq URL (#1872) * help and faq * fix: using only one var * revert(types.ts): showHelpAndFaq * Update dotenv.md * Update dotenv.md * 🤖feat: add multiple known endpoints (#1917) * feat: add known endpoints * docs: add known endpoints * update ai_endpoints.md remove the groq icon from the example * Update ai_endpoints.md --------- Co-authored-by: Danny Avila <messagedaniel@protonmail.com> * 🔗 feat: User Provided Base URL for OpenAI endpoints (#1919) * chore: bump browserslist-db@latest * refactor(EndpointService): simplify with `generateConfig`, utilize optional baseURL for OpenAI-based endpoints, use `isUserProvided` helper fn wherever needed * refactor(custom/initializeClient): use standardized naming for common variables * feat: user provided baseURL for openAI-based endpoints * refactor(custom/initializeClient): re-order operations * fix: knownendpoints enum definition and add FetchTokenConfig, bump data-provider * refactor(custom): use tokenKey dependent on userProvided conditions for caching and fetching endpointTokenConfig, anticipate token rates from custom config * refactor(custom): assure endpointTokenConfig is only accessed from cache if qualifies for fetching * fix(ci): update tests for initializeClient based on userProvideURL changes * fix(EndpointService): correct baseURL env var for assistants: `ASSISTANTS_BASE_URL` * fix: unnecessary run cancellation on res.close() when response.run is completed * feat(assistants): user provided URL option * ci: update tests and add test for `assistants` endpoint * chore: leaner condition for request closing * chore: more descriptive error message to provide keys again * 🌍 feat: Extend regex to support international usernames (#1918) * 🌍 Extend regex to support international usernames * update validators.spec.js * 🛠️ fix: RunManager, AssistantService and useContentHandler Issues (#1920) * fix(useContentHandler): retain undefined parts and handle them within `ContentParts` rendering * fix(AssistantService/in_progress): skip empty messages * refactor(RunManager): create highly specific `seenSteps` Set keys for RunSteps with use of `getDetailsSignature` and `getToolCallSignature`,to ensure changes from polling are always captured * 🐳 experimental: Dev Image Workflow & Remove Unused Code (#1928) * chore: remove unused code in progressCallback, as well as handle reply.trim(), post `getCompletion` * chore(Dockerfile): remove curl installation * experimental: dev image parallelized with matrix strategy and building for amd64/arm64 support * make platforms explicit * 🐳 chore(Dockerfile): replace `npm ci` with `npm install` for OS specific builds * 🐳chore(Dockerfile): add additional steps to prevent arm64 build failure * 🔎docs: update meilisearch instruction (#1930) * 🔎docs: update meilisearch in mac_install.md Update the Meilisearch .env variables in `mac_install.md` * 🔎🐧 * 📝 feat: Improved Textarea Functionality (#1942) * feat: paste plain text from apps with rich paste data, improved edit message textarea, improved height resizing for long text * feat(EditMessage): autofocus * chore: retain user text color when entering edit mode * 👤 feat: Show Default Icon if No Avatar or Username provided (#1943) * 🖥️ feat: Match STDOUT Logs with Debug File Logs (#1944) * chore: improve token balance logging post-request * feat: match stdout logging with file debug logging when using DEBUG_CONSOLE * 📚 docs: Separate LiteLLM and Ollama Documentation (#1948) * Separate LiteLLM and Ollama Documentation * Clarify Ollama Setup * Fix litellm config * 🔧 fix(useTextarea): duplicate text when pasting on chromium (#1951) * 🔧 fix(EditMessage): duplicate text when pasting (#1970) * fix(EditMessage): duplicate text when pasting on chromium * add back paste data handling, prevent default behavior --------- Co-authored-by: Danny Avila <messagedaniel@protonmail.com> * 🪙 fix(config): use new field for balance * 🧩 fix(Plugins): Keep User `agentModel` and Model Validation (#1972) * fix: do not override model * temp fix for secondary model validation * 🦙 doc: add Ollama to index and update icon (#1967) * 🌍 : Add Hebrew Translation (#1953) * feat: add hebrew * fix: review issues * fix language options * 🥷🪦 docs: remove ninja and chatgptBrowser (#1973) * 🧪 fix(ci): update failing `initializeClient` tests with new expected values (#1982) * fix(ci): update failing tests with new expected values from `getUserKey` * refactor: safer optional chaining, and ensure apiKey is defined * 🔎 update meilisearch to v1.6 / 0.37.0 (#1981) * 🔎 update meilisearch to v1.6 / 0.37.0 * 🔎 update meilisearch to v1.6 / 0.37.0 * 🛠️ refactor(loadConfigModels): make apiKey and baseURL pairings more versatile (#1985) * 🤖 feat(Anthropic): Claude 3 & Vision Support (#1984) * chore: bump anthropic SDK * chore: update anthropic config settings (fileSupport, default models) * feat: anthropic multi modal formatting * refactor: update vision models and use endpoint specific max long side resizing * feat(anthropic): multimodal messages, retry logic, and messages payload * chore: add more safety to trimming content due to whitespace error for assistant messages * feat(anthropic): token accounting and resending multiple images in progress * chore: bump data-provider * feat(anthropic): resendImages feature * chore: optimize Edit/Ask controllers, switch model back to req model * fix: false positive of invalid model * refactor(validateVisionModel): use object as arg, pass in additional/available models * refactor(validateModel): use helper function, `getModelsConfig` * feat: add modelsConfig to endpointOption so it gets passed to all clients, use for properly validating vision models * refactor: initialize default vision model and make sure it's available before assigning it * refactor(useSSE): avoid resetting model if user selected a new model between request and response * feat: show rate in transaction logging * fix: return tokenCountMap regardless of payload shape * 🖋️ fix(OpenAIClient): remove typo * 🔎 feat: Traversaal Search Tool (#1991) * wip: Traversaal Search Tool * fix(traversaal): properly handle tool error, show error to LLM, log * feat(traversaal): finish implementation of structured tool * chore: change traversaal order * 🔎 fix(Traversaal): Recognize `authField` during Tool Initialization * 🖌️ style: Update Light/Dark UI Themes (#1754) * BIG UI UPDATE * fix: search bar, dialog template, new chat icon, convo icon and delete/rename button * moved some color config and a lot of files * small text fixes and tailwind config refactor * Update localization and UI styles * Update styles and add user-select:none to Tooltip component * Update mobile.css styles for navigation mask and background color * Update component imports and styles * Update DeleteButton imports and references * Update UI components * Update tooltip delay duration * Fix styling and update text in various components * fixed assistant style * minor style fixes * revert: removed CreationHeader & CreationPanel * style: match new styling for SidePanel * style: match bg-gray-800 to ChatGPT (#212121) * style: remove slate for gray where applicable to match new light theme --------- Co-authored-by: Danny Avila <messagedaniel@protonmail.com> * 📝 docs update: Anthropic models + Traversaal (#1995) * 📝 docs update: Anthropic models + Traversaal * 📝 docs update: Anthropic models * 🖌️ style: update dialog position (#1999) * style(ChatForm): update styling and fixed style bug * style:(Dialog): reduced max height style(Settings): fixed dialog position height * style(Settings): fixed large screen position * 🔧 style: Improve UI and UX with Style Fixes and Code Refactors (#2002) * refactor(useSSE): add useCallback to all event handlers * chore: remove modelName in defaultAssistantFormValues * fix(SidePanel): fix layout shift on chrome my removing sidenav scrollbar * style(ChatForm): match ChatGPT textarea effect styling * style: fix flickering of old background color on refresh * 📝 docs: additions to deployment guide (#2001) * docs: add intro to deployment guide * doc: update intro * doc: Add NGINX deployment guide and update reverse proxy link * doc:: add reverse proxy pages and weight for the pages * doc: Update NGINX configuration file * doc: imporve new doc * Doc: fix file names * doc: fix references names + improve the introduction with chatgpt :-) * doc: update introduction guide headings * 💾 chore: Update .env.example (#2004) * Update .env.example Make assistants show in the UI by default * Update dotenv.md * 🌊 docs: refactor DigitalOcean guide (#2006) * 🔍 feat: Add Google Search Tool for Assistants (#1994) * 👥 fix(assistants): Improve Error handling (#2012) * feat: make assistants endpoint appendable since message state is not managed by LibreChat * fix(ask): search currentMessages for thread_id if it's not defined * refactor(abortMiddleware): remove use of `overrideProps` and spread unknown fields instead * chore: remove console.log in `abortConversation` * refactor(assistants): improve error handling/cancellation flow * 🖼️ fix: Clipboard Files & File Name Issues (#2015) * fix: ensure image handling fetchs image to base64 for multiple images * fix: append file_id's when writing uploaded files * feat: timestamp files uploaded from clipboard * chore: add a different fileid+name separator * 🖊️chore: fix deployment guides (#2021) * 🔖 chore: update groq models (#2031) * 🔧 fix(ThemeContext): Listen for Theme Changes (#2037) * fix(ThemeContext): listen for changes * fix(Dropdown): theme auto-update not working * ✏️ docs: Railway, Traefik, and Improvements (#2060) * docs: documentation guidelines * docs: deploy documentation update * 📧 update email templates (#2057) * 📧 chore: update email templates * 📧 update password reset confirmation * ✍️ refactor(Textarea): Optimize Text Input & Enhance UX (#2058) * refactor(useDebouncedInput): make object as input arg and accept setter * refactor(ChatForm/Textarea): consolidate textarea/form logic to one component, use react-hook-form, programmatically click send button instead of passing submitMessage, forwardRef and memoize SendButton * refactor(Textarea): use Controller field value to avoid manual update of ref * chore: remove forms provider * chore: memoize AttachFile * refactor(ChatForm/SendButton): only re-render SendButton when there is text input * chore: make iconURL bigger * chore: optimize Root/Nav * refactor(SendButton): memoize disabled prop based on text * chore: memoize Nav and ChatForm * chore: remove textarea ref text on submission * feat(EditMessage): Make Esc exit the edit mode and dismiss changes when editing a message * style(MenuItem): Display the ☑️ icon only on the selected model * 🔧 style(SidePanel): Center buttons when collapsed (#2045) * feat: Improve Google search plugin to assistants * 🔧 fix(Nav SidePanel): Center buttons when collapsed * 🖌️ style: Minor UI Updates (#2011) * UI Design update * Add an error icon next to the avatar. * fix * Change the style of buttons * fix: avatar * 🌐 feat: librechat.yaml from URL (#2064) * feat: librechat.yaml from URL * doc update: librechat.yaml from URL * update dotenv.md - typo * Update loadCustomConfig.js * ci: specs for loadCustomConfig * fix(processFileURL): safe destructuring of saveURL result --------- Co-authored-by: fuegovic <fueg@live.ca> Co-authored-by: Fuegovic <32828263+fuegovic@users.noreply.github.com> * 🌑 style(AnthropicIcon): adjust for Dark Mode * 🧊 style: Adjust Endpoint Icons (#2070) * 🧊 style: Adjust Endpoint Icons * Update MessageParts.tsx * 🧹 chore: remove unused import (#2072) * chore: Update AnthropicIcon.tsx * 🔧 fix: Convo Corners & Updated Colors (#2046) * 🔧 fix: Convo Corners & Updated Colors * refactored code * chore: JSON.parse with a try/catch block, removed useless useEffect & and restored Focus * restored typescript * import all back * ⛔ style: Auth Error and Preset Items Styling (#2069) * Change the style of the error message. * ui preset items * fix style * Change the color of the border and adjust the background of the selected input * 🌍 : Update Russian Translation (#2061) * feat(chore): add missing translations in Ru.tsx * feat(chore): add missing translation for My Files menu and headers * change com_ui_my_files to com_ui_nav_files * move useLocalize above utils * feat(chore): add missing translation for My Files menu and headers * 📜 feat: Customize Privacy Policy & Terms of Service (#2091) * 🅰️ feat: Azure OpenAI Assistants API Support (#1992) * chore: rename dir from `assistant` to plural * feat: `assistants` field for azure config, spread options in AppService * refactor: rename constructAzureURL param for azure as `azureOptions` * chore: bump openai and bun * chore(loadDefaultModels): change naming of assistant -> assistants * feat: load azure settings with currect baseURL for assistants' initializeClient * refactor: add `assistants` flags to groups and model configs, add mapGroupToAzureConfig * feat(loadConfigEndpoints): initialize assistants endpoint if azure flag `assistants` is enabled * feat(AppService): determine assistant models on startup, throw Error if none * refactor(useDeleteAssistantMutation): send model along with assistant id for delete mutations * feat: support listing and deleting assistants with azure * feat: add model query to assistant avatar upload * feat: add azure support for retrieveRun method * refactor: update OpenAIClient initialization * chore: update README * fix(ci): tests passing * refactor(uploadOpenAIFile): improve logging and use more efficient REST API method * refactor(useFileHandling): add model to metadata to target Azure region compatible with current model * chore(files): add azure naming pattern for valid file id recognition * fix(assistants): initialize openai with first available assistant model if none provided * refactor(uploadOpenAIFile): add content type for azure, initialize formdata before azure options * refactor(sleep): move sleep function out of Runs and into `~/server/utils` * fix(azureOpenAI/assistants): make sure to only overwrite models with assistant models if `assistants` flag is enabled * refactor(uploadOpenAIFile): revert to old method * chore(uploadOpenAIFile): use enum for file purpose * docs: azureOpenAI update guide with more info, examples * feat: enable/disable assistant capabilities and specify retrieval models * refactor: optional chain conditional statement in loadConfigModels.js * docs: add assistants examples * chore: update librechat.example.yaml * docs(azure): update note of file upload behavior in Azure OpenAI Assistants * chore: update docs and add descriptive message about assistant errors * fix: prevent message submission with invalid assistant or if files loading * style: update Landing icon & text when assistant is not selected * chore: bump librechat-data-provider to 0.4.8 * fix(assistants/azure): assign req.body.model for proper azure init to abort runs * 🤖 fix(assistants): Default Capabilities and Retrieval Models (#2102) * 📑 docs: update .env.example (#2109) * 🌍 : Update Chinese Translations (#2098) * 🪙 feat: Assistants Token Balance & other improvements (#2114) * chore: add assistants to supportsBalanceCheck * feat(Transaction): getTransactions and refactor export of model * refactor: use enum: ViolationTypes.TOKEN_BALANCE * feat(assistants): check balance * refactor(assistants): only add promptBuffer if new convo (for title), and remove endpoint definition * refactor(assistants): Count tokens up to the current context window * fix(Switcher): make Select list explicitly controlled * feat(assistants): use assistant's default model when no model is specified instead of the last selected assistant, prevent assistant_id from being recorded in non-assistant endpoints * chore(assistants/chat): import order * chore: bump librechat-data-provider due to changes * 🎨 style: Privacy Policy & Terms of Service (#2111) * 🖊️ fix(MessageContent): Error Message typo (#2112) * 🔧 feat: Share Assistant Actions between Users (#2116) * fix: remove unique field from assistant_id, which can be shared between different users * refactor: remove unique user fields from actions/assistant queries * feat: only allow user who saved action to delete it * refactor: allow deletions for anyone with builder access * refactor: update user.id when updating assistants/actions records, instead of searching with it * fix: stringify response data in case it's an object * fix: correctly handle path input * fix(decryptV2): handle edge case where value is already decrypted * 🔧 fix: Remove `Unique` Index from Actions Model and Initialize Empty Actions for Deletion (#2118) * 🔧 feat(actions): Allow Multiple Actions from Same Domain per Assistant (#2120) * 🪰 fix: Azure Parsing and Assistants Payload (#2133) * fix(azure): fix regex to prevent edge cases * fix(assistants): pass relevant endpoint options to avoid sending them to API * 🔍 feat: Filter MultiSelect and SelectDropDown (+variants) + CSS fixes for Scrollbar (#2138) * Initial implementation of MultiSearch. Added implementation to MultiSelect and SelectDropDown and variants * Update scrollbar styles to prevent breakages on Chrome * Revert changes to vite.config.ts (redundant for now) * chore(New Chat): organize imports * style(scrollbar-transparent): use webkit as standard, expected behavior * chore: useCallback for mouse enter/leave * fix(Footer): resolve map key error * chore: memoize Conversations * style(MultiSearch): improve multisearch styling * style: dark mode search input * fix: react warnings due to unrecognize html props * chore: debounce OpenAI settings inputs * fix(useDebouncedInput): only use event value as newValue if not object --------- Co-authored-by: Flynn <gpg@flyn.ca> * 📋 chore: add requirements.txt to documentation (#2122) * chore: add requirements.txt to documentation, to ease maintenance * docs: Update documentation_guidelines.md * 🔧 style(fix): Convo Title Fade Effect (#2117) * feat: Improve Google search plugin to assistants * 🔧 fix(Nav SidePanel): Center buttons when collapsed * 🔧(fix) Convo title fade effect * 🔧(fix) Convo title fade effect / remove deletion * 🔧(fix) Convo title fade effect / remove deletion .env.example * 🔧(fix) Convo title fade effect --------- Co-authored-by: Danny Avila <messagedaniel@protonmail.com> * Revert "🔧 style(fix): Convo Title Fade Effect (#2117)" (#2139) This reverts commit 1796821888ff09fbe0e9912408cb1387822ee866. * 🎨 style: HoverButton UI adjustment, change code font (#2017) * style: HoverButton UI adjustment * style: make Consolas as default code font --------- Co-authored-by: Danny Avila <messagedaniel@protonmail.com> * 🗃️ feat: General File Support for OpenAI, Azure, Custom, Anthropic and Google (RAG) (#2143) * refactor: re-purpose `resendImages` as `resendFiles` * refactor: re-purpose `resendImages` as `resendFiles` * feat: upload general files * feat: embed file during upload * feat: delete file embeddings on file deletion * chore(fileConfig): add epub+zip type * feat(encodeAndFormat): handle non-image files * feat(createContextHandlers): build context prompt from file attachments and successful RAG * fix: prevent non-temp files as well as embedded files to be deleted on new conversation * fix: remove temp_file_id on usage, prevent non-temp files as well as embedded files to be deleted on new conversation * fix: prevent non-temp files as well as embedded files to be deleted on new conversation * feat(OpenAI/Anthropic/Google): basic RAG support * fix: delete `resendFiles` only when true (Default) * refactor(RAG): update endpoints and pass JWT * fix(resendFiles): default values * fix(context/processFile): query unique ids only * feat: rag-api.yaml * feat: file upload improved ux for longer uploads * chore: await embed call and catch embedding errors * refactor: store augmentedPrompt in Client * refactor(processFileUpload): throw error if not assistant file upload * fix(useFileHandling): handle markdown empty mimetype issue * chore: necessary compose file changes * 📧 fix: Correct Handling of Self-Signed Certificates in `sendEmail` (#2148) - note: To put it in a different way, if you put rejectUnauthorized: true, it means that self-signed certificates should not be allowed. This means, that EMAIL_ALLOW_SELFSIGNED is set to false * ➰ fix(sendEmail): circular dependency * 🔬 chore: Add Circular Dependency Check to `backend-review` (#2149) * 🔬 chore: Add Circular Dependency check to `backend-review` * chore: touch random file for workflow trigger * chore: workflow step order * chore: update workflow to create empty auth.json file * fix: attempt empty auth.json creation * chore: add test_bundle ESLint ignore pattern * 🔧 style(fix): Convo Fade Effect (#2147) * 🔧 (fix) Convo Fade Effect * 🔧style(fix): Convo Fade Effect (#2117) * 🔧 style(fix): Convo Fade Effect (#2117) * 🖌️ style: Improve Dark Theme Accessibility (#2125) * style: all landing page components * chore: converted all slate to gray, since slate doesnt work * style: assistant panel * style: basic UI components, userprovided, preset * style: update in multiple components * fix(PluginStoreDialog): justify-center * fixed some minor Ui styles * style(MultiSearch): update dark bg * style: update Convo styling * style: lower textarea max height slightly --------- Co-authored-by: Danny Avila <messagedaniel@protonmail.com> * 🔧 fix(menu): Menu Item Filter Improvements (#2153) * small-fix: Ensure that fake seperators in model lists do not show in search * Ensure Plugin search uses correct placeholder and key filtering in search * 🚀 feat: Add ShuttleAI as Known Endpoint (#2152) Added new Official Known Endpoint (ShuttleAI) * 🌑 style(File Manager): Localize and Update Dark Mode Stylings (#2155) * 🌑 style: Update Dark Mode Stylings for File Manager * 🌐 feat: localize file manager text * 🌐 feat: file panel table localization * 🐋 chore: Cleanup Dockerfile (#2156) * 🐋 fix(Dockerfile): add back additional deps., handle permissions, use `--no-audit` flag on install (#2157) * 🐋 chore: Revise of PR #2157, move step earlier * chore: Revise of PR #2157, move global steps earlier, execute as root * 📖 docs: Update ShuttleAI Fibonacci Image (#2160) * 🚀 feat: Assistants Streaming (#2159) * chore: bump openai to 4.29.0 and npm audit fix * chore: remove unnecessary stream field from ContentData * feat: new enum and types for AssistantStreamEvent * refactor(AssistantServi…
This is actually a blocker for us. We are trying to use the payment intent API from Stripe and it is forcing us to use br compression. I tried using Axios in order to set 'Accept-Encoding': 'gzip' but Stripe seems to ignore this. Until this issue is fixed we can't continue to use Bun. It's honestly disappointing because we have been using Bun since September but now we have to switch back to Node. |
@paulGeoghegan let me give you the solution! We got stuck here as well but managed to just patch the axios JS files to remove Brotli. What you should do is install custompatch. More information here: https://github.com/tmcdos/custompatch Go to axios in node_modules and apply this patch. Search for the lines in out patch file: Index: /axios/dist/node/axios.cjs
===================================================================
--- /axios/dist/node/axios.cjs
+++ /axios/dist/node/axios.cjs
@@ -2873,9 +2873,9 @@
}
headers.set(
'Accept-Encoding',
- 'gzip, compress, deflate' + (isBrotliSupported ? ', br' : ''), false
+ 'gzip, compress, deflate', false
);
const options = {
path,
Index: /axios/lib/adapters/http.js
===================================================================
--- /axios/lib/adapters/http.js
+++ /axios/lib/adapters/http.js
@@ -34,9 +34,9 @@
flush: zlib.constants.BROTLI_OPERATION_FLUSH,
finishFlush: zlib.constants.BROTLI_OPERATION_FLUSH
}
-const isBrotliSupported = utils.isFunction(zlib.createBrotliDecompress);
+const isBrotliSupported = false;
const {http: httpFollow, https: httpsFollow} = followRedirects;
const isHttps = /https:?/; If you've added these changes, do: this will create the patch files. In the end add this, so everytime the package is going to install it will apply the patch afterwards: "scripts": {
...others
"postinstall": "bunx custompatch"
}, |
@zolero you have saved me! thank you so much. I was preparing to switch back to Node when I got your email. That's a fantastic package and I can't believe I haven't heard of it before. So many times I have just wanted to be able to apply a patch to a package but it is usually a lot of work. Again thank you because I love using Bun and it would have been a shame. |
This works only if you have node installed, though. Otherwise you end up with:
From the bun image with docker, the custompatch always fails. PS: Was able to acheive the same result with the Docker image following #2336 |
@Grandnainconnu yeah I know. I had to stop using my dev container and just install BUN for windows. I'm actually having trouble with the patches but it has fixed my issue for now. It's not ideal but at least now I'm not stuck. |
Just for visibility: #7248 - looks like something may have changed in a recent version of bunjs that has made this issue become more problematic now, in case this helps anyone from google. |
Can confirm something in recent versions of Bun has caused this to break |
axois is used in a lot of dependencies this should be fixed soon. |
There's a pull request for it; I hope it gets merged soon so that we'll have Brotli in the next version of Bun. |
Bun v1.1.8 will include support for Brotli in In about an hour, you can try it out via bun upgrade --canary |
HUGEEEE |
does this include zstd too? |
it shouldn't. They're separate issues. Also, zstd is not a de facto web standard like brotli is, no matter how nice the algorithm / default implementation might be. |
@M-Gonzalo I wanted to know if I still have to do this header modification patch on axios for safety as mentioned in #267 (comment). As default accept encoding header of axios includes zstd. |
Where do you see this in Axios' codebase? |
I don't know what to say about that. There isn't a single mention of zstd in axios' source code: |
in #267 (comment):
So, I thought it was the default behaviour. However, you are right. It seems like there is no default |
Bun.serve({
fetch(req) {
return new Response(JSON.stringify(req.headers));
},
}); > axios.get("http://localhost:3000").then(x => console.log(x.data))
> {
accept: 'application/json, text/plain, */*',
'user-agent': 'axios/1.6.8',
'accept-encoding': 'gzip, compress, deflate, br',
host: 'localhost:3000',
connection: 'keep-alive'
} |
* fix(bun): fix bun compatibility to allow gzip header: oven-sh/bun#267 (comment) * chore: update custom config examples * fix(OpenAIClient.chatCompletion): remove redundant call of stream.controller.abort() as `break` aborts the request and prevents abort errors when not called redundantly * chore: bump bun.lockb * fix: remove result-thinking class when message is no longer streaming * fix(bun): improve Bun support by forcing use of old method in bun env, also update old methods with new customizable params * fix(ci): pass tests
This shows up in google search so posting this. It was fixed in https://bun.sh/blog/bun-v1.1.8 I am using 1.1.17 and i don't see the issue after upgrading from 1.1 |
This issue has been fixed as of Bun v1.1.8 in https://bun.sh/blog/bun-v1.1.8
Original issue below
The zlib implementation available doesn't support brotli. It's also significantly different than the current node.js structure of the library.
The text was updated successfully, but these errors were encountered: