Distribute and run LLMs with a single file.
C++ cross-platformggufllama-cpplocal-ailocal-inferencelocal-llmopen-source-aisingle-file-executablespeech-to-text
Reduce attack surface of stb_image
Justine Tunney46284fec81b9
diff --git a/llama.cpp/main/main.1 b/llama.cpp/main/main.1index 7e14f67a..2e6a1383 100644--- a/llama.cpp/main/main.1+++ b/llama.cpp/main/main.1@@ -987,7 +987,7 @@ Here's an example of how you can use llamafile to summarize HTML URLs:--no-display-prompt 2>/dev/null.Ed.Pp-Here's how you can use llamafile to describe a jpg/png/gif/bmp image:+Here's how you can use llamafile to describe a jpg/png/gif image:.Bd -literal -offset indentllamafile --temp 0 \[rs]--image lemurs.jpg \[rs]diff --git a/llamafile/chatbot_help.cpp b/llamafile/chatbot_help.cppindex 258a1274..4db31ae7 100644--- a/llamafile/chatbot_help.cpp+++ b/llamafile/chatbot_help.cpp@@ -134,8 +134,8 @@ shares file from local hard drive with assistant. if this is a text file\n\then a markdown system prompt is generated and added to the conversation\n\history that gives the assistant readonly access to the file content and\n\metadata. files with nul characters in them are currently not supported.\n\-image files (png/jpg/gif/bmp/hdr/psd/tga/pgm/ppm) may be uploaded if you\n\-specified a clip vision model (eg. LLaVA) earlier with the --mmproj flag\n\+image files (jpg/png/gif) may be uploaded if you specified a clip vision\n\+model (e.g. LLaVA) earlier when running llamafile with the --mmproj flag\n\");} else if (args[1] == "forget") {fprintf(stderr, "\diff --git a/llamafile/server/doc/v1_chat_completions.md b/llamafile/server/doc/v1_chat_completions.mdindex cee23faa..4eda4aa7 100644--- a/llamafile/server/doc/v1_chat_completions.md+++ b/llamafile/server/doc/v1_chat_completions.md@@ -207,22 +207,12 @@ same order as any surrounding text, e.g.<img src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==">```-The supported image file formats are:--- PNG-- JPEG-- GIF-- BMP-- TGA-- HDR-- PGM-- PPM-- PIC-The declared mime type of the data URI must begin with `image/`. Itssubtype is largely ignored, since the file type is inferred from thebinary payload.+The supported image file formats are JPEG, PNG, and GIF.+## See Also- [LLaMAfiler Documentation Index](index.md)diff --git a/stb/stb_image.c b/stb/stb_image.cindex 8ddfd1f5..8c921679 100644--- a/stb/stb_image.c+++ b/stb/stb_image.c@@ -1,2 +1,16 @@++// Reduce attack surface.+//+// "At this point, there are no plans to include more image formats in+// stb_image; a higher priority is to get the existing ones stable."+// —Fabian Giesen (stb_image collaborator)+//+#define STBI_NO_BMP+#define STBI_NO_PSD+#define STBI_NO_TGA+#define STBI_NO_HDR+#define STBI_NO_PIC+#define STBI_NO_PNM+#define STB_IMAGE_IMPLEMENTATION#include "stb_image.h"