Ollama API
  1. Create a Model
Ollama API
  • Endpoints
  • Conventions
  • Generate a completion
    • Overview
    • Generate request (Streaming)
      POST
    • Request (No streaming)
      POST
    • Request (with suffix)
      POST
    • Request (Structured outputs)
      POST
    • Request (JSON mode)
      POST
    • Request (with images)
      POST
    • Request (Raw Mode)
      POST
    • Request (Reproducible outputs)
      POST
    • Generate request (With options)
      POST
    • Load a model
      POST
    • Unload a model
      POST
  • Generate a chat completion
    • Overview
    • Chat Request (Streaming)
      POST
    • Chat request (No streaming)
      POST
    • Chat request (Structured outputs)
      POST
    • Chat request (With History)
      POST
    • Chat request (with images)
      POST
    • Chat request (Reproducible outputs)
      POST
    • Chat request (with tools)
      POST
    • Load a model
      POST
    • Unload a model
      POST
  • Create a Model
    • Overview
    • Create a new model
      POST
    • Quantize a model
      POST
    • Create a model from GGUF
      POST
    • Create a model from a Safetensors directory
      POST
  • Check if a Blob Exists
    • Overview
  • Push a Blob
    • Overview
  • List Local Models
    • Overview
    • Examples
  • Show Model Information
    • Overview
    • Examples
  • Copy a Model
    • Overview
    • Examples
  • Delete a Model
    • Overview
    • Examples
  • Pull a Model
    • Overview
    • Examples
  • Push a Model
    • Overview
  • Generate Embeddings
    • Overview
    • Examples
    • Request (Multiple input)
  • List Running Models
    • Overview
    • Examples
  • Generate Embedding
    • Overview
    • Examples
  • Version
    • Overview
  1. Create a Model

Overview

POST /api/create
Create a model from:
another model;
a safetensors directory; or
a GGUF file.
If you are creating a model from a safetensors directory or from a GGUF file, you must create a blob for each of the files and then use the file name and SHA256 digest associated with each blob in the files field.

Parameters#

model: name of the model to create
from: (optional) name of an existing model to create the new model from
files: (optional) a dictionary of file names to SHA256 digests of blobs to create the model from
adapters: (optional) a dictionary of file names to SHA256 digests of blobs for LORA adapters
template: (optional) the prompt template for the model
license: (optional) a string or list of strings containing the license or licenses for the model
system: (optional) a string containing the system prompt for the model
parameters: (optional) a dictionary of parameters for the model (see Modelfile for a list of parameters)
messages: (optional) a list of message objects used to create a conversation
stream: (optional) if false the response will be returned as a single response object, rather than a stream of objects
quantize (optional): quantize a non-quantized (e.g. float16) model

Quantization types#

TypeRecommended
q2_K
q3_K_L
q3_K_M
q3_K_S
q4_0
q4_1
q4_K_M*
q4_K_S
q5_0
q5_1
q5_K_M
q5_K_S
q6_K
q8_0*
Previous
Unload a model
Next
Create a new model
Built with