The guardrails' judge has its own command, and its trouble is shown
llmgw ctl guard judge status lists each judge model the policies ask: in the catalog, as a judge, replicas ready, its last failure to answer, and what is wrong in words. enable serves the missing one through model serve - Llama Guard 3 1B on CPUs, role guard, under the name the policies give it - with --replace for a model of that name that is not a judge; the console has it under Do. GET /api/v1/guard/judges, and the summary's judges, put the problem on ctl status and the console's Overview. A Llama Guard file served from the mirror page is added as a judge, under the name the policies ask, rather than as a model clients use the policies never find. ctl says plainly when the API answers with a page. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
2a942409ea
commit
a8bb417618
24 files changed
+667
-13
No files matched your search
@@ -585,3 +585,36 @@ func argInt(args []string, flag string) int {
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// isJudgeWeights is whether a source is a guard model's weights: Llama
|
||||
// Guard, which reads a conversation and says whether it is safe.
|
||||
func isJudgeWeights(source string) bool {
|
||||
return strings.Contains(strings.ToLower(source), "llama-guard")
|
||||
}
|
||||
|
||||
// asJudge makes a model built from the serve form a judge when its weights
|
||||
// are one's: role guard, Llama Guard's format, under the name the policies
|
||||
// give their judge when they give one and the form gave another. It says
|
||||
// whether it did, and the name the form gave when it was changed.
|
||||
func (p *AccountPages) asJudge(m *catalog.Model) (judge bool, renamed string) {
|
||||
if !isJudgeWeights(m.Source) {
|
||||
return false, ""
|
||||
}
|
||||
m.Role, m.Guard, m.RoutingProfile = catalog.RoleGuard, &catalog.GuardModel{Format: "llamaguard3"}, ""
|
||||
if p.guardLibrary == nil {
|
||||
return true, ""
|
||||
}
|
||||
asked := map[string]bool{}
|
||||
for _, pol := range p.guardLibrary().Policies {
|
||||
if pol.Judge != nil && pol.Judge.Model != "" {
|
||||
asked[pol.Judge.Model] = true
|
||||
}
|
||||
}
|
||||
if asked[m.Name] || len(asked) != 1 {
|
||||
return true, ""
|
||||
}
|
||||
for name := range asked {
|
||||
renamed, m.Name = m.Name, name
|
||||
}
|
||||
return true, renamed
|
||||
}
|
||||
Reference in new issue
Block a user