Get up and running with Kimi, GLM, MiniMax, DeepSeek, gpt-oss, Qwen, Gemma and other models.
strip scheme from name
Michael Yang88775e1ff9d3
diff --git a/types/model/name.go b/types/model/name.goindex fd4fbfc4e..cb890b3a4 100644--- a/types/model/name.go+++ b/types/model/name.go@@ -153,12 +153,18 @@ func ParseNameBare(s string) Name {n.Model = sreturn n}+s, n.Namespace, promised = cutPromised(s, "/")if !promised {n.Namespace = sreturn n}- n.Host = s++ scheme, host, ok := strings.Cut(s, "://")+ if ! ok {+ host = scheme+ }+ n.Host = hostreturn n}diff --git a/types/model/name_test.go b/types/model/name_test.goindex 2f99c5b1b..997513b81 100644--- a/types/model/name_test.go+++ b/types/model/name_test.go@@ -17,6 +17,15 @@ func TestParseNameParts(t *testing.T) {want NamewantValidDigest bool}{+ {+ in: "scheme://host:port/namespace/model:tag",+ want: Name{+ Host: "host:port",+ Namespace: "namespace",+ Model: "model",+ Tag: "tag",+ },+ },{in: "host/namespace/model:tag",want: Name{@@ -26,6 +35,15 @@ func TestParseNameParts(t *testing.T) {Tag: "tag",},},+ {+ in: "host:port/namespace/model:tag",+ want: Name{+ Host: "host:port",+ Namespace: "namespace",+ Model: "model",+ Tag: "tag",+ },+ },{in: "host/namespace/model",want: Name{@@ -35,9 +53,9 @@ func TestParseNameParts(t *testing.T) {},},{- in: "host:12345/namespace/model",+ in: "host:port/namespace/model",want: Name{- Host: "host:12345",+ Host: "host:port",Namespace: "namespace",Model: "model",},