Skip to main content

causilo-client

Python client for the Causilo inference API. Send a table with the answers filled in and a table with them blank; get a prediction for every blank row.

Install

pip install -U causilo-client

Python 3.11 or newer. pandas, pyarrow, requests and google-auth are pulled in automatically.

The import name is causilo_client. causilo on PyPI is the model package, and the two can be installed side by side. Code written against the earlier radix name changes the import and the class name: from causilo_client import Causilo, and Radix(...) becomes Causilo(...). Nothing else moved.

Use

import os

from causilo_client import Causilo

cx = Causilo(
    os.environ["CAUSILO_ENDPOINT"],   # https://api.nums.world
    token=os.environ["CAUSILO_KEY"],  # the csl_... key
)

pred = cx.predict(context_df, query_df, target="churned", model="causilo-clf")

context_df holds the target column; query_df does not. The feature columns must match in name and order across the two.

The hosted API is https://api.nums.world, and a key for it (csl_...) is created on the dashboard at https://platform.nums.world; pass it as token=. A deployment of the container that sits behind Google IAM takes a service account key file instead (key_file=), and its endpoint and credential come from whoever operates it.

For a large answer -- class probabilities for hundreds of thousands of rows, say -- pass as_frame=True. The answer then comes as Parquet and is returned as a DataFrame (prediction, or prediction_0, prediction_1, ...), which is several times less to download and much less memory than the same numbers parsed out of JSON. If an answer is cut off while it is being sent, the client raises CausiloIncompleteResponse and does not retry: the prediction ran and was counted, so sending it again counts it again.

Moving from another tabular API

The shapes are close enough that most code moves in an afternoon. fit and predict collapse into one predict(context, query, ...): the context table is the training data with the target column filled in, the query table the rows to predict without it, and nothing is stored between calls unless you ask for a context to be kept. The output_type names are the usual ones (probas, preds, mean, median, quantiles); quantiles must lie strictly inside (0, 1), and some APIs accept the endpoints. Tables travel as Parquet rather than CSV or JSON, so pass DataFrames and let the client encode them. Datetime, timedelta, Period and decimal columns are refused with a clear message rather than silently mishandled; split dates into numeric parts first. One model knob is a request parameter: n_estimators= (1 to 8) on predict, predict_with_metadata, predict_cached and to_batch_parquet asks for a narrower ensemble than the server's default of 8. It is faster and changes the numbers, it does not change the charge, and a CachedContext sends it with every later query. Other knobs are not parameters; the server reports what it applied in metadata.served_by.

Where it works

The client talks to the hosted API and to any deployment of the container that sits behind a plain HTTPS address: an Azure ML managed endpoint, a load balancer in front of ECS. It does not talk to a SageMaker endpoint. SageMaker's runtime API requires AWS-signed requests and routes only /invocations and /ping, so /usage, /limits and /cancel do not exist there; use boto3 as shown in deploy/aws/README.md.

Every path this client calls carries /v1 as of 0.11.0: POST /v1/predict and the rest. A container older than image 0.12.17 does not answer those names, so pointing 0.11.0 or later at one gives a 404 on the first call -- update the container. The releases that used the unversioned names (0.10.1, 0.10.2) are no longer on PyPI. The hosted API at https://api.nums.world answers the /v1 names only.

What else is there

predict_with_metadata(...) The prediction and the metadata the server attached: the settings it applied, classes for the column order of a probability matrix, served_by naming the image and the weights that answered, quota with what is left of the month
predict_cached(...) The same first call, plus a handle. Use it when the same context table will be queried again: the server keeps the encoded context and later queries send only the query rows. That saves the upload and the encoding, not the charge: cells are counted over context and query rows together on every call. Returns (prediction, handle)
CachedContext The handle. handle.predict(query) for each later question, handle.release() when finished, or use it as a context manager. If the server's copy has gone -- it expired, or another caller's context needed the room -- the handle re-sends the table and carries on rather than raising
list_contexts(), release_context(id) What this credential is holding, and letting one go by id
usage() The month's figures for this credential without spending any of it; metered: false when no cap applies
health(), wake() Whether the service is ready; wake() waits for a cold instance to come up before a first call
to_batch_parquet(...) Packs a context and a query table into the single Parquet file a batch job takes
MODELS The model keys this version knows

Every failure is a CausiloError with .status, .error_code and .request_id, the identifier to quote when reporting a problem. The subclasses say what to do: CausiloValidationError (fix the request), CausiloTooLarge (the message names what fits), CausiloQuotaExceeded (a cell quota is spent; .scope is caller, daily or tenant, with .limit, .used, .resets_at), CausiloRateLimited (too many requests in one minute or hour; the client already waited out Retry-After three times before raising it, and .scope, .limit, .used, .resets_at say which window), CausiloOverloaded (retry once the queue drains; CausiloRateLimited is a subclass of it), CausiloUnavailable (already retried three times), CausiloAuthError (the credential was refused) and CausiloTimeout. Timeouts are the one failure the client will not retry: the server is still computing, so instead it tells the server the call was abandoned, and .refunded says how many cells came back. The hosted API cannot stop a prediction once it has started (POST /v1/cancel answers 501 there), so against it .refunded is None: a call already running when your own timeout fires finishes and is counted in full, and one still queued is not run. The server's own limit is different: a call that cannot finish within the time a request waits (900 seconds, the server stopping the work about 90 seconds before that) is stopped, nothing is counted, and the client raises CausiloTimeout from the server's 504. The default timeout is 900 seconds, so that 504 arrives before it fires. The RadixError family of names from releases before 0.8.19 remains importable as aliases of the same classes, so an except RadixError written earlier still catches everything.

The integration guide covers the call arguments, the input rules, the response metadata, what each error means, and what the client does on your behalf when a call times out.

Metadata

Release files for causilo-client 1.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for causilo-client 1.0.5
File Size Uploaded Provenance Actions
causilo_client-1.0.5.tar.gz 26.1 kB With provenance Details for causilo_client-1.0.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for causilo-client 1.0.5
File Interpreter ABI Platform Actions
causilo_client-1.0.5-py3-none-any.whl Python 3 none any Details for causilo_client-1.0.5-py3-none-any.whl

Total release size: 50.0 kB

Release files / causilo_client-1.0.5.tar.gz

Download URL causilo_client-1.0.5.tar.gz
Size 26.1 kB
Tags Source
SHA-256 checksum
How to use checksums
125522cddb37371ffc10ea00d6a4eeea66f08e1d54f7beea4f2f889807de8be4
BLAKE2b-256 checksum
How to use checksums
36623ca225cd0a233d53496890693d315efb6d5dfbb5dec8321c06b97b5b4f8c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

Release files / causilo_client-1.0.5-py3-none-any.whl

Download URL causilo_client-1.0.5-py3-none-any.whl
Size 23.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c505055171087671e9bd8914c8bcbfa2202a715104ce4112285830c6a82a6e38
BLAKE2b-256 checksum
How to use checksums
c3d429a773d92c79f8c9cdf64fae17081e345bcd3e268550cfa973a6bbfcd568
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

Security for causilo-client 1.0.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for causilo_client-1.0.5.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page