class Ollama::Commands::Ps
ps.models # => array of running model information
ps = ollama.ps
@example Retrieving information about running models
for monitoring active model processes.
structure and provides the necessary functionality to execute ps requests
retrieves information about running models. It inherits from the base command
This class is used to interact with the Ollama API’s ps endpoint, which
A command class that represents the ps API endpoint for Ollama.
def self.path
-
(String)- the API endpoint path '/api/ps' for ps requests
def self.path '/api/ps' end
def initialize(**parameters)
-
(ArgumentError)- if any parameters are provided (ps endpoint
Parameters:
-
parameters(Hash) -- a hash containing initialization parameters
def initialize(**parameters) parameters.empty? or raise ArgumentError, "Invalid parameters: #{parameters.keys * ' '}" @stream = false end
def perform(handler)
-
(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: :get, path: self.class.path, stream:, handler:) end