Skip to content

Commit

Permalink
feat: add openai compatible path
Browse files Browse the repository at this point in the history
  • Loading branch information
tikikun committed Nov 20, 2023
1 parent 20d3be8 commit ed5e5fb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions controllers/llamaCPP.h
Original file line number Diff line number Diff line change
Expand Up @@ -2127,6 +2127,10 @@ class llamaCPP : public drogon::HttpController<llamaCPP> {
METHOD_ADD(llamaCPP::unloadModel, "unloadmodel", Get);
METHOD_ADD(llamaCPP::modelStatus, "modelstatus", Get);

// Openai compatible path
ADD_METHOD_TO(llamaCPP::chatCompletion, "/v1/chat/completions", Post);
ADD_METHOD_TO(llamaCPP::embedding, "/v1/embeddings", Post);

// PATH_ADD("/llama/chat_completion", Post);
METHOD_LIST_END
void chatCompletion(const HttpRequestPtr &req,
Expand Down

0 comments on commit ed5e5fb

Please sign in to comment.