Table of Contents

Class ModelService

public class ModelService : CrudServiceBase<OllamaClient>
Inheritance
object
ModelService

Constructors

ModelService(OllamaClient)

public ModelService(OllamaClient client)

Parameters

client OllamaClient

Methods

CopyModelAsync(CopyModelRequest, RESTOptions)

public UniTask CopyModelAsync(CopyModelRequest req, RESTOptions options = null)

Parameters

req CopyModelRequest
options RESTOptions

Returns

UniTask

CreateModelAsync(CreateModelRequest, RESTOptions)

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.

public UniTask CreateModelAsync(CreateModelRequest req, RESTOptions options = null)

Parameters

req CreateModelRequest
options RESTOptions

Returns

UniTask

A stream of JSON objects is returned: {"status":"reading model metadata"} {"status":"creating system layer"} {"status":"using already created layer sha256:22f7f8ef5f4c791c1b03d7eb414399294764d7cc82c7e94aa81a1feb80a983a2"} {"status":"using already created layer sha256:8c17c2ebb0ea011be9981cc3922db8ca8fa61e828c5d3f44cb6ae342bf80460b"} {"status":"using already created layer sha256:7c23fb36d80141c4ab8cdbb61ee4790102ebd2bf7aeff414453177d4f2110e5d"} {"status":"using already created layer sha256:2e0493f67d0c8c9c68a8aeacdf6a38a2151cb3c4c1d42accf296e19810527988"} {"status":"using already created layer sha256:2759286baa875dc22de5394b4a925701b1896a7e3f8e53275c36f75a877a82c9"} {"status":"writing layer sha256:df30045fe90f0d750db82a058109cecd6d4de9c90a3d75b19c09e5f64580bb42"} {"status":"writing layer sha256:f18a68eb09bf925bb1b669490407c1b1251c5db98dc4d3d81f3088498ea55690"} {"status":"writing manifest"} {"status":"success"}

DeleteModelAsync(DeleteModelRequest, RESTOptions)

public UniTask<DeletionStatus> DeleteModelAsync(DeleteModelRequest req, RESTOptions options = null)

Parameters

req DeleteModelRequest
options RESTOptions

Returns

UniTask<DeletionStatus>

ListLocalModelsAsync(RESTOptions)

List models that are available locally.

public UniTask<ListModelsResponse> ListLocalModelsAsync(RESTOptions options = null)

Parameters

options RESTOptions

Returns

UniTask<ListModelsResponse>

ListRunningModelsAsync(RESTOptions)

List models that are currently loaded into memory.

public UniTask<ListModelsResponse> ListRunningModelsAsync(RESTOptions options = null)

Parameters

options RESTOptions

Returns

UniTask<ListModelsResponse>

PullModelAsync(PushPullModelRequest, RESTOptions)

public UniTask PullModelAsync(PushPullModelRequest req, RESTOptions options = null)

Parameters

req PushPullModelRequest
options RESTOptions

Returns

UniTask

PushModelAsync(PushPullModelRequest, RESTOptions)

public UniTask PushModelAsync(PushPullModelRequest req, RESTOptions options = null)

Parameters

req PushPullModelRequest
options RESTOptions

Returns

UniTask