Manage Models
You can manage models via the Ollama API. This includes creating new models, pulling models, copying, pushing, and deleting.
Create a Model
var api = new OllamaClient("http://localhost:11434");
await api.CreateModelAsync(new CreateModelRequest
{
Name = "my-model",
Modelfile = "my-model.gguf"
});
Pull a Model
await api.PullModelAsync(new PullModelRequest
{
Name = "llama3"
});
Copy a Model
await api.CopyModelAsync(new CopyModelRequest
{
Source = "llama3",
Destination = "llama3-copy"
});
Push a Model
await api.PushModelAsync(new PushModelRequest
{
Name = "my-model"
});
Delete a Model
await api.DeleteModelAsync(new DeleteModelRequest
{
Name = "my-model"
});