diff --git a/cmd/membench/llm_client.go b/cmd/membench/llm_client.go index bb0ff54c4..d32de057d 100644 --- a/cmd/membench/llm_client.go +++ b/cmd/membench/llm_client.go @@ -91,10 +91,7 @@ func (c *LLMClient) Complete(ctx context.Context, systemPrompt, userPrompt strin return "", fmt.Errorf("marshal request: %w", err) } - endpoint := c.BaseURL + "/v1/chat/completions" - if strings.HasSuffix(c.BaseURL, "/v1") || strings.HasSuffix(c.BaseURL, "/v1/") { - endpoint = strings.TrimRight(c.BaseURL, "/") + "/chat/completions" - } + endpoint := strings.TrimRight(c.BaseURL, "/") + "/chat/completions" req, err := http.NewRequestWithContext(ctx, "POST", endpoint, bytes.NewReader(jsonBody)) if err != nil { return "", fmt.Errorf("create request: %w", err) diff --git a/cmd/membench/main.go b/cmd/membench/main.go index 7591713a7..340924e46 100644 --- a/cmd/membench/main.go +++ b/cmd/membench/main.go @@ -289,13 +289,13 @@ func envOrFlag(flag, envKey string) string { // // Environment variables: // -// MEMBENCH_API_BASE – OpenAI-compatible base URL (default http://127.0.0.1:8080) +// MEMBENCH_API_BASE – OpenAI-compatible base URL (default http://127.0.0.1:8080/v1) // MEMBENCH_API_KEY – Bearer token for the endpoint // MEMBENCH_MODEL – Model name to send in the request func buildLLMOptions() (LLMClientOptions, error) { base := envOrFlag(flagAPIBase, "MEMBENCH_API_BASE") if base == "" { - base = "http://127.0.0.1:8080" + base = "http://127.0.0.1:8080/v1" } model := envOrFlag(flagModel, "MEMBENCH_MODEL") if model == "" {