WeltPython SDK
Products: switch from Welt to another product
Open console

GuidesSDK guide

SDK guide

Use the lower-level Client to upload a table, submit a fit and predict, then inspect your workspace's jobs, predictors and usage. This page also explains how usage relates to workspace credits.

Fit and predict with Client#

Client() connects to https://welt.ergodic.dev by default. Always close it, or use it as a context manager. Client.models() reports actual capabilities, not blanket task support.

This example continues with the real Iris train and test tables from Start:

python
# Continue with the real Iris train/test tables from Start.
from welt import Client
from sklearn.metrics import accuracy_score

with Client() as client:
    dataset = client.upload(columns=list(train.columns), rows=train.values.tolist(), target=target)
    job = client.submit_fit(dataset["id"], model="tabicl-v2", task="classification", seed=9)
    print("Keep the job ID:", job.id)
    predictor = job.result(timeout=600)
    result = client.predict(predictor["id"], columns=list(query.columns), rows=query.values.tolist())
print("Test accuracy:", accuracy_score(y_test, result["predictions"]))
Which endpoint and credential does Client use?

An explicit base_url overrides WELT_BASE_URL. Authenticated methods use your connected or saved workspace credential, WELT_API_KEY or an explicit key. See Connect for precedence.

Estimators and jobs#

Reconnect and handle errors#

Inspect job.id or job.inspect(), reconnect with client.job(id) and retrieve the result with result(). A polling deadline is local; it does not cancel durable server execution. job.cancel() explicitly requests cancellation.

Typed errors distinguish invalid input, unavailable model, authentication, capacity and execution failure. Their IDs allow operator diagnosis without exposing data values. PredictionPendingError carries a job_id, so you can reconnect after a server-side small-prediction timeout. Wait and recover lists the next action for each error.

Predictors and workspace resources#

Files and batch prediction#

Client and AsyncClient also provide resumable upload sessions, upload_file, submit_batch_predict and batch_payload. Keep the upload ID before sending bytes, and inspect batch manifests for failed row ranges.

Enabled file formats, batch limits and model readiness depend on the connected service. See CLI recipes and capabilities for those boundaries. Native ArrowFM, CDFM and AVICI results retain their graph semantics; public Ergodic continuation and the remaining engines have separate availability requirements. See the research catalogue for tables to try.

Usage and workspace credits#

Modelling and research downloads may consume workspace credits. Before running a walkthrough, open Workspace → Billing in Welt and check available credits, pending reservations, plan status and spend caps.

client.pricing() reads the current public rate card. It does not buy credits, change a plan or authorize a payment; billing changes require browser authority. The current public rate card has a five-credit minimum for a priced fit, prediction, batch prediction or discovery, and a 25-credit research download. An evaluation is one priced operation (usage kind evaluate) with a single five-credit minimum; see evaluation pricing.

Check current prices before budgeting

Verify the current offers in Billing or client.pricing(). Request size and the applicable accounting rules determine the charge.

List your usage events:

python
with Client() as client:
    events = client.usage()
for event in events:
    print(event["operation_id"], event["status"],
          event.get("credits"), event.get("rate_card_version"))

Usage contains lifecycle and attempt workload metadata, plus nullable accounting fields:

Count operations, not events

Several lifecycle events can share one operation_id and repeat its accounting fields. Count distinct operations and do not sum credits across every event.

Use Workspace Billing for the workspace ledger and available balance. Usage contains no prediction payloads and does not measure model accuracy.

HTTP 402 is exposed as WeltError with its code, including insufficient_credits, spend_cap_reached or plan_past_due. Resolve the billing condition before a deliberate retry; see Wait and recover.

Retries and replays#

Next steps#

The capability boundary, onboarding guide, executed notebook examples and generated installed-package reference explain supported behavior.

How are these examples checked?

The source examples use real research data and hosted calls. Local release checks patch transport only in disposable test copies with authorized pinned research files. Public CI validates source and contracts without hosted data or model-quality claims.

Documentation

Search SDK 0.13.1

Search this SDK version by task, method or error.