Get up and running with Kimi, GLM, MiniMax, DeepSeek, gpt-oss, Qwen, Gemma and other models.
Enable windows error dialog for subprocess startup
Daniel Hiltgene12fff8810e3
diff --git a/llm/ext_server/server.cpp b/llm/ext_server/server.cppindex e8a076c43..14d921c04 100644--- a/llm/ext_server/server.cpp+++ b/llm/ext_server/server.cpp@@ -41,6 +41,7 @@#if defined(_WIN32)#include <windows.h>+#include <errhandlingapi.h>#endif#include <cstddef>@@ -2737,6 +2738,9 @@ int wmain(int argc, wchar_t **wargv) {for (int i = 0; i < argc; ++i) {argv[i] = wchar_to_char(wargv[i]);}++ // Adjust error mode to avoid error dialog after we start.+ SetErrorMode(SEM_FAILCRITICALERRORS);#elseint main(int argc, char **argv) {#endifdiff --git a/llm/llm_darwin_amd64.go b/llm/llm_darwin_amd64.goindex 3093e1ad2..60eed7194 100644--- a/llm/llm_darwin_amd64.go+++ b/llm/llm_darwin_amd64.go@@ -2,7 +2,10 @@ package llmimport ("embed"+ "syscall")//go:embed build/darwin/x86_64/*/bin/*var libEmbed embed.FS++var LlamaServerSysProcAttr = &syscall.SysProcAttr{}diff --git a/llm/llm_darwin_arm64.go b/llm/llm_darwin_arm64.goindex 928f0b824..20ce8552e 100644--- a/llm/llm_darwin_arm64.go+++ b/llm/llm_darwin_arm64.go@@ -2,7 +2,10 @@ package llmimport ("embed"+ "syscall")//go:embed build/darwin/arm64/*/bin/*var libEmbed embed.FS++var LlamaServerSysProcAttr = &syscall.SysProcAttr{}diff --git a/llm/llm_linux.go b/llm/llm_linux.goindex c2c5c4cb9..928b4e791 100644--- a/llm/llm_linux.go+++ b/llm/llm_linux.go@@ -1,6 +1,11 @@package llm-import "embed"+import (+ "embed"+ "syscall"+)//go:embed build/linux/*/*/bin/*var libEmbed embed.FS++var LlamaServerSysProcAttr = &syscall.SysProcAttr{}diff --git a/llm/llm_windows.go b/llm/llm_windows.goindex e44f4b951..763cccf9c 100644--- a/llm/llm_windows.go+++ b/llm/llm_windows.go@@ -1,6 +1,20 @@package llm-import "embed"+import (+ "embed"+ "syscall"+)// unused on windowsvar libEmbed embed.FS++const CREATE_DEFAULT_ERROR_MODE = 0x04000000++var LlamaServerSysProcAttr = &syscall.SysProcAttr{+ // Wire up the default error handling logic If for some reason a DLL is+ // missing in the path this will pop up a GUI Dialog explaining the fault so+ // the user can either fix their PATH, or report a bug. Without this+ // setting, the process exits immediately with a generic exit status but no+ // way to (easily) figure out what the actual missing DLL was.+ CreationFlags: CREATE_DEFAULT_ERROR_MODE,+}diff --git a/llm/server.go b/llm/server.goindex 08463ef01..557327732 100644--- a/llm/server.go+++ b/llm/server.go@@ -346,6 +346,7 @@ func NewLlamaServer(gpus gpu.GpuInfoList, model string, ggml *GGML, adapters, prs.cmd.Env = os.Environ()s.cmd.Stdout = os.Stdouts.cmd.Stderr = s.status+ s.cmd.SysProcAttr = LlamaServerSysProcAttrenvWorkarounds := [][2]string{}for _, gpu := range gpus {