add Volcengine LLM (doubao) support
This commit is contained in:
parent
920e30a241
commit
2f24be6c59
3 changed files with 24 additions and 0 deletions
|
|
@ -113,6 +113,10 @@
|
||||||
"ollama": {
|
"ollama": {
|
||||||
"api_key": "",
|
"api_key": "",
|
||||||
"api_base": "http://localhost:11434/v1"
|
"api_base": "http://localhost:11434/v1"
|
||||||
|
},
|
||||||
|
"volcengine": {
|
||||||
|
"api_key": "",
|
||||||
|
"api_base": ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"tools": {
|
"tools": {
|
||||||
|
|
|
||||||
|
|
@ -179,6 +179,7 @@ type ProvidersConfig struct {
|
||||||
Moonshot ProviderConfig `json:"moonshot"`
|
Moonshot ProviderConfig `json:"moonshot"`
|
||||||
ShengSuanYun ProviderConfig `json:"shengsuanyun"`
|
ShengSuanYun ProviderConfig `json:"shengsuanyun"`
|
||||||
DeepSeek ProviderConfig `json:"deepseek"`
|
DeepSeek ProviderConfig `json:"deepseek"`
|
||||||
|
VolcEngine ProviderConfig `json:"volcengine"`
|
||||||
GitHubCopilot ProviderConfig `json:"github_copilot"`
|
GitHubCopilot ProviderConfig `json:"github_copilot"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -317,6 +318,7 @@ func DefaultConfig() *Config {
|
||||||
Nvidia: ProviderConfig{},
|
Nvidia: ProviderConfig{},
|
||||||
Moonshot: ProviderConfig{},
|
Moonshot: ProviderConfig{},
|
||||||
ShengSuanYun: ProviderConfig{},
|
ShengSuanYun: ProviderConfig{},
|
||||||
|
VolcEngine: ProviderConfig{},
|
||||||
},
|
},
|
||||||
Gateway: GatewayConfig{
|
Gateway: GatewayConfig{
|
||||||
Host: "0.0.0.0",
|
Host: "0.0.0.0",
|
||||||
|
|
|
||||||
|
|
@ -332,6 +332,15 @@ func CreateProvider(cfg *config.Config) (LLMProvider, error) {
|
||||||
}
|
}
|
||||||
return NewGitHubCopilotProvider(apiBase, cfg.Providers.GitHubCopilot.ConnectMode, model)
|
return NewGitHubCopilotProvider(apiBase, cfg.Providers.GitHubCopilot.ConnectMode, model)
|
||||||
|
|
||||||
|
case "volcengine", "doubao":
|
||||||
|
if cfg.Providers.VolcEngine.APIKey != "" {
|
||||||
|
apiKey = cfg.Providers.VolcEngine.APIKey
|
||||||
|
apiBase = cfg.Providers.VolcEngine.APIBase
|
||||||
|
if apiBase == "" {
|
||||||
|
apiBase = "https://ark.cn-beijing.volces.com/api/v3"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -418,6 +427,15 @@ func CreateProvider(cfg *config.Config) (LLMProvider, error) {
|
||||||
apiBase = "http://localhost:11434/v1"
|
apiBase = "http://localhost:11434/v1"
|
||||||
}
|
}
|
||||||
fmt.Println("Ollama apiBase:", apiBase)
|
fmt.Println("Ollama apiBase:", apiBase)
|
||||||
|
|
||||||
|
case (strings.Contains(lowerModel, "doubao") || strings.HasPrefix(model, "doubao") || strings.Contains(lowerModel, "volcengine")) && cfg.Providers.VolcEngine.APIKey != "":
|
||||||
|
apiKey = cfg.Providers.VolcEngine.APIKey
|
||||||
|
apiBase = cfg.Providers.VolcEngine.APIBase
|
||||||
|
proxy = cfg.Providers.VolcEngine.Proxy
|
||||||
|
if apiBase == "" {
|
||||||
|
apiBase = "https://ark.cn-beijing.volces.com/api/v3"
|
||||||
|
}
|
||||||
|
|
||||||
case cfg.Providers.VLLM.APIBase != "":
|
case cfg.Providers.VLLM.APIBase != "":
|
||||||
apiKey = cfg.Providers.VLLM.APIKey
|
apiKey = cfg.Providers.VLLM.APIKey
|
||||||
apiBase = cfg.Providers.VLLM.APIBase
|
apiBase = cfg.Providers.VLLM.APIBase
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue