qbraid_core.services.compute.ComputeClient

class qbraid_core.services.compute.ComputeClient(*args, **kwargs)

Client for interacting with the qBraid Compute service.

Manages compute profiles for try-mode and save-mode instances.

Parameters:
  • api_key – Optional API key for authentication.

  • session – Optional pre-configured session.

Example

>>> from qbraid_core.services.compute import ComputeClient
>>> client = ComputeClient()
>>> profiles = client.list_profiles()
>>> for profile in profiles:
...     print(f"{profile.slug}: {profile.profile_type}")
__init__(*args, **kwargs)

Initialize the ComputeClient.

Methods

__init__(*args, **kwargs)

Initialize the ComputeClient.

bma_ssh_alias(instance_id)

Derive a stable SSH config alias for a BMA instance.

configure_ssh(slug[, ssh_host, username, tools])

Configure SSH access for a profile.

configure_ssh_for_instance(instance_id)

Configure SSH access for a single running BMA instance.

create_save_profile(base_image[, ...])

Create a save-mode profile (Pro+ plan required).

create_try_profile(base_image[, ...])

Create a try-mode profile (Standard+ plan required).

delete_profile(slug)

Delete a user-owned profile.

get_bma_instance(instance_id)

Get a single BMA instance (poll target).

get_build_status(slug)

Check build status for a save-mode profile.

get_credits_balance()

Get the current user's credit balance for their organization.

get_profile(slug)

Get detailed profile information by slug.

get_server_status([cluster_id])

Get server status for the current user.

get_session(session_id)

Get details for a specific compute session.

get_session_token([cluster_id])

Get JupyterHub session token for SSH access.

get_ssh_command(slug[, ssh_host, username])

Get SSH command for connecting to a profile's pod.

get_usage([days, timezone])

Get compute usage data.

is_bma_profile(profile_slug)

Whether a profile slug provisions an on-demand BMA instance.

list_bma_instances()

List the caller's non-terminated BMA instances.

list_my_profiles()

List only user-owned profiles (excludes global profiles).

list_profiles([plan, gpu, visibility, ...])

List available compute profiles.

list_ready_profiles()

List profiles that are ready to use (have capacity).

list_sessions([limit, offset, status, ...])

List compute sessions for the current user.

provision_bma_instance(profile_slug)

Provision (launch) a new on-demand BMA instance.

remove_ssh_config(slug)

Remove SSH configuration for a profile.

running_in_lab()

Check if running in the qBraid Lab environment.

start_and_configure_ssh(profile_slug[, ...])

Start a server and configure SSH access.

start_bma_instance(instance_id)

Resume a stopped BMA instance.

start_server(profile_slug[, cluster_id])

Start a server with the specified profile.

stop_all_servers([cluster_id])

Stop servers across all organizations.

stop_bma_instance(instance_id)

Stop (pause) a running BMA instance, preserving its disk.

stop_server([cluster_id])

Stop the current server.

terminate_bma_instance(instance_id)

Terminate (delete) a BMA instance and its disk.

update_bma_cutoff(instance_id[, ...])

Update the auto-cutoff policy for a BMA instance.

update_session_settings(**settings)

Update compute session settings.

user_credits_value()

Get the current user's qBraid credits value.

wait_for_bma_instance(instance_id[, ...])

Poll a BMA instance until it reaches a terminal status.

wait_for_build(slug[, poll_interval, timeout])

Wait for a save-mode profile build to complete.

wait_for_server([poll_interval, timeout, ...])

Wait for server to be ready.

Attributes

session

The QbraidSessionV1 used to make requests.