Before you start
Install the workspace and leave it running. Everything below talks to it on
http://localhost:8369, so nothing here needs an API key of its own — you sign
in once and the workspace holds the session.
# if you have not already
curl -fsSL https://veox.ai/install.sh | bash
Run a session
Sign in, upload a table, follow it to the end. The only dependency is
requests.
import os, time, requests JAIN = "http://localhost:8369" # Sign in once; the workspace holds the session for you. requests.post(f"{JAIN}/api/auth/login", json={ "email": os.environ["VEOX_EMAIL"], "password": os.environ["VEOX_PASSWORD"], }).raise_for_status() # Create a session and upload the table. run = requests.post(f"{JAIN}/api/sessions", json={"effort": "low"}).json() with open("train.csv", "rb") as f: requests.post(f"{JAIN}/api/sessions/{run['id']}/files", files={"file": f}).raise_for_status() # Follow it. seq = 0 while True: s = requests.get(f"{JAIN}/api/sessions/{run['id']}").json() for e in requests.get(f"{JAIN}/api/sessions/{run['id']}/events", params={"after": seq}).json(): print(f" {e['stage']:>9} {e['message']}") seq = e["seq"] if s["state"] in ("complete", "failed", "cancelled"): break time.sleep(5) print(s["state"], [a["kind"] for a in s["artifacts"]])
The stages you will see are session, upload,
profile, target, training and
artifact. A finished run lists the artifacts it produced.
Take the winning model and run it locally
Among those artifacts is winner_source, and it is the interesting one. It is
not a checkpoint that needs our software to load — it is a self-contained Python
program that imports nothing but csv and math. It
retrains the winning model on your data and writes predictions.
That is the part worth pausing on. There is no runtime to install, no version of ours to keep, and nothing to call. You can read it, diff it, put it in your own repository and run it on a machine that has never heard of us.
import requests
JAIN = "http://localhost:8369"
run_id = run["id"] # from above
s = requests.get(f"{JAIN}/api/sessions/{run_id}").json()
winner = next(a for a in s["artifacts"] if a["kind"] == "winner_source")
src = requests.get(f"{JAIN}/api/artifacts/{winner['id']}/download")
open("model.py", "wb").write(src.content)
Then run it. Three arguments, in this order:
python3 model.py train.csv test_features.csv predictions.csv
-
train.csv— the feature columns followed by the target as the last column, and no header row. -
test_features.csv— the feature columns only, same order, no header and no target. -
predictions.csv— written by the program: one prediction per line, in the order the test rows were given.
The program opens with a docstring describing exactly what it does — which model was chosen, the arithmetic it uses, and how it is seeded. It is deterministic: the same inputs give the same bits every time.
The other artifacts
model is a zip of the trained ensemble — the native learner files plus a
manifest and the run's diagnostics. Loading it needs those learners, which is what
Jain Pro runs locally.
report is the PDF, receipt is the evidence record for the run,
and run_request is the request that produced it. Every one of them downloads
from /api/artifacts/<id>/download.
Your file is deleted automatically after 30 days. What the run made from it — your report, your trained model and its evidence receipt — is kept. See what we keep. The winning model is a file on your machine once you have downloaded it, and that copy is yours.