Skip to content
This repository was archived by the owner on Sep 18, 2025. It is now read-only.

Commit c03817c

Browse files
committed
small fixes
1 parent db179e7 commit c03817c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

internal/llm/models/local.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package models
22

33
import (
44
"cmp"
5+
"context"
56
"encoding/json"
67
"net/http"
78
"net/url"
@@ -53,7 +54,6 @@ func init() {
5354
loadLocalModels(models)
5455

5556
viper.SetDefault("providers.local.apiKey", "dummy")
56-
ProviderPopularity[ProviderLocal] = 0
5757
}
5858
}
5959

@@ -75,7 +75,7 @@ type localModel struct {
7575
}
7676

7777
func listLocalModels(modelsEndpoint string) []localModel {
78-
res, err := http.Get(modelsEndpoint)
78+
res, err := http.NewRequestWithContext(context.Background(), http.MethodGet, modelsEndpoint, nil)
7979
if err != nil {
8080
logging.Debug("Failed to list local models",
8181
"error", err,
@@ -84,9 +84,9 @@ func listLocalModels(modelsEndpoint string) []localModel {
8484
}
8585
defer res.Body.Close()
8686

87-
if res.StatusCode != http.StatusOK {
87+
if res.Response.StatusCode != http.StatusOK {
8888
logging.Debug("Failed to list local models",
89-
"status", res.StatusCode,
89+
"status", res.Response.Status,
9090
"endpoint", modelsEndpoint,
9191
)
9292
}

0 commit comments

Comments
 (0)