Add Filters to Model Configuration (#174)

llama-swap can strip specific keys in JSON requests. This is useful for removing the ability for clients to set sampling parameters like temperature, top_k, top_p, etc.
This commit is contained in:
Benson Wong
2025-06-23 10:52:29 -07:00
committed by GitHub
parent 756193d0dd
commit 4236cec03a
9 changed files with 297 additions and 71 deletions

View File

@@ -42,9 +42,12 @@ func main() {
time.Sleep(wait)
}
bodyBytes, _ := io.ReadAll(c.Request.Body)
c.JSON(http.StatusOK, gin.H{
"responseMessage": *responseMessage,
"h_content_length": c.Request.Header.Get("Content-Length"),
"request_body": string(bodyBytes),
})
})