Skip to contents

It is recommended to set modelfile to the content of the Modelfile rather than just set path.

Usage

create(
  name,
  modelfile = NULL,
  stream = FALSE,
  path = NULL,
  endpoint = "/api/create",
  host = NULL
)

Arguments

name

Name of the model to create.

modelfile

Contents of the Modelfile as character string. Default is NULL.

stream

Enable response streaming. Default is FALSE.

path

The path to the Modelfile. Default is NULL.

endpoint

The endpoint to create the model. Default is "/api/create".

host

The base URL to use. Default is NULL, which uses Ollama's default base URL.

Value

A response in the format specified in the output parameter.

References

API documentation

Examples

if (FALSE) { # test_connection()$status_code == 200
create("mario", "FROM llama3\nSYSTEM You are mario from Super Mario Bros.")
generate("mario", "who are you?", output = "text")  # model should say it's Mario
delete("mario")  # delete the model created above
}