Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Commit ed5e5fb

Browse files
committed
feat: add openai compatible path
1 parent 20d3be8 commit ed5e5fb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

controllers/llamaCPP.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2127,6 +2127,10 @@ class llamaCPP : public drogon::HttpController<llamaCPP> {
21272127
METHOD_ADD(llamaCPP::unloadModel, "unloadmodel", Get);
21282128
METHOD_ADD(llamaCPP::modelStatus, "modelstatus", Get);
21292129

2130+
// Openai compatible path
2131+
ADD_METHOD_TO(llamaCPP::chatCompletion, "/v1/chat/completions", Post);
2132+
ADD_METHOD_TO(llamaCPP::embedding, "/v1/embeddings", Post);
2133+
21302134
// PATH_ADD("/llama/chat_completion", Post);
21312135
METHOD_LIST_END
21322136
void chatCompletion(const HttpRequestPtr &req,

0 commit comments

Comments
 (0)