refactor(llm): 更新 API地址并重构部分代码

- 将所有外部 API 地址从 36.103.199.248 更改为 127.0.0.1
- 优化了 BaseModelTaskService 中的模型部署信息查询逻辑
- 添加了 FineTuningTaskHttpService 的引用- 删除了未使用的 ModelDeployConstantEnum 导入
This commit is contained in:
Liuyang 2025-02-26 14:33:19 +08:00
parent 4e45570a60
commit 2753c27a71
2 changed files with 29 additions and 23 deletions

View File

@ -4,9 +4,9 @@ import cn.iocoder.yudao.module.llm.controller.admin.basemodel.vo.BaseModelSaveRe
import cn.iocoder.yudao.module.llm.dal.dataobject.basemodel.BaseModelDO;
import cn.iocoder.yudao.module.llm.dal.dataobject.servername.ServerNameDO;
import cn.iocoder.yudao.module.llm.dal.mysql.servername.ServerNameMapper;
import cn.iocoder.yudao.module.llm.enums.ModelDeployConstantEnum;
import cn.iocoder.yudao.module.llm.handler.AigcCustomDateTimeDeserializer;
import cn.iocoder.yudao.module.llm.service.basemodel.vo.ModelListRes;
import cn.iocoder.yudao.module.llm.service.http.FineTuningTaskHttpService;
import cn.iocoder.yudao.module.llm.service.http.TrainHttpService;
import cn.iocoder.yudao.module.llm.service.http.vo.AigcModelDeploySaveReq;
import cn.iocoder.yudao.module.llm.service.http.vo.AigcModelDeployVO;
@ -43,7 +43,11 @@ public class BaseModelTaskService {
@Resource
ServerNameMapper serverNameMapper;
@Resource
private FineTuningTaskHttpService fineTuningTaskHttpService;
private static final String DEFAULT_MODEL_URL_SUFFIX = "/v1/chat/completions";
// 减少维护 先注释掉
@Scheduled(cron ="0 0/1 * * * ?")
public void synchronous() throws JsonProcessingException {
@ -73,7 +77,7 @@ public class BaseModelTaskService {
// 构建查询参数并查询模型部署信息
String query = "?filter={\"id\":" + modelId + "}";
log.debug("正在查询模型部署信息,查询参数: {}", query);
String res = trainHttpService.modelTableQuery(new HashMap<>(), serverName.getHost(), "model_deploy", query);
String res = fineTuningTaskHttpService.modelTableQuery(new HashMap<>(), serverName.getHost(), "model_deploy", query);
log.debug("模型部署信息查询成功。响应内容: {}", res);
// 解析响应内容

View File

@ -249,23 +249,23 @@ llm:
#################### 8123: RAG服务、训练集和标注相关API。 ###################
### RAG服务
#RAG健康检查 GET
rag_health: http://36.103.199.248:8123/health
rag_health: http://127.0.0.1:8123/health
#上传并向量化 POST
rag_embed: http://36.103.199.248:8123/embed
rag_embed: http://127.0.0.1:8123/embed
#获取所有向量id GET
rag_ids: http://36.103.199.248:8123/ids
rag_ids: http://127.0.0.1:8123/ids
#根据id获取文档 GET
rag_documents: http://36.103.199.248:8123/documents
rag_documents: http://127.0.0.1:8123/documents
#根据id删除文档 DEL
rag_documents_del: http://36.103.199.248:8123/documents
rag_documents_del: http://127.0.0.1:8123/documents
#根据file_id检索向量 POST
rag_query: http://36.103.199.248:8123/query
rag_query: http://127.0.0.1:8123/query
#支持多个文件id查询向量 GET
rag_query_multiple: http://36.103.199.248:8123/query_multiple
rag_query_multiple: http://127.0.0.1:8123/query_multiple
# 知识库向量嵌入
embed: http://36.103.199.248:8123/embed
embed: http://127.0.0.1:8123/embed
# 知识库查询
embed_query: http://36.103.199.248:8123/query
embed_query: http://127.0.0.1:8123/query
#### LLM train and service api 训练集、标注相关API
# 训练集列表 GET
@ -283,26 +283,28 @@ llm:
#################### 9000: 大模型管理、微调任务、文件上传和模型部署相关API。 ###################
# 大模型列表 GET
models_list: http://36.103.199.248:9000/api/models
models_list: http://127.0.0.1:9000/api/models
# 登录 POST
login: http://36.103.199.248:9000/api/auth/login
account: http://36.103.199.248:9000/api/auth/account
login: http://127.0.0.1:9000/api/auth/login
account: http://127.0.0.1:9000/api/auth/account
login_username: admin
login_password: admin
# 微调任务详情 GET
finetuning_detail: http://36.103.199.248:9000/api/finetuning
finetuning_detail: http://127.0.0.1:9000/api/finetuning
# 微调任务取消
finetuning_cancel: http://36.103.199.248:9000/api/finetuning/%s/cancel
finetuning_cancel: http://127.0.0.1:9000/api/finetuning/%s/cancel
# 微调文件列表 GET
finetuning_file_list: http://36.103.199.248:9000/api/files?purpose=fine-tune
finetuning_file_list: http://127.0.0.1:9000/api/files?purpose=fine-tune
# 模型部署
model_create: http://36.103.199.248:9000/api/models
model_create: http://127.0.0.1:9000/api/models
# aigc模型推理
aigc_model_completions: http://36.103.199.248:9000/api/channels/chat/completions
# 微调文件上传
aigc_model_completions: http://127.0.0.1:9000/api/channels/chat/completions
#################### 5123: 微调任务、模型部署、文件管理、提示词优化、自动评估、文生图等API。 ###################
aigc_file_upload: /api/files
# 创建微调任务 POST
# 微调文件上传
aigc_file_upload: /api/files
finetuning_create: /llm/finetuning
# 日志获取
finetuning_log: /llm/get_log
@ -330,9 +332,9 @@ llm:
#################### 30000: 大模型对话相关API。 ###################
#### 大模型对话
# 模型列表 GET
base_model_list: http://36.103.199.248:30000/model/v1/models
base_model_list: http://127.0.0.1:30000/model/v1/models
# 模型对话 POST
model_completions: http://36.103.199.248:30000/v1/chat/completions
model_completions: http://127.0.0.1:30000/v1/chat/completions
#################### 48080: 应用和管理服务相关API。 ###################
application_api: http://localhost:48080/admin-api/llm/application/api/apiKey/chat