From b438fb4b150c91e907dd81bf49186668b0858ea3 Mon Sep 17 00:00:00 2001 From: cat0825 <1759138827@qq.com> Date: Wed, 27 May 2026 10:31:15 +0800 Subject: [PATCH] Advertise deepseek-chat model alias --- ds4_server.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/ds4_server.c b/ds4_server.c index a9930d603..44190aafb 100644 --- a/ds4_server.c +++ b/ds4_server.c @@ -899,7 +899,8 @@ static const char *server_model_id_from_engine(ds4_engine *engine) { static bool server_model_alias_known(const char *id) { return id && (!strcmp(id, "deepseek-v4-flash") || - !strcmp(id, "deepseek-v4-pro")); + !strcmp(id, "deepseek-v4-pro") || + !strcmp(id, "deepseek-chat")); } static void stop_list_clear(stop_list *stops) { @@ -11112,6 +11113,8 @@ static bool send_models(server *s, int fd) { append_model_json(&b, s, "deepseek-v4-flash"); buf_putc(&b, ','); append_model_json(&b, s, "deepseek-v4-pro"); + buf_putc(&b, ','); + append_model_json(&b, s, "deepseek-chat"); buf_puts(&b, "]}\n"); bool ok = http_response(fd, s->enable_cors, 200, "application/json", b.ptr); buf_free(&b); @@ -14376,6 +14379,16 @@ static void test_model_metadata_clamps_completion_to_context(void) { TEST_ASSERT(strstr(b.ptr, "\"context_length\":100000") != NULL); TEST_ASSERT(strstr(b.ptr, "\"max_completion_tokens\":4096") != NULL); buf_free(&b); + + append_model_json_values(&b, "deepseek-chat", "DeepSeek V4 Flash", + 32768, 393216); + TEST_ASSERT(strstr(b.ptr, "\"id\":\"deepseek-chat\"") != NULL); + TEST_ASSERT(strstr(b.ptr, "\"name\":\"DeepSeek V4 Flash\"") != NULL); + TEST_ASSERT(strstr(b.ptr, "\"context_length\":32768") != NULL); + TEST_ASSERT(strstr(b.ptr, "\"max_completion_tokens\":32768") != NULL); + buf_free(&b); + + TEST_ASSERT(server_model_alias_known("deepseek-chat")); } static void test_client_socket_nonblocking_flag(void) {