Skip to content

Commit cf8b0db

Browse files
authored
server : remove /api endpoints (#22165)
* server : remove /api endpoints * cont : remove /api/tags
1 parent fd6ae4c commit cf8b0db

4 files changed

Lines changed: 0 additions & 34 deletions

File tree

tools/server/server-context.cpp

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3653,34 +3653,6 @@ void server_routes::init_routes() {
36533653
return res;
36543654
};
36553655

3656-
this->get_api_show = [this](const server_http_req &) {
3657-
auto res = create_response();
3658-
std::string tmpl_default = common_chat_templates_source(meta->chat_params.tmpls.get(), "");
3659-
json data = {
3660-
{
3661-
"model_info", {
3662-
{ "llama.context_length", meta->slot_n_ctx },
3663-
}
3664-
},
3665-
{"modelfile", ""},
3666-
{"parameters", ""},
3667-
{"template", tmpl_default},
3668-
{"details", {
3669-
{"parent_model", ""},
3670-
{"format", "gguf"},
3671-
{"family", ""},
3672-
{"families", {""}},
3673-
{"parameter_size", ""},
3674-
{"quantization_level", ""}
3675-
}},
3676-
{"model_info", ""},
3677-
{"capabilities", meta->has_mtmd ? json({"completion","multimodal"}) : json({"completion"})}
3678-
};
3679-
3680-
res->ok(data);
3681-
return res;
3682-
};
3683-
36843656
this->post_infill = [this](const server_http_req & req) {
36853657
auto res = create_response();
36863658
// check model compatibility

tools/server/server-context.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ struct server_routes {
105105
server_http_context::handler_t post_slots;
106106
server_http_context::handler_t get_props;
107107
server_http_context::handler_t post_props;
108-
server_http_context::handler_t get_api_show;
109108
server_http_context::handler_t post_infill;
110109
server_http_context::handler_t post_completions;
111110
server_http_context::handler_t post_completions_oai;

tools/server/server-http.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@ bool server_http_context::init(const common_params & params) {
143143
"/v1/health",
144144
"/models",
145145
"/v1/models",
146-
"/api/tags",
147146
"/",
148147
"/index.html",
149148
"/bundle.js",

tools/server/server.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@ int main(int argc, char ** argv) {
141141
// note: routes.get_health stays the same
142142
routes.get_metrics = models_routes->proxy_get;
143143
routes.post_props = models_routes->proxy_post;
144-
routes.get_api_show = models_routes->proxy_get;
145144
routes.post_completions = models_routes->proxy_post;
146145
routes.post_completions_oai = models_routes->proxy_post;
147146
routes.post_chat_completions = models_routes->proxy_post;
@@ -174,16 +173,13 @@ int main(int argc, char ** argv) {
174173
ctx_http.get ("/metrics", ex_wrapper(routes.get_metrics));
175174
ctx_http.get ("/props", ex_wrapper(routes.get_props));
176175
ctx_http.post("/props", ex_wrapper(routes.post_props));
177-
ctx_http.post("/api/show", ex_wrapper(routes.get_api_show));
178176
ctx_http.get ("/models", ex_wrapper(routes.get_models)); // public endpoint (no API key check)
179177
ctx_http.get ("/v1/models", ex_wrapper(routes.get_models)); // public endpoint (no API key check)
180-
ctx_http.get ("/api/tags", ex_wrapper(routes.get_models)); // ollama specific endpoint. public endpoint (no API key check)
181178
ctx_http.post("/completion", ex_wrapper(routes.post_completions)); // legacy
182179
ctx_http.post("/completions", ex_wrapper(routes.post_completions));
183180
ctx_http.post("/v1/completions", ex_wrapper(routes.post_completions_oai));
184181
ctx_http.post("/chat/completions", ex_wrapper(routes.post_chat_completions));
185182
ctx_http.post("/v1/chat/completions", ex_wrapper(routes.post_chat_completions));
186-
ctx_http.post("/api/chat", ex_wrapper(routes.post_chat_completions)); // ollama specific endpoint
187183
ctx_http.post("/v1/responses", ex_wrapper(routes.post_responses_oai));
188184
ctx_http.post("/responses", ex_wrapper(routes.post_responses_oai));
189185
ctx_http.post("/v1/audio/transcriptions", ex_wrapper(routes.post_transcriptions_oai));

0 commit comments

Comments
 (0)