Skip to content

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

add license layers to the parser (#116)

Patrick Devine572fc9099f74
diff --git a/parser/parser.go b/parser/parser.go
index 698128b65..5ba87c842 100644
--- a/parser/parser.go
+++ b/parser/parser.go
@@ -46,8 +46,8 @@ func Parse(reader io.Reader) ([]Command, error) {
return nil, fmt.Errorf("no model specified in FROM line")
}
foundModel = true
- case "PROMPT":
- command.Name = "prompt"
+ case "PROMPT", "LICENSE":
+ command.Name = strings.ToLower(fields[0])
if fields[1] == `"""` {
multiline = true
multilineCommand = &command
diff --git a/server/images.go b/server/images.go
index 3e461301e..387af3b49 100644
--- a/server/images.go
+++ b/server/images.go
@@ -215,6 +215,16 @@ func CreateModel(name string, mf io.Reader, fn func(status string)) error {
}
l.MediaType = "application/vnd.ollama.image.prompt"
layers = append(layers, l)
+ case "license":
+ fn("creating license layer")
+ license := strings.NewReader(c.Arg)
+ l, err := CreateLayer(license)
+ if err != nil {
+ fn(fmt.Sprintf("couldn't create license layer: %v", err))
+ return fmt.Errorf("failed to create layer: %v", err)
+ }
+ l.MediaType = "application/vnd.ollama.image.license"
+ layers = append(layers, l)
default:
params[c.Name] = c.Arg
}