-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/msa-ez/platform
- Loading branch information
Showing
10 changed files
with
150 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
VUE_APP_MODE=onprem | ||
VUE_APP_MODE=dev | ||
VUE_APP_DB_HOST=localhost | ||
VUE_APP_DB_PORT=5757 | ||
VUE_APP_DB_NAME=mydb | ||
VUE_APP_GIT=gitea | ||
VUE_APP_GIT=github |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
src/components/designer/modeling/generators/features/AIGenerator/apiClients/RunpodClient.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
const BaseAPIClient = require('./BaseAPIClient'); | ||
const { TextParseHelper } = require('../helpers'); | ||
|
||
class RunpodClient extends BaseAPIClient { | ||
constructor(client, options, model, aiGenerator) { | ||
super(client, options, model, aiGenerator) | ||
} | ||
|
||
_makeRequestParams(messages, modelInfo, token){ | ||
let requestData = { | ||
model: modelInfo.requestModelName, | ||
messages: messages, | ||
stream: true | ||
} | ||
|
||
return { | ||
requestUrl: "http://localhost:4000/api/openai-compatibility/chat", | ||
requestData: JSON.stringify(requestData), | ||
requestHeaders: { | ||
"content-type": "application/json", | ||
"authorization": "Bearer " + token, | ||
"ai-param-url": localStorage.getItem("runpodUrl") || "https://dkkzpbvvh17k7v-8000.proxy.runpod.net/v1/chat/completions", | ||
} | ||
} | ||
} | ||
|
||
_parseResponseText(responseText){ | ||
const result = TextParseHelper.parseResponseText(responseText, { | ||
splitFunction: (text) => text.replace("data: [DONE]", "") | ||
.trim() | ||
.split("data: ") | ||
.filter(Boolean), | ||
|
||
extractFunction: (parsed) => { | ||
if(parsed.choices && parsed.choices[0]){ | ||
return { | ||
content: parsed.choices[0].delta.content || "", | ||
id: parsed.id, | ||
finish_reason: parsed.choices[0].finish_reason === 'length' ? 'length' : null, | ||
error: parsed.error || null | ||
} | ||
} | ||
return { content: "", id: parsed.id, finish_reason: null, error: parsed.error || null } | ||
} | ||
}) | ||
|
||
if(this.aiGenerator.modelInfo.requestModelName.toLowerCase().includes("deepseek-r1")) { | ||
// 이유는 알 수 없으나, 몇몇 모델들은 <think> 태그로 시작하지 않으면서, </think> 태그로 끝나는 응답을 보내는 경우가 있음 | ||
if(!result.joinedText.startsWith("<think>")) { | ||
result.joinedText = "<think>" + result.joinedText | ||
} | ||
|
||
const tagParsedContents = TextParseHelper.parseFrontTagContents(result.joinedText, "think"); | ||
result.joinedText = tagParsedContents.restText; | ||
this.aiGenerator.parsedTexts.think = tagParsedContents.tagContents; | ||
} | ||
|
||
return result; | ||
} | ||
} | ||
|
||
module.exports = RunpodClient; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
...ng/generators/features/AIGenerator/helpers/ModelInfoHelper/modelInfos/runpodModelInfos.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
export const runpodModelInfos = { | ||
// 가능한 설정 옵션들: neuralmagic/DeepSeek-R1-Distill-Llama-70B-quantized.w8a8 | ||
"neuralmagic/DeepSeek-R1-Distill-Llama-70B-quantized.w8a8": { | ||
vendor: "runpod", | ||
contextWindowTokenLimit: 16000, | ||
outputTokenLimit: 2048, | ||
requestArgs: { | ||
maxTokens: 2048 | ||
} | ||
}, | ||
|
||
"deepseek-ai/DeepSeek-R1-Distill-Qwen-32B": { | ||
vendor: "runpod", | ||
contextWindowTokenLimit: 131072, | ||
outputTokenLimit: 8192, | ||
requestArgs: { | ||
maxTokens: 8192 | ||
} | ||
} | ||
} |