aca63d7526
Support ingress-facing model aliases with upstream rewrite, category-aware health checks, provider name validation, modal click-outside guard, and dropdown-based routing rule targets. Co-authored-by: Cursor <cursoragent@cursor.com>
21 lines
487 B
Go
21 lines
487 B
Go
package model
|
|
|
|
// IngressID returns the model name exposed to ingress API clients.
|
|
func (m ModelEntry) IngressID() string {
|
|
if m.Alias != "" {
|
|
return m.Alias
|
|
}
|
|
return m.ModelID
|
|
}
|
|
|
|
// MatchesIngressName reports whether the entry matches an ingress model identifier.
|
|
func (m ModelEntry) MatchesIngressName(name string) bool {
|
|
if name == "" || !m.Enabled {
|
|
return false
|
|
}
|
|
if m.ModelID == name || m.VersionHash == name {
|
|
return true
|
|
}
|
|
return m.Alias != "" && m.Alias == name
|
|
}
|