class Ollama::Commands::Delete

delete = ollama.delete(model: ‘user/llama3.1’)
@example Deleting a local model
requests for model removal.
command structure and provides the necessary functionality to execute delete
removes a specified model from the local system. It inherits from the base
This class is used to interact with the Ollama API’s delete endpoint, which
A command class that represents the delete API endpoint for Ollama.

def self.path

Returns:
  • (String) - the API endpoint path '/api/delete' for delete requests
def self.path
  '/api/delete'
end

def initialize(model:)

Parameters:
  • model (String) -- the name of the model to be deleted
def initialize(model:)
  @model, @stream = model, false
end

def perform(handler)

Returns:
  • (self) - returns the current instance after initiating the request

Parameters:
  • handler (Ollama::Handler) -- the handler object responsible for processing API
def perform(handler)
  @client.request(method: :delete, path: self.class.path, body: to_json, stream:, handler:)
end