Initial commit: Luminary AI Gateway
CI / docker (push) Successful in 2m4s

OpenAI-compatible AI gateway with Vue admin UI, multi-provider egress,
ingress key governance, monitoring, and security controls.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
renjue
2026-06-23 21:46:16 +08:00
commit 76ba500417
134 changed files with 18988 additions and 0 deletions
+51
View File
@@ -0,0 +1,51 @@
package admin
import (
"strings"
)
func (h *Handler) providerNameTaken(name string, excludeID uint) bool {
name = strings.TrimSpace(name)
if name == "" {
return false
}
for _, p := range h.cache.ListProviders() {
if p.ID != excludeID && p.Name == name {
return true
}
}
return false
}
func (h *Handler) modelAliasTaken(alias string, excludeModelID uint) bool {
alias = strings.TrimSpace(alias)
if alias == "" {
return false
}
for _, p := range h.cache.ListProviders() {
for _, m := range h.cache.GetModels(p.ID) {
if m.ID == excludeModelID {
continue
}
if m.Alias == alias {
return true
}
}
}
return false
}
func normalizeAlias(alias string) string {
return strings.TrimSpace(alias)
}
func validateModelAlias(h *Handler, alias string, excludeModelID uint) string {
alias = normalizeAlias(alias)
if alias == "" {
return ""
}
if h.modelAliasTaken(alias, excludeModelID) {
return "model alias already exists"
}
return ""
}