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.
Model knobs such as n_estimators are not request parameters here; 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 and the call is
counted in full. The default timeout is 900 seconds. 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.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| causilo_client-1.0.1.tar.gz | 25.2 kB | With provenance | Details for causilo_client-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| causilo_client-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for causilo_client-1.0.1-py3-none-any.whl |
Total release size: 48.4 kB
Release files / causilo_client-1.0.1.tar.gz
| Download URL | causilo_client-1.0.1.tar.gz |
|---|---|
| Size | 25.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d0b883688ab46d317b17a1a3f3107e1d3f0cc87ac916d1b3b7e2c3d42c361449
|
|
BLAKE2b-256 checksum How to use checksums |
fb0f653f402cb969d536e67bbb82c4b7e049f27dfc69aacd066753772611b8e0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 2, 2026.
Transparency logRelease files / causilo_client-1.0.1-py3-none-any.whl
| Download URL | causilo_client-1.0.1-py3-none-any.whl |
|---|---|
| Size | 23.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9f8ae69a0d38806dfaf36cfefcd1c693546990fffbb0cd835a0825ec5bee3b63
|
|
BLAKE2b-256 checksum How to use checksums |
3a3d236cd2ee6b3e94553b87150639190c1085cc7a62c2784d04ae74f804492b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 2, 2026.
Transparency logSecurity for causilo-client 1.0.1
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.
Attestation for causilo_client-1.0.1.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 Oct 2, 2026.
Transparency logA 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.