Skip to content

Get up and running with Kimi, GLM, MiniMax, DeepSeek, gpt-oss, Qwen, Gemma and other models.

added IsValidNamespace function

Josh Yan298c996e54c4
diff --git a/types/model/name.go b/types/model/name.go
index f32b25969..2739b53c7 100644
--- a/types/model/name.go
+++ b/types/model/name.go
@@ -251,6 +251,16 @@ func (n Name) DisplayShortest() string {
return sb.String()
}
+func IsValidNamespace(namespace string) bool {
+ name := Name{
+ Host: "h",
+ Model: "m",
+ Namespace: namespace,
+ Tag: "t",
+ }
+ return name.IsValid()
+}
+
// IsValid reports whether all parts of the name are present and valid. The
// digest is a special case, and is checked for validity only if present.
func (n Name) IsValid() bool {