Add LiteLLM default API base for model configs
This commit is contained in:
parent
69f581f54b
commit
b84bf02a7e
2 changed files with 8 additions and 0 deletions
|
|
@ -180,6 +180,8 @@ func getDefaultAPIBase(protocol string) string {
|
|||
return "https://api.openai.com/v1"
|
||||
case "openrouter":
|
||||
return "https://openrouter.ai/api/v1"
|
||||
case "litellm":
|
||||
return "http://localhost:4000/v1"
|
||||
case "groq":
|
||||
return "https://api.groq.com/openai/v1"
|
||||
case "zhipu":
|
||||
|
|
|
|||
|
|
@ -135,6 +135,12 @@ func TestCreateProviderFromConfig_DefaultAPIBase(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestGetDefaultAPIBase_LiteLLM(t *testing.T) {
|
||||
if got := getDefaultAPIBase("litellm"); got != "http://localhost:4000/v1" {
|
||||
t.Fatalf("getDefaultAPIBase(%q) = %q, want %q", "litellm", got, "http://localhost:4000/v1")
|
||||
}
|
||||
}
|
||||
|
||||
func TestCreateProviderFromConfig_LiteLLM(t *testing.T) {
|
||||
cfg := &config.ModelConfig{
|
||||
ModelName: "test-litellm",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue