feat: 新增模型轮转、额度看板和密钥管理

This commit is contained in:
haverainlilili committed 2026-09-21 10:18:21 +08:00
1 parent e5f4e3a583
commit 3440273f43
32 files changed
+2918 -32

No files matched your search

+2 -2
View File
@@ -115,11 +115,11 @@ func (a *Server) handleDebugInference(w http.ResponseWriter, r *http.Request) {
return
}
cfg := a.manager.Config()
if len(cfg.ServerKeys) == 0 {
if cfg.FirstEnabledServerKey() == "" {
writeAdminError(w, http.StatusServiceUnavailable, "debug_unavailable", "no local server key is configured")
return
}
request.Header.Set("Authorization", "Bearer "+cfg.ServerKeys[0])
request.Header.Set("Authorization", "Bearer "+cfg.FirstEnabledServerKey())
if selectedKey != nil {
request = request.WithContext(gateway.WithDebugKeyOverride(request.Context(), gateway.DebugKeyOverride{Tier: selectedKey.Tier, KeyID: selectedKey.ID}))
}