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.
configure_ssh(slug[, ssh_host, username, tools])Configure SSH access for a profile.
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_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.
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.
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_server(profile_slug[, cluster_id])Start a server with the specified profile.
stop_all_servers([cluster_id])Stop servers across all organizations.
stop_server([cluster_id])Stop the current server.
update_session_settings(**settings)Update compute session settings.
user_credits_value()Get the current user's qBraid credits value.
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
sessionThe QbraidSessionV1 used to make requests.