]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commit
server: (router) Forward form-data to model server (Fixes #22044) (#22118)
authortha80 <redacted>
Mon, 27 Apr 2026 21:55:00 +0000 (23:55 +0200)
committerGitHub <redacted>
Mon, 27 Apr 2026 21:55:00 +0000 (23:55 +0200)
commit983ca8992ec46d7b94587a00d925b5a4bf2d9c81
tree3c6d1ef02962cb208b629893737f18afa3aba07c
parent665abc609740d397d30c0d8ef4157dbf900bd1a3
server: (router) Forward form-data to model server (Fixes #22044) (#22118)

* This commit enables the router to forward form-data to model server.
Fixes #22044 (enabling to use the /v1/audio/transcriptions in router mode)

* * Applied the suggestion from Copilots first comment: using the non-throwing json::parse overload.
* Addressed Copilots third comment by extending the files representation to also include filename and content-type
* Addressed Copilots fourth comment by making the RNG thread_local

* Changed variable body from std::string to std::ostringstream in build_multipart_body
as suggested by ngxson in https://github.com/ggml-org/llama.cpp/pull/22118#discussion_r3127099053

* Added sanitize_field lambda in build_multipart_body for key, filename and content_type
as suggested by ngxson in https://github.com/ggml-org/llama.cpp/pull/22118#discussion_r3127104647

* explicitly checking if value/item is string before calling value/item.get<std::string>()
as requested by ngxson in https://github.com/ggml-org/llama.cpp/pull/22118#discussion_r3127111279

* Added double quote to the sanitize lambda and throw on json parse failure

---------

Co-authored-by: Ralph Paßgang <redacted>
tools/server/server-chat.cpp
tools/server/server-chat.h
tools/server/server-cors-proxy.h
tools/server/server-http.cpp
tools/server/server-http.h
tools/server/server-models.cpp
tools/server/server-models.h