AquinLabs

Templates

Copy-pasteable recipe and pipeline templates. Legacy ML “recipes” meant ingest→train→eval→register with step cache — in aq that is a train folder: paths in recipe.yaml, verbs for steps, artifacts/ as the cache. Start from a template, edit paths, run.

PrerequisiteTrain folder · aq init or copy a template into recipe.yaml · kernel deps installed

Pipeline shell · ingest → train → eval → register

Copy-paste flow. Artifacts under artifacts/ act as the step cache: re-run aq train only when recipe/data change; eval/register reuse the last checkpoint.

shell
 # from a train folder with recipe.yaml + data
$aq train                 # fit → artifacts/checkpoints/
$aq eval                  # gate → metrics.jsonl + pass/fail
$aq status                # register view: run record + logged model id
 # optional SDK register stamp
$python -c "from aquin import log_model; log_model('artifacts/checkpoints/last.json')"

Legacy ‘recipe pipeline’ tools did ingest→train→eval→register with step cache. In aq the train folder is that pipeline: paths in recipe.yaml are ingest; verbs are steps; artifacts/ is the cache.

recipe.yaml · tabular ridge

Classical DS path. Point data.path at your CSV; flip method as needed.

yaml
family: tabular
method: ridge
lambda: 1.0
data:
  path: data.csv
  target: y
eval:
  metric: mse
  min_score: null
# optional
# capture:
#   code: true
#   env: lock
 

Methods: linear | logistic | ridge | lasso | elasticnet | tree | forest | boosting | gp.

recipe.yaml · tabular classify

Logistic / forest / boosting classification with accuracy gate.

yaml
family: tabular
method: logistic
data:
  path: data.csv
  target: label
eval:
  metric: accuracy
  min_score: 0.8
 

recipe.yaml · LLM LoRA

PEFT fine-tune. model: required. QLoRA needs CUDA + bitsandbytes (swap method: qlora).

yaml
family: llm
method: lora
model: meta-llama/Llama-3.2-1B-Instruct
objective: lora
rank: 16
alpha: 32
steps: 100
lr: 2.0e-4
data:
  path: data.jsonl
  prompt: prompt
  completion: completion
eval:
  metric: loss
 

recipe.yaml · transformer encoder

HF encoder classification / token tasks.

yaml
method: transformer
model: bert-base-uncased
arch: encoder
steps: 50
data:
  path: data.csv
  text: text
  target: label
eval:
  metric: accuracy
 

recipe.yaml · vision CNN

Image folder layout; see methods/vision docs and scripts/tests/cnn-vision.

yaml
family: vision
method: cnn
data:
  path: data/
  # class subfolders or CSV of paths — match your train fixture
eval:
  metric: accuracy
 

recipe.yaml · guard + capture

Bolt onto any template: fail-closed watches + code/env snapshot.

yaml
# …family/method/data/eval…
guard:
  safety: true
  leak: true
capture:
  code: true
  env: lock
 

SDK · Aquin.define (writes recipe.yaml)

Same path map as YAML; then train/eval/register in a few lines.

python
from aquin import Aquin
 
aq = Aquin.define(
    family="tabular",
    method="ridge",
    data={"path": "data.csv", "target": "y"},
    eval={"metric": "mse"},
    config_path="recipe.yaml",
)
aq.train()
print(aq.eval())
print(aq.status())  # run record + logged model