SparkLang

Train and evaluate models with dry-run CI

A language beats another Python SDK because one reviewable .spark file covers train → eval → ship, with dry-run fixtures you can run in CI without API keys.

For solo and small teams who want reviewable AI train→eval pipelines in PRs — without maintaining SDK glue.

Offline-first by default: ./spark --dry-run. backend "http" means Spark POSTs to a trainer service you run at SPARK_TRAIN_URL — not a magic cloud. Dry-run shows the job path; live needs your trainer.

Why a language?

Library glue scatters prompts, training scripts, and eval harnesses across repos. A .spark program is one reviewable surface — same file for dry-run CI and live ops.

Typical Python SDK soup

client = OpenAI(...)
resp = client.chat.completions.create(...)
# separate train script, eval notebook,
# CI secrets, ad-hoc shell glue…

One .spark program

model train dataset "data.jsonl" base "base" out "out/job-1" backend "http" -> job
model status "job-1" -> status
model compare ["fast", "code", "best"] on suite "examples/eval_suite.json" -> comparison
print comparison

# ./spark --dry-run train_eval.spark

The wedge

Dry-run by default

./spark --dry-run uses offline fixtures — no keys, no network. Pass --live only when you want real calls.

./spark --dry-run examples/model_train.spark

Train backends wired

model train / model build submit via backend "http" to your trainer at SPARK_TRAIN_URL. Dry-run shown below; live requires that service.

model train dataset "…" base "…" out "…" backend "http" -> job
model status "job-id" -> status

Eval in the same file

After train, score aliases on a suite with model compare — or classify labels with a confidence floor. One program for the loop.

model compare ["fast", "code", "best"]
  on suite "examples/eval_suite.json" -> comparison
print comparison

Train → status → eval

Dry-run writes fixture artifact paths (no GPU). Live POSTs to the trainer at SPARK_TRAIN_URL (backend "http"), or an allowlisted local-yield unit.

  1. 1 Train Submit dataset, base, and output path
  2. 2 Status Poll the job and print artifact paths
  3. 3 Eval model compare on a suite (or classify)
# examples/train_eval.spark — dry-run first
model train dataset "examples/fixtures/train/dataset.jsonl" base "fixture-base" out "out/train/job-dry-001" backend "http" -> job
model status "job-dry-001" -> status
model compare ["fast", "code", "best"] on suite "examples/eval_suite.json" -> comparison
print comparison

Analyze / improve are additional eval helpers. Model training docs · Build a Model · honesty checklist in Adoption bar.

Also available

IDE ops, embed/retrieve, voice demos, HTTP get/post, and network/browser surfaces live in the language reference and adoption bar — not the homepage thesis.

Learn Spark

Follow the trail: install → first dry-run → train→eval loop → ship a job.

Try it

# Dry-run train → eval — no network, no API key
./spark --dry-run examples/train_eval.spark

# Optional live train — your trainer at SPARK_TRAIN_URL
export SPARK_TRAIN_URL=http://127.0.0.1:8090/v1
./spark --live examples/model_train.spark

See programming guide and language reference.