diff --git a/pkg/server/handlers_backends.go b/pkg/server/handlers_backends.go index 74cd0bd..9ff20b5 100644 --- a/pkg/server/handlers_backends.go +++ b/pkg/server/handlers_backends.go @@ -88,9 +88,11 @@ func (h *Handler) LlamaCppProxy(onDemandStart bool) http.HandlerFunc { return } - // Strip the "/llama-cpp/" prefix from the request URL - prefix := fmt.Sprintf("/llama-cpp/%s", validatedName) - r.URL.Path = strings.TrimPrefix(r.URL.Path, prefix) + if !inst.IsRemote() { + // Strip the "/llama-cpp/" prefix from the request URL + prefix := fmt.Sprintf("/llama-cpp/%s", validatedName) + r.URL.Path = strings.TrimPrefix(r.URL.Path, prefix) + } // Update the last request time for the instance inst.UpdateLastRequestTime()