Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 29dff69

Browse files
authoredNov 20, 2023
Merge pull request #153 from janhq/redir-test
feat: add openai compatible path
2 parents a5860b7 + ed5e5fb commit 29dff69

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed
 

‎controllers/llamaCPP.h

+4
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)
Please sign in to comment.