feat: source-model routing disambiguation (source-model/:/ prefix); same-tier round-robin load balancing; public_base_url for copy config; fmtTok(B/M/K) unit scaling; status column reorder (reachability first); drop emoji from seed-warn modal; fix tests for first-run adapter seeding; install lua5.1 dev lib

This commit is contained in:
root
2026-08-10 12:55:22 +08:00
parent fe06e0861a
commit 41c9b0e14a
9 changed files with 128 additions and 22 deletions

View File

@ -15,6 +15,7 @@ import (
"net/url"
"strings"
"sync"
"sync/atomic"
"time"
"llmsproxy/internal/config"
@ -31,6 +32,7 @@ type Gateway struct {
stats *Stats
probeMu sync.Mutex
lastProbe time.Time
autoRR atomic.Uint64
}
func New(c *core.Core, gatewayKeys []string) (*Gateway, error) {
@ -355,12 +357,16 @@ func (g *Gateway) handleStatusAPI(w http.ResponseWriter, r *http.Request) {
if r.TLS != nil {
scheme = "https"
}
baseURL := g.core.PublicBaseURL()
if baseURL == "" {
baseURL = scheme + "://" + host + "/v1"
}
writeJSON(w, http.StatusOK, map[string]interface{}{
"default_model": g.core.DefaultModel(),
"models": g.core.Registry().ModelList(),
"sources": g.core.Registry().Status(),
"adapters": g.core.ListAdapters(),
"base_url": scheme + "://" + host + "/v1",
"base_url": baseURL,
"gateway_keys": ks,
})
}