Documentation Index
Fetch the complete documentation index at: https://docs.ivory.finance/llms.txt
Use this file to discover all available pages before exploring further.
Authentication
Model lifecycle
Train a model
Launches a full 23-algorithm competition across four problem types. The winning algorithm is selected automatically based on validation performance, its artifact is stored in Cloudflare R2, and the run record is updated with complete metrics, SHAP values, and a drift-monitoring baseline. What the worker does on each training run:- Loads up to
IOMETE_ROW_LIMITrows (default 500,000) from your Iceberg table - Auto-detects classification vs regression when
problem_typeis omitted - Computes class imbalance ratio and applies SMOTE when ratio exceeds 10:1
- Runs stratified
train_test_split(80/20) for classification - Trains all applicable algorithms with a per-algorithm timeout (default 5 min)
- Picks the winner by highest
val_accuracy(classification) or lowest MAE (regression) - Computes SHAP mean absolute values for the top-20 features
- Records per-feature decile distributions as the PSI drift baseline
GET /models/{id} for completion.
Algorithm roster
| Problem type | Algorithms | Winner criterion |
|---|---|---|
| Classification | XGBoost, LightGBM, CatBoost, RandomForest, ExtraTrees, GradientBoosting, LogisticRegression, SVC (≤5k rows) | Highest val_accuracy |
| Regression | XGBoost, LightGBM, CatBoost, RandomForest, ExtraTrees, GradientBoosting, Ridge, Lasso, ElasticNet, SVR (≤10k rows) | Lowest MAE |
| Time-series | Prophet, ARIMA (pmdarima auto_arima) | Lowest MAE |
| Anomaly | IsolationForest, LOF, OneClassSVM | All three scored; IsolationForest preferred for inference |
Request body
| Field | Required | Default | Description |
|---|---|---|---|
dataset_id | Yes | — | UUID of a ready dataset |
name | Yes | — | Human name for this run |
target_column | Yes | — | Column to predict |
feature_columns | No | [] | Features to use — empty = all columns except target |
problem_type | No | null | classification, regression, timeseries, anomaly, or auto |
List models
Get model details
Returns full metrics, feature importance, class imbalance ratio, and training status per algorithm in the competition.Explain model
Returns a plain-English explanation of what the model learned, powered by GPT-4o-mini and the top feature importances stored at training time.SHAP feature importance
Returns SHAP (SHapley Additive exPlanations) mean absolute values for the top-20 features, computed at training time on up to 500 validation rows. SHAP values are more reliable than standard feature importance — they measure the actual contribution of each feature to individual predictions, not just split frequency in tree nodes.| Algorithm type | SHAP method used |
|---|---|
| XGBoost, LightGBM, CatBoost, RandomForest, ExtraTrees, GradientBoosting | TreeExplainer (exact, fast) |
| LogisticRegression, Ridge, Lasso, ElasticNet | LinearExplainer |
| SVC, SVR, anomaly models | Skipped (too slow for production use) |
Hyperparameter optimisation (Katib HPO)
Before a final production run, let Foundry search for optimal hyperparameters via Kubeflow Katib Bayesian optimisation — up to 12 trials, 2 in parallel. When the experiment finishes, callGET /models/{id}/tune to retrieve the best params, then feed them into POST /models/train for the final run.
Request body
| Field | Required | Default | Description |
|---|---|---|---|
dataset_id | Yes | — | UUID of a ready dataset |
name | Yes | — | Human name for this tuning run |
target_column | Yes | — | Column to predict |
problem_type | No | auto | classification, regression, or auto |
Deploy model
Wraps a trained model as a live KServeInferenceService (RawDeployment mode — no serverless cold starts) and registers it in the Kubeflow Model Registry.
The status flips from "deploying" to "active" within a few seconds as K8s brings up the pod. Retry POST /models/{id}/predict until you get a 200.
Request body
| Field | Required | Description |
|---|---|---|
model_name | Yes | Short identifier for this deployed version (lowercase, hyphens OK) |
Set decision threshold
Adjust the classification threshold for a deployed binary model. Scores ≥ threshold → label 1, scores < threshold → label 0. The default is0.5. Tune it based on your risk appetite:
| Use case | Recommended threshold | Rationale |
|---|---|---|
| Fraud / AML detection | 0.25 – 0.35 | Maximise recall — a missed fraud is worse than a false alarm reviewed by compliance |
| Deal scoring | 0.65 – 0.75 | Surface only high-conviction opportunities — reduce analyst noise |
| Earnings beat prediction | 0.50 | Symmetric precision/recall trade-off |
Request body
| Field | Required | Description |
|---|---|---|
threshold | Yes | Float strictly between 0.0 and 1.0 |
threshold_metric | No | Context label: f1, precision, recall, or balanced_accuracy |
Drift monitoring
Computes Population Stability Index (PSI) for each feature by comparing the current distribution of incoming prediction inputs against the training-time baseline (decile bins computed pre-SMOTE on the training set). PSI is evaluated over the last 500 prediction log entries.| PSI range | Status | Action |
|---|---|---|
< 0.10 | stable | No action needed |
0.10 – 0.20 | moderate | Monitor closely; consider retraining if trend continues |
> 0.20 | critical | Significant input distribution shift — retrain recommended |
Predict
Proxy a prediction request to the deployed KServe endpoint. For binary classification models the stored decision threshold is applied automatically:- score ≥ threshold →
label: 1(positive class) - score < threshold →
label: 0(negative class)

