Hacker News new | ask | show | jobs
by FragenAntworten 939 days ago
It doesn't seem to run on NixOS, though I'm new to Nix and may be missing something.

    $ ./llava-v1.5-7b-q4-server.llamafile --help
    ./llava-v1.5-7b-q4-server.llamafile: line 60: /bin/mkdir: No such file or directory
Regardless, this (and Cosmopolitan) are amazing work - thank you!
1 comments

The APE shell script needs to run /bin/mkdir in order to map the embedded ELF executable in memory. It should be possible for you to work around this on Linux by installing our binfmt_misc interpreter:

    sudo wget -O /usr/bin/ape https://cosmo.zip/pub/cosmos/bin/ape-$(uname -m).elf
    sudo sh -c "echo ':APE:M::MZqFpD::/usr/bin/ape:' >/proc/sys/fs/binfmt_misc/register"
    sudo sh -c "echo ':APE-jart:M::jartsr::/usr/bin/ape:' >/proc/sys/fs/binfmt_misc/register"
That way the only file you'll need to whitelist with Nix is /usr/bin/ape. You could also try just vendoring the 8kb ape executable in your Nix project, and simply executing `./ape ./llamafile`.
`./ape ./llamafile` worked immediately and without problems I can see - thank you!