Skip to content

Distribute and run LLMs with a single file.

734 B
Raw Blame
diff --git a/tools/server/server-http.h b/tools/server/server-http.h
--- a/llama.cpp/tools/server/server-http.h
+++ b/llama.cpp/tools/server/server-http.h
@@ -91,11 +91,16 @@ struct server_http_context {
     std::string path_prefix;
     int port    = 9931;
     bool is_ssl = false;
+    bool is_bound = false;
 
     server_http_context();
     ~server_http_context();
 
     bool init(const common_params & params);
+    // creates and binds the listening sockets; start() calls it if needed.
+    // llamafile binds early so the sockets exist before the sandbox is
+    // installed (a Unix domain socket can't be created under pledge "anet")
+    bool bind_socket();
     bool start();
     void stop() const;
     void join();