Skip to main content

Predictabl Python API library

Predictabl is your agentic data scientist for tabular data: it reads your tables, plans the features, trains and tests the model, and serves the predictions.

Turn a question about your data into a trained, tested model, then score with it. The features are planned in SQL you can review, and checked for leakage before training.

Documentation: predictabl.tech/docs · for AI agents, the whole documentation as one Markdown file: predictabl.tech/docs/llms-full.txt

Status: alpha (0.1). The API may still change between minor versions.

pip install predictabl
import predictabl as pb

pb.login("pk_...")          # or set PREDICTABL_API_KEY

data = pb.connect("customers.csv")      # a file, a DataFrame, or a database
churn_model = data.predict("Which customers will churn?")
✓ Uploading      customers.csv · 18.2 MB
✓ Reading data   1 table
✓ Understanding  Predict which customers will churn
✓ Planning       31 features · 2 excluded
✓ Building data
✓ Training       lightgbm: kept 840 trees
✓ Final model    auc 0.8712
churn_model.predict(customer)        # one customer (a dict), a list, or a DataFrame
Probability that customer churned: 0.82
churn_model.report()                 # what it predicts, tested score, top features
churn_model.url                      # the same model in the web app

Your data can be files, a pandas DataFrame, or a Postgres database, which Predictabl reads in place, read-only:

data = pb.connect("postgresql://readonly:pw@db.acme.com/sales")

Everything you build from code also appears in the web app, labelled with the token that created it.

Get an API key

In the web app: Settings → API & MCP → Create token.

  • By default a token has full access: it can do from code what you do in the web app (upload, ask, plan, train and get predictions).
  • Tick Predictions only for a read-only token: it can get predictions from your trained models and change nothing.

A token only ever reaches its owner's data and models. It cannot create other tokens. Revoking it stops it immediately.

Review the plan before training

data.predict(question) goes straight from question to model. To look first:

plan = data.plan("Which customers will stop buying in the next 30 days?")
print(plan)                     # target, features, and what was excluded and why
plan = plan.refine("Don't use the support_tier column")
model = plan.train()            # or plan.train(preset="fast_preview") for a 15-second check

Scoring

How a model picks what to score depends on its kind (model.kind):

kind what model.predict() does typical model
flat needs rows=: one record in, one prediction out survey, sensor reading, form
event scores rows dated today in the data it trained on; pick a window with since=/until= or since_days= orders, sign-ups, bookings
forecast projects from the latest data, or as_of="2026-10-01" sales per store, demand per item
preds = model.predict(rows=df)                     # your records
preds = model.predict(since_days=7)                # event model: last week's rows
preds = model.predict(ids=["store_12"], limit=48)  # one entity
preds = model.predict(filters=[{"column": "city", "op": "eq", "value": "Milano"}],
                      include=["city"])

preds.meaning    # e.g. "probability that customer churned"
preds.as_of      # forecasts: the date they are made from
preds.note       # e.g. why nothing matched, and the newest date in the data
preds.to_pandas()     # needs: pip install "predictabl[pandas]"

A record you score can still contain its outcome column (e.g. a row copied from the training file): it never reaches the model, and comes back as actual so the call doubles as a check.

Plans and limits

On Predictabl's AI key, building uses credits: turning a question into a plan, and changing a plan. Training, retraining and predictions never use credits, and a plan or model that fails to build is refunded. With your own OpenAI or Anthropic key (Settings → AI provider) building uses no credits. Your plan also sets how many models you keep and predictions a month. pb.account() shows what is left; running out raises predictabl.LimitReached with what to do next. Details: Errors and limits.

Use it from an AI agent (MCP)

From ChatGPT or Claude, no install: add https://app.predictabl.tech/mcp as a connector and sign in. Then upload your data, ask your question, and get your predictions, all in the chat. Setup for each app: AI agents and MCP.

On your machine: this library also includes a local MCP server that lists your models, shows how good they are, and gets predictions from them, using a token:

claude mcp add predictabl-local --env PREDICTABL_API_KEY=pk_... -- uvx --from "predictabl[mcp]" predictabl mcp

Then ask: "Which of my customers are most likely to churn this month, and how good is that model?" To upload or train from a chat, use the hosted server.

Configuration

PREDICTABL_API_KEY your token (pk_...)
PREDICTABL_BASE_URL default https://app.predictabl.tech/pub/v1; a local instance is http://localhost:8000/api/v1

For several accounts or instances, use clients directly: pb.Client(api_key=..., base_url=...) has the same methods.

Errors

All errors derive from predictabl.PredictablError and carry the server's code and a message that says what to do: AuthenticationError (bad or revoked key), PermissionDenied (the key's scope does not allow it), NotFound, LimitReached, InvalidRequest, BuildFailed (with the server's recovery suggestions).

License

MIT

Metadata

Release files for predictabl 0.1.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 predictabl 0.1.5
File Size Uploaded Provenance Actions
predictabl-0.1.5.tar.gz 151.5 kB With provenance Details for predictabl-0.1.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for predictabl 0.1.5
File Interpreter ABI Platform Actions
predictabl-0.1.5-py3-none-any.whl Python 3 none any Details for predictabl-0.1.5-py3-none-any.whl

Total release size: 185.6 kB

Release files / predictabl-0.1.5.tar.gz

Download URL predictabl-0.1.5.tar.gz
Size 151.5 kB
Tags Source
SHA-256 checksum
How to use checksums
9872bc3c074b7b5f5794c422e69e91e42fec863a3f425054e09d874ea12be0ed
BLAKE2b-256 checksum
How to use checksums
c85bd48698aaaad49f96b66e63133b2d679a7d1f24085d3fa0c13be534a643c6
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 22, 2026.

Transparency log

Release files / predictabl-0.1.5-py3-none-any.whl

Download URL predictabl-0.1.5-py3-none-any.whl
Size 34.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
97ade89fda3d40023d555a4ed5a64f8be056360c593ec50110ca795728b837fc
BLAKE2b-256 checksum
How to use checksums
c86cdf76a3c3e687f4a1d900c689e6176f9bbc5911d07ed4e7c7df7ffe05116f
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 22, 2026.

Transparency log

Security for predictabl 0.1.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 predictabl-0.1.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 22, 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