Class ModelService
Inheritance
object
ModelService
Assembly: .dll
Syntax
public class ModelService : CRUDServiceBase<Ollama>
Constructors
ModelService(Ollama)
Declaration
public ModelService(Ollama client)
Parameters
Type |
Name |
Description |
Ollama |
client |
|
Methods
CopyModelAsync(CopyModelRequest)
Declaration
public UniTask CopyModelAsync(CopyModelRequest req)
Parameters
Returns
CreateModelAsync(CreateModelRequest, ChatStreamHandler)
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.
Declaration
public UniTask CreateModelAsync(CreateModelRequest req, ChatStreamHandler streamHandler)
Parameters
Returns
Type |
Description |
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)
Declaration
public UniTask<bool> DeleteModelAsync(DeleteModelRequest req)
Parameters
Returns
Type |
Description |
UniTask<bool> |
|
ListLocalModelsAsync()
List models that are available locally.
Declaration
public UniTask<ListModelsResponse> ListLocalModelsAsync()
Returns
ListRunningModelsAsync()
List models that are currently loaded into memory.
Declaration
public UniTask<ListModelsResponse> ListRunningModelsAsync()
Returns
PullModelAsync(PushPullModelRequest)
Declaration
public UniTask PullModelAsync(PushPullModelRequest req)
Parameters
Returns
PushModelAsync(PushPullModelRequest)
Declaration
public UniTask PushModelAsync(PushPullModelRequest req)
Parameters
Returns