Configuration#

Device and logging setup. Call these before any simulation work.

hyperwave_community.set_device(mode='auto')#

Configure JAX compute device.

Ensures the correct jaxlib variant is installed, then sets the default JAX device. Call before any JAX operations.

Parameters:

mode (str) – "auto" (default) detects GPU via nvidia-smi and installs/uses CUDA jaxlib when available, CPU otherwise. "cpu" forces CPU-only. "gpu" forces GPU (raises if no NVIDIA GPU is found).

Raises:
  • RuntimeError – If mode="gpu" but no NVIDIA GPU is present.

  • ValueError – If mode is not one of "auto", "cpu", "gpu".

Example:

hwc.set_device("auto")
hyperwave_community.set_verbose(verbose=True)#

Enable or disable verbose output.

When enabled, shows progress messages during simulation, optimization, and other long-running operations.

Example:

hwc.set_verbose(True)
hyperwave_community.configure_api(api_key=None, api_url=None, gateway_url=None, validate=True)#

Configure API credentials and endpoint, with optional validation.

Parameters:
  • api_key (Optional[str]) – API authentication key. If None, uses HYPERWAVE_API_KEY environment variable.

  • api_url (Optional[str]) – GPU endpoint URL (Modal). If None, uses HYPERWAVE_API_URL environment variable or defaults to production Modal endpoint.

  • gateway_url (Optional[str]) – Gateway URL (Railway) for WebSocket optimization and billing. If None, uses HYPERWAVE_GATEWAY_URL environment variable or defaults to production Railway endpoint.

  • validate (bool) – If True (default), validates the API key by calling the server.

Return type:

Optional[Dict[str, Any]]

Returns:

Account info dict with ‘name’, ‘email’, ‘credits_balance’ if validation enabled, None otherwise.

Raises:
  • ValueError – If no API key is provided and HYPERWAVE_API_KEY is not set.

  • RuntimeError – If API key validation fails.

Example:

hwc.configure_api(api_key=userdata.get("HYPERWAVE_API_KEY"))
# or
hwc.configure_api(api_key=os.environ.get("HYPERWAVE_API_KEY"))