Get up and running with Kimi, GLM, MiniMax, DeepSeek, gpt-oss, Qwen, Gemma and other models.
Document response stream chunk delimiter. (#632)
Jay Nakrani1d0ebe67e875
diff --git a/docs/api.md b/docs/api.mdindex 65aefc25b..7415101bf 100644--- a/docs/api.md+++ b/docs/api.md@@ -23,6 +23,10 @@ Model names follow a `model:tag` format. Some examples are `orca-mini:3b-q4_1` aAll durations are returned in nanoseconds.+### Streaming responses++Certain endpoints stream responses as JSON objects delineated with the newline (`\n`) character.+## Generate a completion```shelldiff --git a/server/routes.go b/server/routes.goindex 6ca7b4287..c68011df1 100644--- a/server/routes.go+++ b/server/routes.go@@ -610,6 +610,7 @@ func streamResponse(c *gin.Context, ch chan any) {return false}+ // Delineate chunks with new-line delimiterbts = append(bts, '\n')if _, err := w.Write(bts); err != nil {log.Printf("streamResponse: w.Write failed with %s", err)