server: add "schema" and validation (#24150)

* wip

* working

* correct some limits

* add field name to error message
This commit is contained in:
Xuan-Son Nguyen
2026-06-18 15:40:58 +02:00
committed by GitHub
parent 08023072ef
commit e1efd0991d
6 changed files with 744 additions and 396 deletions
+2 -1
View File
@@ -4,6 +4,7 @@
#include "server-http.h"
#include "server-task.h"
#include "server-queue.h"
#include "server-schema.h"
#include "build-info.h"
#include "common.h"
@@ -3825,7 +3826,7 @@ std::unique_ptr<server_res_generator> server_routes::handle_completions_impl(
task.id = rd.get_new_id();
task.tokens = std::move(inputs[i]);
task.params = server_task::params_from_json_cmpl(
task.params = server_schema::eval_llama_cmpl_schema(
ctx_server.vocab,
params,
meta->slot_n_ctx,