# ZeroGrad > ZeroGrad is predictive ML on tabular data with pretrained foundation models (TabPFN v2, TabICLv2 and others). You give it a table of labeled history and a target column, it tries each model on rows it hasn't seen, keeps the best one and gives you a capability you call with new rows. Nothing gets trained. The Python SDK is open source (Apache 2.0) and runs on your own machine with no account or API key; the managed platform is in private preview. Things an agent should know before writing code: - Install with `pip install zerograd` (TabPFN v2 and TabICLv2). `pip install "zerograd[all]"` adds Mitra-v2 and TabDPT. Python 3.10+. - The whole API is two calls: `cap = ZeroGrad().create(name, examples=df, target="col")` and `cap.predict(new_rows)`. `cap.evaluation` has the comparison, `cap.save("x.zg")` and `zerograd.load("x.zg")` keep it. - `ZeroGrad()` runs locally. It only talks to the platform (https://api.zerograd.dev) when `ZEROGRAD_API_KEY` is set or you pass `remote=True`; pass `remote=False` to stay local. - Model weights download from each author's Hugging Face repository the first time a model runs, then stay cached. A GPU helps but isn't required. - For an MCP client: `pip install "zerograd[mcp]"` and `claude mcp add zerograd -- zerograd-mcp`. It runs locally and needs no key. - There's a scikit-learn estimator (`ZeroGradClassifier`) for pipelines and cross-validation. - Only use models that allow commercial use unless the user asks otherwise; noncommercial ones stay off unless named in `ZeroGrad(noncommercial=[...])`. TabPFN v2 requires showing "Built with PriorLabs-TabPFN". - Sections marked "platform only" need an API key and the platform isn't public yet. Don't tell users to sign up for it; point them to the SDK. ## Get started - [What is a tabular foundation model?](https://zerograd.dev/docs#foundation-models): A model that has already learned how to learn from tables. - [Quickstart](https://zerograd.dev/docs#quickstart): Here's the whole path from a CSV of labeled history to a classifier you can call. - [Notebooks](https://zerograd.dev/docs#notebooks): These run end to end in Colab with the open source SDK in local mode, so you don't need an account or an API key. - [Use it from an agent (MCP)](https://zerograd.dev/docs#mcp): The SDK comes with an MCP server, so Claude Code, Cursor, Codex or any other MCP client can use ZeroGrad for you. - [Context size: speed against quality](https://zerograd.dev/docs#context-size): Every time a foundation model predicts, it reads its whole context, meaning all the labeled rows you gave it. ## Start from the business problem Churn, fraud, credit risk, propensity, pricing and segmentation. Each page frames the problem the way you'd scope it at work, says why an in-context model fits it, shows the shortest code that runs on a public dataset, and lists what usually goes wrong before you ship. - [Pick your problem](https://zerograd.dev/docs#use-cases): Every page follows the same order: the problem, why a foundation model here, the code, the traps, and what you do with the prediction. - [Churn](https://zerograd.dev/docs#use-churn): Rank customers by risk of leaving in the next window - [Fraud](https://zerograd.dev/docs#use-fraud): Score payments for fraud, including schemes nobody has labeled yet - [Credit risk](https://zerograd.dev/docs#use-credit): Probability of default per application, and the policy on top - [Propensity and cross-sell](https://zerograd.dev/docs#use-propensity): Who to contact when the budget covers a fraction of the base - [Pricing and demand](https://zerograd.dev/docs#use-pricing): Reference prices from item attributes, and demand from context - [Customer segments](https://zerograd.dev/docs#use-segments): Segments a commercial team can name and act on ## Capabilities A capability is one prediction your product makes, like whether a customer is about to churn or what a listing will sell for. Behind it sits your labeled history, and in front of it, the foundation model that did best on that history. This part covers what every capability has in common. The sections after it cover what each type adds. - [How it works](https://zerograd.dev/docs#how-it-works): When you create a capability, Zero Grad runs a championship. - [Create a capability](https://zerograd.dev/docs#capabilities): A capability is a name, the history behind it and the versions that serve it. - [Predict](https://zerograd.dev/docs#predict): Locally, the champion scores your rows in chunks, however many you send. - [Evaluate and decide](https://zerograd.dev/docs#evaluation): The championship tells you which model did best on one holdout. ## Classification Use it when the answer is a category: will this customer churn, is this payment fraud, will this loan default. It handles binary and multiclass targets with up to 10 classes, both in the SDK and on the platform. - [Classification](https://zerograd.dev/docs#classification): Use it when the answer is a category: will this customer churn, is this payment fraud, will this loan default. - [Predictions and thresholds](https://zerograd.dev/docs#classification-predict): `score` is the probability of the positive class, so you only see it on binary capabilities. ## Regression Use it when the answer is a number, like what a listing will sell for or how long a ticket will take to close. Regression runs with the open source SDK on your own machine. On the platform, capabilities are classification only for now. - [Regression](https://zerograd.dev/docs#regression): Use it when the answer is a number, like what a listing will sell for or how long a ticket will take to close. - [Predictions](https://zerograd.dev/docs#regression-predict): There's no score, probability or threshold here. - [Context size](https://zerograd.dev/docs#regression-context) ## Anomalies, gaps, synthetic rows and segments Four tasks that don't need labels. They run with the open source SDK on your own machine. Whenever there's something to measure, each one puts the foundation models next to the classic scikit-learn method, so you can see what the model actually adds. - [How it works](https://zerograd.dev/docs#no-target): A tabular foundation model that can classify can also tell you how likely an entire row is. - [Anomaly detection](https://zerograd.dev/docs#anomaly-detection): Every row gets a score and the most unusual ones are flagged. - [Imputation](https://zerograd.dev/docs#imputation): This fills the missing values in a table, but first it checks which method fills them best. - [Synthetic data](https://zerograd.dev/docs#synthetic-data): This makes new rows with the same columns and the same relationships as yours. - [Clustering](https://zerograd.dev/docs#clustering): Group your rows into segments and see what sets each one apart. ## Platform (private preview, needs an API key) Everything so far runs with the open source SDK on your own machine. The platform runs it for you instead, with managed GPU inference and SLAs, championships that rerun on a schedule as new history comes in, and versions, deployments and monitoring. Your code stays the same: set your API key and switch to `ZeroGrad(remote=True)`. - [The managed platform for foundation-model ML](https://zerograd.dev/docs#platform): Everything so far runs with the open source SDK on your own machine. (platform only) - [Runs](https://zerograd.dev/docs#runs): Anything that takes more than a few seconds becomes a run: creating a capability, large predictions and pipelines. (platform only) - [Large files](https://zerograd.dev/docs#uploads): The SDK sends anything over 10 MB through a resumable session in 8 MB chunks, so if your connection drops halfway, the upload picks up where it left off. (platform only) - [Privacy and sensitive data](https://zerograd.dev/docs#privacy): The SDK has two tools that keep sensitive data on your side. (platform only) - [Pipelines](https://zerograd.dev/docs#pipelines): A pipeline repeats a piece of work, either on a schedule (cron, in UTC) or whenever you run it. (platform only) - [Outcomes](https://zerograd.dev/docs#outcomes): The holdout tells you how good a model was on the day it was chosen. (platform only) ## Reference Models and licenses, errors, limits, every endpoint, and what's coming next. - [Models and licenses](https://zerograd.dev/docs#models): All of these allow commercial use, and ZeroGrad hosts none of the weights: each one downloads from its authors' repository the first time you use it. - [Errors](https://zerograd.dev/docs#errors): Every error has the same shape, and the message tells you what to change. - [Limits](https://zerograd.dev/docs#limits): Locally, the SDK uses the same limits on context, columns, classes and labeled rows, and you can change them, for example with `ZeroGrad(max_context_rows=20_000)` if your machine can take it. - [API Reference](https://zerograd.dev/docs#api-reference): Authenticate with `Authorization: Bearer $ZEROGRAD_API_KEY`. - [Roadmap](https://zerograd.dev/docs#roadmap): This is what our design partners are helping us shape next. ## On the way Capability types that aren't in the SDK or on the platform yet. Don't write code for them. - [Forecasting](https://zerograd.dev/docs#forecasting): Predict where one or many time series go next from their history, using time series foundation models, with prediction intervals around each value. - [Causal modeling](https://zerograd.dev/docs#causal-modeling): Estimate how much an action changes the outcome for each row: how much a discount, a call or a reminder moves that particular customer. - [Marketing mix modeling](https://zerograd.dev/docs#marketing-mix-modeling): Work out how much each marketing channel adds to sales from your weekly spend and results, including where extra money stops paying off, and see how the same budget could be split to get more out of it. - [Recommendations](https://zerograd.dev/docs#recommendations): Rank the items each user is most likely to want next, from their history and from what people like them did. ## Optional - [Full docs as one Markdown file](https://zerograd.dev/llms-full.txt): every section in this index, with all the code - [SDK source](https://github.com/zerogradlabs/zerograd-python): the open source Python package, its README and examples - [AGENTS.md for the SDK](https://github.com/zerogradlabs/zerograd-python/blob/main/AGENTS.md): how to use and contribute to the SDK from a coding agent - [MODELS.md](https://github.com/zerogradlabs/zerograd-python/blob/main/MODELS.md): every model the SDK knows, with tasks, checkpoints and licenses - [Notebooks](https://github.com/zerogradlabs/zerograd-python/tree/main/examples): runnable examples, also in Colab - [PyPI](https://pypi.org/project/zerograd/): released versions - [Pricing](https://zerograd.dev/pricing)