Skip to content

lmstudio: 0.3.6 -> 0.3.11#383546

Merged
jopejoe1 merged 1 commit intoNixOS:masterfrom
crertel:lmstudio-0.3.10
Mar 3, 2025
Merged

lmstudio: 0.3.6 -> 0.3.11#383546
jopejoe1 merged 1 commit intoNixOS:masterfrom
crertel:lmstudio-0.3.10

Conversation

@crertel
Copy link
Contributor

@crertel crertel commented Feb 20, 2025

Update to 0.3.11.

This also marks lmstudio as broken on mac.

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.

@crertel crertel mentioned this pull request Feb 20, 2025
13 tasks
@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 Feb 20, 2025
@nix-owners nix-owners bot requested review from cig0 and eeedean February 20, 2025 03:35
@wegank wegank added 12.approvals: 1 This PR was reviewed and approved by one person. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages. labels Feb 20, 2025
@deftdawg
Copy link
Contributor

Reviewed this using nix run nixpkgs#nixpkgs-review -- pr 383546 and I'm happy to report it works well on my 6900XT, including 0.3.10's speculative decoding features (accessible from the beaker/lab icon after loading main model; near top right).

A couple of minor things I noticed, not specific to this PR:

  1. lms command line interface is present in the AppImage (resources/app/.webpack/lms), but not present in the nix output... that maybe that's an easy add by duplicating:
    https://github.com/NixOS/nixpkgs/blob/f7dafd65c6e75dc30b97550c9bb695cac85e79bc/pkgs/by-name/lm/lmstudio/linux.nix#L30
    and changing it to something like:
    install -D ${appimageContents}/resources/app/.webpack/lms -t $out/bin
    though I'm not certain of that
  2. The main binary is actually lm-studio within the AppImage rather than lmstudio

@deftdawg
Copy link
Contributor

Turns out it's slightly more complicated, need to patchelf lms; appending these to extraInstallCommands does it:

      # lms cli tool
      install -m 755 ${appimageContents}/resources/app/.webpack/lms $out/bin/

      ${final.patchelf}/bin/patchelf --set-interpreter "${final.stdenv.cc.bintools.dynamicLinker}" \
      --set-rpath "${final.stdenv.cc.cc.lib}/lib:${final.stdenv.cc.cc.lib}/lib64:$out/lib:${final.lib.makeLibraryPath [final.stdenv.cc.cc.lib]}" $out/bin/lms

Here's the full overlay:

(final: prev: {
  lmstudio = let
    version = "0.3.10";
    rev = "6";
    pname = "lmstudio";
    
    src = final.fetchurl {
      url = "https://installers.lmstudio.ai/linux/x64/${version}-${rev}/LM-Studio-${version}-${rev}-x64.AppImage";
      hash = "sha256-sAGU20gaDaFo5jvuCcN4tkVTlqvuXVCqvrHyl3yg384=";
    };
    appimageContents = final.appimageTools.extractType2 { inherit pname version src; };
  in final.appimageTools.wrapType2 {
    inherit pname version src;

    extraPkgs = pkgs: with pkgs; [
      ocl-icd
    ];

    extraInstallCommands = ''
      mkdir -p $out/share/applications
      cp -r ${appimageContents}/usr/share/icons $out/share
      install -m 444 ${appimageContents}/lm-studio.desktop $out/share/applications/      
      substituteInPlace $out/share/applications/lm-studio.desktop \
        --replace 'Exec=AppRun --no-sandbox %U' 'Exec=lmstudio'

      # lms cli tool
      install -m 755 ${appimageContents}/resources/app/.webpack/lms $out/bin/

      ${final.patchelf}/bin/patchelf --set-interpreter "${final.stdenv.cc.bintools.dynamicLinker}" \
      --set-rpath "${final.stdenv.cc.cc.lib}/lib:${final.stdenv.cc.cc.lib}/lib64:$out/lib:${final.lib.makeLibraryPath [final.stdenv.cc.cc.lib]}" $out/bin/lms
    '';
  };
})

@cig0 can you approve/merge the PR? Then I can try adding lms to another PR (or you can roll it in to this).

@crertel
Copy link
Contributor Author

crertel commented Feb 23, 2025

@deftdawg that's freakin' awesome, great work! I think it should go in its own PR once this one is merged.

@crertel
Copy link
Contributor Author

crertel commented Feb 24, 2025

Updated to match the upstream change to overridable urls and hashes.

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

@deftdawg deftdawg left a comment

Choose a reason for hiding this comment

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

I used this PR on X86_64 and it's good to go.

@deftdawg deftdawg requested a review from jbgi February 26, 2025 03:24
@wegank wegank added 12.approvals: 3+ This PR was reviewed and approved by three or more persons. and removed 12.approvals: 1 This PR was reviewed and approved by one person. labels Feb 26, 2025
@deftdawg
Copy link
Contributor

deftdawg commented Mar 3, 2025

0.3.11 is out now... it kinda sucks we can't get enough reviewers to merge promptly

@crertel
Copy link
Contributor Author

crertel commented Mar 3, 2025

@deftdawg ...sigh, lemme update again.

@deftdawg
Copy link
Contributor

deftdawg commented Mar 3, 2025

sha256-T8j0l2ZP53Zc0hgb2EyFeR0mH5YrNlz4UfzN0rO7bKU=

@eeedean
Copy link
Contributor

eeedean commented Mar 3, 2025

macOS-Issue persists unfortunately. So no change on darwin side of things.

@deftdawg
Copy link
Contributor

deftdawg commented Mar 3, 2025

Yep, this PR marks it as broken for Mac, I've pinged LM Studio many times on that issue asking if they'll fix it, they said they would but then went silent.

Anyway need to get this merged... @crertel, not sure what you committed but it doesn't show it having bumped the version to 0.3.11 here (don't forget to edit the issue title too)

@crertel crertel changed the title lmstudio: 0.3.6 -> 0.3.10 lmstudio: 0.3.6 -> 0.3.11 Mar 3, 2025
@crertel crertel requested review from deftdawg and eeedean March 3, 2025 21:35
@crertel
Copy link
Contributor Author

crertel commented Mar 3, 2025

@deftdawg should be good now, I think.

@jopejoe1 jopejoe1 merged commit e67b928 into NixOS:master Mar 3, 2025
39 of 43 checks passed
@crertel
Copy link
Contributor Author

crertel commented Mar 3, 2025

@deftdawg I think that tees you up for your PR about pulling lms out (and maybe some of their other stuff)?

@crertel crertel deleted the lmstudio-0.3.10 branch March 3, 2025 22:30
@deftdawg
Copy link
Contributor

deftdawg commented Mar 3, 2025

@deftdawg I think that tees you up for your PR about pulling lms out (and maybe some of their other stuff)?

Done -> #386864 😄

@mdaniels5757 mdaniels5757 mentioned this pull request Dec 17, 2025
2 tasks
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: 3+ This PR was reviewed and approved by three or more persons. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants