feat: 兼容OpenAI格式的模型服务代理

This commit is contained in:
martsforever
2026-04-04 20:29:33 +08:00
parent ef945adc8c
commit d94d880f6f
3 changed files with 71 additions and 37 deletions
+5 -37
View File
@@ -2,11 +2,6 @@ from app.config.env import env
ai_configs = {
# /*---------------------------------------local-------------------------------------------*/
"local": {
"model": "deepseek-r1-distill-qwen-7b",
"url": "http://127.0.0.1:1234/v1/chat/completions",
"key": env.llm_key_local
},
"local_glm": {
"model": "glm-4-9b-0414",
"url": "http://127.0.0.1:1234/v1/chat/completions",
@@ -17,38 +12,12 @@ ai_configs = {
"url": "http://127.0.0.1:1234/v1/embeddings",
"key": env.llm_key_local
},
# /*---------------------------------------deepseek-------------------------------------------*/
'deepseek-v3': {
'model': 'deepseek-chat',
'url': 'https://api.deepseek.com/chat/completions',
'key': env.llm_key_deepseek,
},
'deepseek-r1': {
'model': 'deepseek-reasoner',
'url': 'https://api.deepseek.com/chat/completions',
'key': env.llm_key_deepseek,
},
# /*---------------------------------------huoshan-------------------------------------------*/
'huoshan-deepseek-v3': {
'model': 'deepseek-v3-250324',
'url': 'https://ark.cn-beijing.volces.com/api/v3/chat/completions',
'key': env.llm_key_huoshan,
},
'huoshan-deepseek-r1': {
'model': 'deepseek-r1-distill-qwen-7b-250120',
'url': 'https://ark.cn-beijing.volces.com/api/v3/chat/completions',
'key': env.llm_key_huoshan,
},
'huoshan-doubao': {
'model': 'doubao-1-5-lite-32k-250115',
'url': 'https://ark.cn-beijing.volces.com/api/v3/chat/completions',
'key': env.llm_key_huoshan,
},
'huoshan-think-pro': {
'model': 'doubao-1-5-thinking-pro-250415',
'url': 'https://ark.cn-beijing.volces.com/api/v3/chat/completions',
'key': env.llm_key_huoshan,
},
'huoshan-doubao-seed': {
'model': 'doubao-seed-1-6-250615',
'url': 'https://ark.cn-beijing.volces.com/api/v3/chat/completions',
@@ -59,12 +28,6 @@ ai_configs = {
'url': 'https://ark.cn-beijing.volces.com/api/v3/chat/completions',
'key': env.llm_key_huoshan,
},
'huoshan-embedding-240715': {
"model": 'doubao-embedding-text-240715',
"url": 'https://ark.cn-beijing.volces.com/api/v3/embeddings',
'key': env.llm_key_huoshan,
},
# /*---------------------------------------bailian-------------------------------------------*/
'bailian-qwen-turbo': {
'model': 'qwen-turbo',
@@ -76,6 +39,11 @@ ai_configs = {
'url': 'https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions',
'key': env.llm_key_bailian,
},
'bailian-qwen3.6-plus': {
'model': 'qwen3.6-plus',
'url': 'https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions',
'key': env.llm_key_bailian,
},
'bailian-embedding': {
'model': 'text-embedding-v4',
'url': 'https://dashscope.aliyuncs.com/compatible-mode/v1/embeddings',