Apps API

KonfAI Apps package stable workflows behind a simpler interface than the raw TRAIN / PREDICTION / EVALUATION commands.

Local and remote app runners

Remote server helpers

class konfai.RemoteServer(host, port, token)[source]

Bases: object

Connection settings for a remote KonfAI Apps server.

get_headers()[source]

Return the HTTP headers required to talk to the remote server.

Return type:

dict[str, str]

get_url()[source]

Return the base URL of the remote server.

Return type:

str

konfai.check_server(remote_server, timeout_s=2.0)[source]

Check whether a remote KonfAI Apps server is reachable and healthy.

Parameters:
  • remote_server (RemoteServer) – Remote server connection settings.

  • timeout_s (float) – HTTP timeout used for the health check.

Returns:

A boolean success flag and a human-readable status message.

Return type:

tuple[bool, str]

konfai.get_available_devices(remote_server=None, timeout_s=2.0)[source]

Return the available GPU indices and their display names.

Parameters:
  • remote_server (RemoteServer | None) – Remote server to query instead of the local machine.

  • timeout_s (float) – HTTP timeout used for remote requests.

Returns:

Available device indices and the corresponding device names.

Return type:

tuple[list[int], list[str]]

konfai.get_ram(remote_server=None, timeout_s=2.0)[source]

Return used and total RAM in gigabytes.

Parameters:
  • remote_server (RemoteServer | None) – Remote server to query instead of the local machine.

  • timeout_s (float) – HTTP timeout used for remote requests.

Returns:

Used RAM and total RAM in gigabytes.

Return type:

tuple[float, float]

konfai.get_vram(devices, remote_server=None, timeout_s=2.0)[source]

Return used and total VRAM in gigabytes for the selected devices.

Parameters:
  • devices (list[int]) – GPU indices to inspect.

  • remote_server (RemoteServer | None) – Remote server to query instead of the local machine.

  • timeout_s (float) – HTTP timeout used for remote requests.

Returns:

Used VRAM and total VRAM in gigabytes.

Return type:

tuple[float, float]

See also