Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 3 additions & 10 deletions ds4_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -898,12 +898,6 @@ static const char *server_model_id_from_engine(ds4_engine *engine) {
"deepseek-v4-pro" : "deepseek-v4-flash";
}

static bool server_model_alias_known(const char *id) {
return id &&
(!strcmp(id, "deepseek-v4-flash") ||
!strcmp(id, "deepseek-v4-pro"));
}

static void stop_list_clear(stop_list *stops) {
for (int i = 0; i < stops->len; i++) free(stops->v[i]);
stops->len = 0;
Expand Down Expand Up @@ -11213,9 +11207,7 @@ static bool send_model(server *s, int fd, const char *id) {
static bool send_models(server *s, int fd) {
buf b = {0};
buf_puts(&b, "{\"object\":\"list\",\"data\":[");
append_model_json(&b, s, "deepseek-v4-flash");
buf_putc(&b, ',');
append_model_json(&b, s, "deepseek-v4-pro");
append_model_json(&b, s, server_model_id_from_engine(s->engine));
buf_puts(&b, "]}\n");
bool ok = http_response(fd, s->enable_cors, 200, "application/json", b.ptr);
buf_free(&b);
Expand Down Expand Up @@ -11258,7 +11250,8 @@ static void *client_main(void *arg) {
const size_t model_path_prefix_len = strlen(model_path_prefix);
if (!strcmp(hr.method, "GET") &&
!strncmp(hr.path, model_path_prefix, model_path_prefix_len) &&
server_model_alias_known(hr.path + model_path_prefix_len))
!strcmp(hr.path + model_path_prefix_len,
server_model_id_from_engine(s->engine)))
{
send_model(s, fd, hr.path + model_path_prefix_len);
http_request_free(&hr);
Expand Down