SDK Reference
Reference documentation for the public lium.sdk Python API.
Install the SDK with:
pip install lium.io
Client
- Lium - Clean Unix-style SDK for Lium.
- AlphaQuote - USD -> alpha quote from GET /balance/convert/alpha.
- AlphaSubnet - One subnet whose alpha Lium accepts as payment (GET /balance/alpha/subnets).
- AlphaSubnets - The accepted-subnet set from GET /balance/alpha/subnets.
- pod_ssh_command - The pod's ssh command for a shell, with the host-key options and without a key.
Models
- ExecutorInfo
- PodInfo
- Template - Template information.
- BackupConfig - Backup configuration information.
- BackupLog - Backup log information.
- RestoreLog - Restore log information.
- VolumeInfo - Volume information.
- SSHKey - Public SSH key registered for the current user.
- GpuStats - One GPU's utilization as reported by nvidia-smi on the pod.
- ApiKeyScope - One row of GET /keys/scopes: what a scope lets a key do, in the server's words.
- ApiKeyInfo - An API key row as GET /keys / POST /keys describe it.
- ApiKeyRefusal - One row of GET /keys/{id}/refusals: a request the key's budget.
- JobQuote - What Lium.quote() returns: a job's cost on a node, line by line.
- JobQuoteLine - One charge of a JobQuote; rate_usd and amount_usd are None for egress (billed at AWS cost).
- RentResult - What Lium.rent() chose and, unless it was a dry run, rented.
- Cluster - The pods of one multi-node rental, in node-rank order.
- ClusterOffer - A group of free nodes on one RDMA fabric that can be rented as a single multi-node job.
- GpuClockOutcome - One GPU's result of Lium.lock_gpu_clocks() / Lium.reset_gpu_clocks().
- GpuClockResult - What Lium.lock_gpu_clocks() / Lium.reset_gpu_clocks() return when every GPU succeeded.
- GpuResetOutcome - One GPU's result of Lium.reset_gpu(): result is reset, latch_cleared or failed.
- GpuResetResult - What Lium.reset_gpu() returns when every GPU was reset.
Api Keys
Configuration
Jobs
- Job - A command started in the background on a pod.
Bounded Job
- JobResult - What Lium.run_job() did. to_dict() is JSON-ready.
Exceptions
- LiumError - Base exception for Lium SDK.
- LiumAuthError - Authentication error.
- LiumRateLimitError - Rate limit exceeded. retry_after is the response's Retry-After in seconds, None when absent.
- LiumServerError - Server error.
- LiumNotFoundError - Resource not found (404).
- LiumPermissionError - The account is not allowed to do this (403).
- PodStartError - A pod reached a state from which it will never become ready.
- LiumHostKeyError - A pod presented an SSH host key that differs from the pinned one.
- LiumInsufficientBalanceError - The account cannot pay for this: a 403 with a balance reason, or a 402 balance refusal.
- LiumScopeError - The API key lacks the scope the route needs (403 API key '<name>' does not have the '<scope>' scope).
- LiumBudgetExceededError - The API key's budget refused the request (402, error.code API_KEY_BUDGET_EXCEEDED).
- RemoteExecutionError - A function offloaded with @lium.machine did not return a result from the pod,.
- LiumRentOutcomeUnknownError - Lium.up() could not confirm a rent's result; check ps() before renting again, a pod may be billing.
- LiumTransferInterruptedError - Ctrl-C ended Lium.transfer_credits() after its POST: the transfer may have happened.
- ClusterNotListedError - The cluster rent may have gone through, but the pod listing did not show a whole.
- LiumSSHError - SSH could not connect to a pod (refused, timed out, login rejected).
- LiumGpuOperationError - A GPU reset or clock change ran on the node and failed (a reset's status failed, or a.
- LiumSessionError - A browser session (lium workspaces login / LIUM_SESSION_TOKEN) is missing or refused.
- LiumTwoFactorRequired
- OutputLimitExceeded - A command run with Lium.exec produced more than max_output_bytes bytes of output.
Result Codec
- ResultEncodingError - The function's result holds a value that does not travel back from the pod.
Decorators
- machine - Decorator to execute a function on a remote Lium machine.