fix: correct generator endpoint handling
This commit is contained in:
parent
37410d2dc8
commit
96eba3c71e
@ -90,7 +90,7 @@ models:
|
||||
provider: "ollama"
|
||||
models:
|
||||
- 'llama2:13b'
|
||||
endpoint: "http://127.0.0.1:11434/v1/chat/completions"
|
||||
endpoint: "http://127.0.0.1:11434"
|
||||
```
|
||||
|
||||
For online services using Chutes:
|
||||
@ -106,7 +106,7 @@ For online services using Chutes:
|
||||
# provider: "chutes"
|
||||
# models:
|
||||
# - 'moonshotai/Kimi-K2-Instruct'
|
||||
# endpoint: "https://llm.chutes.ai/v1/chat/completions"
|
||||
# endpoint: "https://llm.chutes.ai/v1"
|
||||
# token: "cpk_xxxx"
|
||||
```
|
||||
|
||||
|
||||
@ -20,11 +20,11 @@ sync:
|
||||
|
||||
provider:
|
||||
- name: ollama
|
||||
endpoint: http://localhost:11434/v1/chat/completions
|
||||
endpoint: http://localhost:11434
|
||||
models:
|
||||
- 'gpt-oss:20b'
|
||||
- name: chutes
|
||||
endpoint: https://llm.chutes.ai/v1/chat/completions
|
||||
endpoint: https://llm.chutes.ai/v1
|
||||
token: "cpk_xxxxxxxxxxxxxxxxxx"
|
||||
models:
|
||||
- 'moonshotai/Kimi-K2-Instruct'
|
||||
|
||||
@ -122,10 +122,14 @@ func loadConfig() (string, string, string, string, time.Duration, int) {
|
||||
}
|
||||
provider = strings.ToLower(provider)
|
||||
endpoint = strings.TrimRight(endpoint, "/")
|
||||
endpoint = strings.TrimSuffix(endpoint, "/chat/completions")
|
||||
endpoint = strings.TrimRight(endpoint, "/")
|
||||
switch provider {
|
||||
case "ollama":
|
||||
endpoint = strings.TrimSuffix(endpoint, "/v1")
|
||||
endpoint = strings.TrimRight(endpoint, "/")
|
||||
if endpoint == "" {
|
||||
endpoint = "http://localhost:11434/v1/chat/completions"
|
||||
endpoint = "http://localhost:11434"
|
||||
}
|
||||
if model == "" {
|
||||
model = "llama2:13b"
|
||||
@ -133,7 +137,7 @@ func loadConfig() (string, string, string, string, time.Duration, int) {
|
||||
return provider, token, model, endpoint, timeout, retries
|
||||
case "chutes":
|
||||
if endpoint == "" {
|
||||
endpoint = "https://llm.chutes.ai/v1/chat/completions"
|
||||
endpoint = "https://llm.chutes.ai/v1"
|
||||
}
|
||||
if model == "" {
|
||||
model = "deepseek-ai/DeepSeek-R1"
|
||||
@ -141,7 +145,7 @@ func loadConfig() (string, string, string, string, time.Duration, int) {
|
||||
return provider, token, model, endpoint, timeout, retries
|
||||
default:
|
||||
if endpoint == "" {
|
||||
endpoint = "https://llm.chutes.ai/v1/chat/completions"
|
||||
endpoint = "https://llm.chutes.ai/v1"
|
||||
}
|
||||
if model == "" {
|
||||
model = "deepseek-ai/DeepSeek-R1"
|
||||
|
||||
@ -29,7 +29,7 @@ models:
|
||||
provider: "ollama"
|
||||
models:
|
||||
- 'llama2:13b'
|
||||
endpoint: "http://127.0.0.1:11434/v1/chat/completions"
|
||||
endpoint: "http://127.0.0.1:11434"
|
||||
token: ""
|
||||
# For PROD
|
||||
#models:
|
||||
@ -42,7 +42,7 @@ models:
|
||||
#provider: "chutes"
|
||||
#models:
|
||||
# - 'moonshotai/Kimi-K2-Instruct'
|
||||
#endpoint: "https://llm.chutes.ai/v1/chat/completions"
|
||||
#endpoint: "https://llm.chutes.ai/v1"
|
||||
#token: "cpk_xxxx"
|
||||
|
||||
embedding:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user