Distribute and run LLMs with a single file.
C++ cross-platformggufllama-cpplocal-ailocal-inferencelocal-llmopen-source-aisingle-file-executablespeech-to-text
Update release scripts (#990)
Davide Eynardcc1c1d2c4394
diff --git a/Makefile b/Makefileindex d28b7cca..e7ba1a9e 100644--- a/Makefile+++ b/Makefile@@ -35,12 +35,19 @@ o/$(MODE)/: o/$(MODE)/llamafile \o/$(MODE)/third_party/zipalign.PHONY: install-install: o/$(MODE)/llamafile/llamafile+install: o/$(MODE)/llamafile/llamafile \+ whisperfile/whisperfile.1 \+ whisperfile/whisper-server.1 \+ third_party/zipalign/zipalign.1mkdir -p $(PREFIX)/bin$(INSTALL) o/$(MODE)/llamafile/llamafile $(PREFIX)/bin/llamafile$(INSTALL) o/$(MODE)/whisperfile/whisperfile $(PREFIX)/bin/whisperfile$(INSTALL) o/$(MODE)/diffusionfile/diffusionfile $(PREFIX)/bin/diffusionfile$(INSTALL) o/$(MODE)/third_party/zipalign/zipalign $(PREFIX)/bin/zipalign+ mkdir -p $(PREFIX)/share/man/man1+ $(INSTALL) -m 0644 whisperfile/whisperfile.1 $(PREFIX)/share/man/man1/whisperfile.1+ $(INSTALL) -m 0644 whisperfile/whisper-server.1 $(PREFIX)/share/man/man1/whisper-server.1+ $(INSTALL) -m 0644 third_party/zipalign/zipalign.1 $(PREFIX)/share/man/man1/zipalign.1.PHONY: checkcheck: o/$(MODE)/testsdiff --git a/llamafile/release.sh b/llamafile/release.shnew file mode 100644index 00000000..adcbe9a4--- /dev/null+++ b/llamafile/release.sh@@ -0,0 +1,64 @@+# update LLAMAFILE_VERSION for a new release+LLAMAFILE_VERSION="0.10.2"++# this is where the precompiled GPU libraries are stored+GPU_LIBS_DIR="/home/mala/gpulibs/${LLAMAFILE_VERSION}"++# this is where all the release files are gonna be saved+RELEASE_DIR="/home/mala/releases/${LLAMAFILE_VERSION}"++# this is where the zip package contents are being collected+ZIP_DIR="${RELEASE_DIR}/llamafile-${LLAMAFILE_VERSION}"++# run make install to store binaries and man pages in ZIP_DIR+make install PREFIX="${ZIP_DIR}"++# Check if make install actually created ZIP_DIR+if [ ! -d "${ZIP_DIR}" ]; then+ echo "Error: Source directory does not exist: ${ZIP_DIR}"+ exit 1+fi++# Copy the README into the release+cp README.md "${ZIP_DIR}/README.md"++# Make a copy of llamafile while it's thin+cp "${ZIP_DIR}/bin/llamafile" "${ZIP_DIR}/bin/llamafile-thin"++# Bundle llamafile binary with GPU libs+${ZIP_DIR}/bin/zipalign -j0 "${ZIP_DIR}/bin/llamafile" \+ "${GPU_LIBS_DIR}/ggml-cuda.so" \+ "${GPU_LIBS_DIR}/ggml-cuda.dll" \+ "${GPU_LIBS_DIR}/ggml-vulkan.so" \+ "${GPU_LIBS_DIR}/ggml-vulkan.dll"++DEST_DIR="${RELEASE_DIR}/release"+mkdir "${DEST_DIR}"++# list of binaries to copy and rename+BINARIES="llamafile zipalign whisperfile diffusionfile"++for binary in $BINARIES; do+ if [ -f "${ZIP_DIR}/bin/${binary}" ]; then+ cp "${ZIP_DIR}/bin/${binary}" "${DEST_DIR}/${binary}-${LLAMAFILE_VERSION}"+ echo "Copied ${binary} to ${DEST_DIR}/${binary}-${LLAMAFILE_VERSION}"+ else+ echo "Warning: ${ZIP_DIR}/bin/${binary} not found"+ fi+done++# move the thin llamafile in the release dir (we are not packing both in the zip)+mv "${ZIP_DIR}/bin/llamafile-thin" "${DEST_DIR}/llamafile-${LLAMAFILE_VERSION}-thin"++ZIP_FILE="${DEST_DIR}/llamafile-${LLAMAFILE_VERSION}.zip"++echo "Zipping ${ZIP_DIR} into ${ZIP_FILE}"++# now zip the release directory+zip -r "${ZIP_FILE}" "${ZIP_DIR}"++if [ -f "${ZIP_FILE}" ]; then+ echo "${ZIP_FILE} ready."+else+ echo "Error creating ${ZIP_FILE}"+fi