Feat: Support vLLM #4316 (#5395)

### What problem does this PR solve?
Feat: Support vLLM #4316

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2025-02-26 18:33:43 +08:00
committed by GitHub
parent fefea3a2a5
commit d9dd1171a3
9 changed files with 235 additions and 115 deletions

106
web/src/constants/llm.ts Normal file
View File

@ -0,0 +1,106 @@
export enum LLMFactory {
TongYiQianWen = 'Tongyi-Qianwen',
Moonshot = 'Moonshot',
OpenAI = 'OpenAI',
ZhipuAI = 'ZHIPU-AI',
WenXinYiYan = '文心一言',
Ollama = 'Ollama',
Xinference = 'Xinference',
ModelScope = 'ModelScope',
DeepSeek = 'DeepSeek',
VolcEngine = 'VolcEngine',
BaiChuan = 'BaiChuan',
Jina = 'Jina',
MiniMax = 'MiniMax',
Mistral = 'Mistral',
AzureOpenAI = 'Azure-OpenAI',
Bedrock = 'Bedrock',
Gemini = 'Gemini',
Groq = 'Groq',
OpenRouter = 'OpenRouter',
LocalAI = 'LocalAI',
StepFun = 'StepFun',
NVIDIA = 'NVIDIA',
LMStudio = 'LM-Studio',
OpenAiAPICompatible = 'OpenAI-API-Compatible',
Cohere = 'Cohere',
LeptonAI = 'LeptonAI',
TogetherAI = 'TogetherAI',
PerfXCloud = 'PerfXCloud',
Upstage = 'Upstage',
NovitaAI = 'novita.ai',
SILICONFLOW = 'SILICONFLOW',
PPIO = 'PPIO',
ZeroOneAI = '01.AI',
Replicate = 'Replicate',
TencentHunYuan = 'Tencent Hunyuan',
XunFeiSpark = 'XunFei Spark',
BaiduYiYan = 'BaiduYiyan',
FishAudio = 'Fish Audio',
TencentCloud = 'Tencent Cloud',
Anthropic = 'Anthropic',
VoyageAI = 'Voyage AI',
GoogleCloud = 'Google Cloud',
HuggingFace = 'HuggingFace',
YouDao = 'Youdao',
BAAI = 'BAAI',
NomicAI = 'nomic-ai',
JinaAI = 'jinaai',
SentenceTransformers = 'sentence-transformers',
GPUStack = 'GPUStack',
VLLM = 'VLLM',
}
// Please lowercase the file name
export const IconMap = {
[LLMFactory.TongYiQianWen]: 'tongyi',
[LLMFactory.Moonshot]: 'moonshot',
[LLMFactory.OpenAI]: 'openai',
[LLMFactory.ZhipuAI]: 'zhipu',
[LLMFactory.WenXinYiYan]: 'wenxin',
[LLMFactory.Ollama]: 'ollama',
[LLMFactory.Xinference]: 'xinference',
[LLMFactory.ModelScope]: 'modelscope',
[LLMFactory.DeepSeek]: 'deepseek',
[LLMFactory.VolcEngine]: 'volc_engine',
[LLMFactory.BaiChuan]: 'baichuan',
[LLMFactory.Jina]: 'jina',
[LLMFactory.MiniMax]: 'chat-minimax',
[LLMFactory.Mistral]: 'mistral',
[LLMFactory.AzureOpenAI]: 'azure',
[LLMFactory.Bedrock]: 'bedrock',
[LLMFactory.Gemini]: 'gemini',
[LLMFactory.Groq]: 'groq-next',
[LLMFactory.OpenRouter]: 'open-router',
[LLMFactory.LocalAI]: 'local-ai',
[LLMFactory.StepFun]: 'stepfun',
[LLMFactory.NVIDIA]: 'nvidia',
[LLMFactory.LMStudio]: 'lm-studio',
[LLMFactory.OpenAiAPICompatible]: 'openai-api',
[LLMFactory.Cohere]: 'cohere',
[LLMFactory.LeptonAI]: 'lepton-ai',
[LLMFactory.TogetherAI]: 'together-ai',
[LLMFactory.PerfXCloud]: 'perfx-cloud',
[LLMFactory.Upstage]: 'upstage',
[LLMFactory.NovitaAI]: 'novita-ai',
[LLMFactory.SILICONFLOW]: 'siliconflow',
[LLMFactory.PPIO]: 'ppio',
[LLMFactory.ZeroOneAI]: 'yi',
[LLMFactory.Replicate]: 'replicate',
[LLMFactory.TencentHunYuan]: 'hunyuan',
[LLMFactory.XunFeiSpark]: 'spark',
[LLMFactory.BaiduYiYan]: 'yiyan',
[LLMFactory.FishAudio]: 'fish-audio',
[LLMFactory.TencentCloud]: 'tencent-cloud',
[LLMFactory.Anthropic]: 'anthropic',
[LLMFactory.VoyageAI]: 'voyage',
[LLMFactory.GoogleCloud]: 'google-cloud',
[LLMFactory.HuggingFace]: 'huggingface',
[LLMFactory.YouDao]: 'youdao',
[LLMFactory.BAAI]: 'baai',
[LLMFactory.NomicAI]: 'nomic-ai',
[LLMFactory.JinaAI]: 'jina',
[LLMFactory.SentenceTransformers]: 'sentence-transformers',
[LLMFactory.GPUStack]: 'gpustack',
[LLMFactory.VLLM]: 'vllm',
};

View File

@ -24,59 +24,6 @@ export enum ProfileSettingRouteKey {
Logout = 'logout',
}
// Please lowercase the file name
export const IconMap = {
'Tongyi-Qianwen': 'tongyi',
Moonshot: 'moonshot',
OpenAI: 'openai',
'ZHIPU-AI': 'zhipu',
: 'wenxin',
Ollama: 'ollama',
Xinference: 'xinference',
ModelScope: 'modelscope',
DeepSeek: 'deepseek',
VolcEngine: 'volc_engine',
BaiChuan: 'baichuan',
Jina: 'jina',
MiniMax: 'chat-minimax',
Mistral: 'mistral',
'Azure-OpenAI': 'azure',
Bedrock: 'bedrock',
Gemini: 'gemini',
Groq: 'groq-next',
OpenRouter: 'open-router',
LocalAI: 'local-ai',
StepFun: 'stepfun',
NVIDIA: 'nvidia',
'LM-Studio': 'lm-studio',
'OpenAI-API-Compatible': 'openai-api',
Cohere: 'cohere',
LeptonAI: 'lepton-ai',
TogetherAI: 'together-ai',
PerfXCloud: 'perfx-cloud',
Upstage: 'upstage',
'novita.ai': 'novita-ai',
SILICONFLOW: 'siliconflow',
PPIO: 'ppio',
'01.AI': 'yi',
Replicate: 'replicate',
'Tencent Hunyuan': 'hunyuan',
'XunFei Spark': 'spark',
BaiduYiyan: 'yiyan',
'Fish Audio': 'fish-audio',
'Tencent Cloud': 'tencent-cloud',
Anthropic: 'anthropic',
'Voyage AI': 'voyage',
'Google Cloud': 'google-cloud',
HuggingFace: 'huggingface',
Youdao: 'youdao',
BAAI: 'baai',
'nomic-ai': 'nomic-ai',
jinaai: 'jina',
'sentence-transformers': 'sentence-transformers',
GPUStack: 'gpustack',
};
export const TimezoneList = [
'UTC-11\tPacific/Midway',
'UTC-11\tPacific/Niue',