Skip to content

Repository files navigation

Nabla

A task generator learns to find the weak spots of a small student model —
the student trains on exactly those weak spots. Asymmetric self-play, end to end.

PyPI Python 3.11+ License: MIT Status: pre-Phase-0 Last commit PRs welcome

What is Nabla · Quickstart · Project layout · Documentation · Contributing


What is Nabla?

Nabla is a self-improving training system. A task generator model learns to probe the weak spots of a small student model; the student improves by training on exactly the tasks that expose those weaknesses. Each round raises the bar the generator has to clear next — asymmetric self-play, run on Freesolo Flash.

The pipeline, in order:

Stage What it does Status
CLI harvest Scans a repo for OpenAI call sites, records real traffic, and distills one into a portable <site>.profile.json ✅ shipped (PyPI, v0.9.1)
Phase 0 — seed generation Parallel LangGraph agents generate & verify 20–50 seed tasks in the difficulty band the student sometimes solves ✅ shipped
Phase 1 — frozen evals Held-out, stress (OOD), and constrained-decoding baseline eval sets, built before any training ✅ shipped
Phase 2 — self-play loop Generator and student train iteratively via GRPO; difficulty-targeting reward, novelty gate against collapse ✅ shipped
Phase 3 — Replace Swap your expensive key for the cheap fine tuned one! ✅ shipped

Quickstart

The CLI is the only piece meant for outside use today. It finds an OpenAI call site in your repo and hands back a self-contained profile — prompt template, resolved schema, sampling params, recorded examples — that downstream training codes against instead of your source.

pip install nabla-cli

nabla init      # one-time setup: provider + API key
nabla scan      # find OpenAI call sites in the current repo
nabla capture   # record real (prompt, completion) traffic for one site
nabla build     # distill it into <site>.profile.json

No flags needed for a single-call-site repo. nabla jeremy swaps the last step for a generator-ready seed spec (<site>.jeremy.json); nabla push then hands the artifacts to the seed-generation backend, and nabla pull previews the eventual swap-back that rewrites the call site onto your fine-tuned model (a simulation today — the deployments API isn't live yet). See demo/gsm-tutor for a worked example — a small tutoring API with its own harvested profile — and the CLI docs for the full command reference and troubleshooting.

See it in action
$ nabla scan
SYMBOL             FILE                     KIND   VERIFIABILITY  FLAGS
extract_invoice     app/invoice_extract.py  create json_schema    -

1 call site found.

$ nabla capture
nabla capture: sample 1/6 -> 1 capture(s)
nabla capture: sample 2/6 -> 1 capture(s)
...
captured 6 (prompt, completion) pairs from site extract_invoice -> extract_invoice.captured.jsonl

$ nabla build
nabla build: goal — "Extract structured invoice fields (total, currency,
due date) from free-form invoice or receipt text, normalizing
locale-specific number and date formats."
nabla build: wrote extract_invoice.profile.json (site 4f2a9b1c3d8e…, supported=True, 6 examples)

Project layout

cli/         nabla-cli — the harvester (shipped, PyPI: nabla-cli)
backend/     Phase 0 seed generation — LangGraph agents + student evaluator
self-play/   Phase 2 self-play loop — GRPO, both tracks
frontend/    Next.js dashboard + docs site
demo/        gsm-tutor (worked example) and a standalone harvested profile

Documentation

  • CLI reference — install, commands, troubleshooting
  • Project spec — phases, tracks, models, rewards, risks
  • Pipeline plan — how the CLI feeds Phase 0
  • Interactive docs site (search, sidebar nav) ships in frontend/ — run npm run dev inside it and open /docs

Contributing

Issues and PRs are welcome. There's no formal contributing guide yet — for anything beyond a small fix, open an issue first to align on scope, since large parts of this repo (backend/, self-play/) are still shifting quickly.

License

MIT — see cli/pyproject.toml.

About

HackThe6ix 2026, Self Play Differentiates

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages