Skip to content

Get up and running with Kimi, GLM, MiniMax, DeepSeek, gpt-oss, Qwen, Gemma and other models.

Improve crash reporting (#7728)

Daniel Hiltgen909a88c5c024
diff --git a/llm/server.go b/llm/server.go
index 624acbf89..d7c5198d3 100644
--- a/llm/server.go
+++ b/llm/server.go
@@ -838,13 +838,15 @@ func (s *llmServer) Completion(ctx context.Context, req CompletionRequest, fn fu
}
if err := scanner.Err(); err != nil {
- if strings.Contains(err.Error(), "unexpected EOF") {
+ if strings.Contains(err.Error(), "unexpected EOF") || strings.Contains(err.Error(), "forcibly closed") {
s.Close()
- msg := ""
+ var msg string
if s.status != nil && s.status.LastErrMsg != "" {
msg = s.status.LastErrMsg
+ } else {
+ msg = err.Error()
}
- return fmt.Errorf("an unknown error was encountered while running the model %s", msg)
+ return fmt.Errorf("an error was encountered while running the model: %s", msg)
}
return fmt.Errorf("error reading llm response: %v", err)
diff --git a/llm/status.go b/llm/status.go
index 604fe9e0d..80f44e654 100644
--- a/llm/status.go
+++ b/llm/status.go
@@ -27,6 +27,7 @@ var errorPrefixes = []string{
"\"ERR\"",
"error loading model",
"GGML_ASSERT",
+ "Deepseek2 does not support K-shift",
}
func (w *StatusWriter) Write(b []byte) (int, error) {