Files
ollama4j/docs/docs/apis-model-management/create-model.md

11 KiB

sidebar_position
sidebar_position
5

Create Model

This API lets you create a custom model on the Ollama server.

Create a custom model from an existing model in the Ollama server

import io.github.ollama4j.OllamaAPI;

public class CreateModel {

    public static void main(String[] args) {

        String host = "http://localhost:11434/";

        OllamaAPI ollamaAPI = new OllamaAPI(host);

        ollamaAPI.createModel(CustomModelRequest.builder().model("mario").from("llama3.2:latest").system("You are Mario from Super Mario Bros.").build());
    }
}

Once created, you can see it when you use list models API.

Read more about custom model creation and the parameters available for model creation.