Skip to content

Comments

librechat: init at 0.7.7#393133

Merged
GaetanLepage merged 1 commit intoNixOS:masterfrom
niklaskorz:librechat-init
Apr 14, 2025
Merged

librechat: init at 0.7.7#393133
GaetanLepage merged 1 commit intoNixOS:masterfrom
niklaskorz:librechat-init

Conversation

@niklaskorz
Copy link
Member

@niklaskorz niklaskorz commented Mar 25, 2025

Implements the package part of #352044. The NixOS module will follow in a separate PR for easier review and to get the package in faster, as module reviews usually are more involved than package reviews.

This package has been in use for about five months, so it's been fairly well tested.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@niklaskorz niklaskorz force-pushed the librechat-init branch 3 times, most recently from 83b0774 to 50683e7 Compare March 25, 2025 17:08
@github-actions github-actions bot added 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Mar 25, 2025
@markus1189
Copy link
Contributor

Using nix shell nixpkgs#nixpkgs-review -c nixpkgs-review pr 'https://github.com/NixOS/nixpkgs/pull/393133' and running it I get an error:

[nix-shell:~/.cache/nixpkgs-review/pr-393133]$ librechat-server --help
node:buffer:325
  throw new ERR_INVALID_ARG_TYPE(
  ^

TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received undefined
    at Function.from (node:buffer:325:9)
    at Object.<anonymous> (/nix/store/kg80fjmwpjyasjzfi3mflp5hhpj040w5-librechat-0.7.7/lib/node_modules/LibreChat/api/server/utils/crypto.js:4:20)
    at Module._compile (node:internal/modules/cjs/loader:1554:14)
    at Object..js (node:internal/modules/cjs/loader:1706:10)
    at Module.load (node:internal/modules/cjs/loader:1289:32)
    at Function._load (node:internal/modules/cjs/loader:1108:12)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:220:24)
    at Module.require (node:internal/modules/cjs/loader:1311:12)
    at require (node:internal/modules/helpers:136:16) {
  code: 'ERR_INVALID_ARG_TYPE'
}

Node.js v22.14.0

@niklaskorz
Copy link
Member Author

Interesting, we've been running it in Node 20 so far so I wonder if that is indeed Node 22 related. I'll investigate

@niklaskorz
Copy link
Member Author

niklaskorz commented Mar 31, 2025

@markus1189 this actually works as intended, the error you are experiencing is documented here:
https://www.librechat.ai/docs/configuration/dotenv#credentials-configuration

Warning: If you don’t set CREDS_KEY and CREDS_IV, the app will crash on startup.

Also, the server does not have a --help parameter, consult the upstream docs instead (or wait for my separate module PR)

@markus1189
Copy link
Contributor

@niklaskorz thanks for figuring that out :)

I used https://www.librechat.ai/toolkit/creds_generator to generate secrets and set them as environment variables.

With that, I managed to get it running locally until the login mask.

LGTM

@wegank wegank added the 12.approvals: 1 This PR was reviewed and approved by one person. label Mar 31, 2025
Copy link
Contributor

@74k1 74k1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was able to build it as well. Looking forward for the Module! ❤️

@wegank wegank added 12.approvals: 2 This PR was reviewed and approved by two persons. and removed 12.approvals: 1 This PR was reviewed and approved by one person. labels Apr 12, 2025
@niklaskorz
Copy link
Member Author

Blocked by #398583

@niklaskorz niklaskorz marked this pull request as draft April 14, 2025 15:41
@GaetanLepage
Copy link
Contributor

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 393133


x86_64-linux

❌ 1 package failed to build:
  • librechat

aarch64-linux

❌ 1 package failed to build:
  • librechat

x86_64-darwin

❌ 1 package failed to build:
  • librechat

aarch64-darwin

❌ 1 package failed to build:
  • librechat

@github-actions github-actions bot added 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. and removed 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Apr 14, 2025
@niklaskorz niklaskorz marked this pull request as ready for review April 14, 2025 18:17
@github-actions github-actions bot added 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. and removed 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. labels Apr 14, 2025
@github-actions github-actions bot added the 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. label Apr 14, 2025
@niklaskorz
Copy link
Member Author

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 393133


aarch64-linux

✅ 1 package built:
  • librechat

aarch64-darwin

✅ 1 package built:
  • librechat

@GaetanLepage
Copy link
Contributor

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 393133


x86_64-linux

✅ 1 package built:
  • librechat

aarch64-linux

✅ 1 package built:
  • librechat

x86_64-darwin

❌ 1 package failed to build:
  • librechat

aarch64-darwin

❌ 1 package failed to build:
  • librechat

Copy link
Contributor

@GaetanLepage GaetanLepage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Diff LGTM. Failures are unrelated.

@GaetanLepage GaetanLepage requested a review from drupol April 14, 2025 20:28
@GaetanLepage GaetanLepage merged commit f4d054b into NixOS:master Apr 14, 2025
67 of 71 checks passed
@niklaskorz niklaskorz deleted the librechat-init branch June 22, 2025 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 12.approvals: 2 This PR was reviewed and approved by two persons.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants