@@ -4546,16 +4546,16 @@ int main(int argc, char ** argv) {
45464546 res_ok (res, models);
45474547 };
45484548
4549- const auto handle_ollama_version = [&ctx_server, &res_ok](const httplib::Request &, httplib::Response & res) {
4549+ const auto handle_version = [&ctx_server, &res_ok](const httplib::Request &, httplib::Response & res) {
45504550 json version;
4551- char * fake_ollama_version = std::getenv (" FAKE_OLLAMA_VERSION " );
4552- if (fake_ollama_version ) {
4551+ char * version_override = std::getenv (" LLAMA_API_VERSION_OVERRIDE " );
4552+ if (version_override ) {
45534553 version = {
4554- {" version" , std::string (fake_ollama_version )}
4554+ {" version" , std::string (version_override )}
45554555 };
45564556 } else {
45574557 version = {
4558- {" version" , " 0.6.4 " }
4558+ {" version" , std::to_string (LLAMA_BUILD_NUMBER) }
45594559 };
45604560 }
45614561
@@ -4900,7 +4900,7 @@ int main(int argc, char ** argv) {
49004900 svr->Get (params.api_prefix + " /models" , handle_models); // public endpoint (no API key check)
49014901 svr->Get (params.api_prefix + " /v1/models" , handle_models); // public endpoint (no API key check)
49024902 svr->Get (params.api_prefix + " /api/tags" , handle_models); // ollama specific endpoint. public endpoint (no API key check)
4903- svr->Get (params.api_prefix + " /api/version" , handle_ollama_version ); // ollama specific endpoint. public endpoint (no API key check)
4903+ svr->Get (params.api_prefix + " /api/version" , handle_version ); // public endpoint (no API key check)
49044904 svr->Post (params.api_prefix + " /completion" , handle_completions); // legacy
49054905 svr->Post (params.api_prefix + " /completions" , handle_completions);
49064906 svr->Post (params.api_prefix + " /v1/completions" , handle_completions_oai);
0 commit comments