mirror of
https://github.com/alibaba/higress.git
synced 2026-06-09 20:57:32 +08:00
Feat/vllm provider (#3067)
This commit is contained in:
@@ -135,6 +135,7 @@ const (
|
||||
providerTypeOpenRouter = "openrouter"
|
||||
providerTypeLongcat = "longcat"
|
||||
providerTypeFireworks = "fireworks"
|
||||
providerTypeVllm = "vllm"
|
||||
|
||||
protocolOpenAI = "openai"
|
||||
protocolOriginal = "original"
|
||||
@@ -217,6 +218,7 @@ var (
|
||||
providerTypeOpenRouter: &openrouterProviderInitializer{},
|
||||
providerTypeLongcat: &longcatProviderInitializer{},
|
||||
providerTypeFireworks: &fireworksProviderInitializer{},
|
||||
providerTypeVllm: &vllmProviderInitializer{},
|
||||
}
|
||||
)
|
||||
|
||||
@@ -408,6 +410,12 @@ type ProviderConfig struct {
|
||||
// @Title zh-CN Triton Server 部署的 Domain
|
||||
// @Description 仅适用于 NVIDIA Triton Interference Server :path 中的 modelVersion 参考:"https://docs.nvidia.com/deeplearning/triton-inference-server/user-guide/docs/protocol/extension_generate.html"
|
||||
tritonDomain string `required:"false" yaml:"tritonDomain" json:"tritonDomain"`
|
||||
// @Title zh-CN vLLM自定义后端URL
|
||||
// @Description zh-CN 仅适用于vLLM服务。vLLM服务的完整URL,包含协议、域名、端口等
|
||||
vllmCustomUrl string `required:"false" yaml:"vllmCustomUrl" json:"vllmCustomUrl"`
|
||||
// @Title zh-CN vLLM主机地址
|
||||
// @Description zh-CN 仅适用于vLLM服务,指定vLLM服务器的主机地址,例如:vllm-service.cluster.local
|
||||
vllmServerHost string `required:"false" yaml:"vllmServerHost" json:"vllmServerHost"`
|
||||
}
|
||||
|
||||
func (c *ProviderConfig) GetId() string {
|
||||
@@ -422,6 +430,14 @@ func (c *ProviderConfig) GetProtocol() string {
|
||||
return c.protocol
|
||||
}
|
||||
|
||||
func (c *ProviderConfig) GetVllmCustomUrl() string {
|
||||
return c.vllmCustomUrl
|
||||
}
|
||||
|
||||
func (c *ProviderConfig) GetVllmServerHost() string {
|
||||
return c.vllmServerHost
|
||||
}
|
||||
|
||||
func (c *ProviderConfig) IsOpenAIProtocol() bool {
|
||||
return c.protocol == protocolOpenAI
|
||||
}
|
||||
@@ -591,6 +607,8 @@ func (c *ProviderConfig) FromJson(json gjson.Result) {
|
||||
if c.basePath != "" && c.basePathHandling == "" {
|
||||
c.basePathHandling = basePathHandlingRemovePrefix
|
||||
}
|
||||
c.vllmServerHost = json.Get("vllmServerHost").String()
|
||||
c.vllmCustomUrl = json.Get("vllmCustomUrl").String()
|
||||
}
|
||||
|
||||
func (c *ProviderConfig) Validate() error {
|
||||
|
||||
Reference in New Issue
Block a user