Skip to content

Academy training pipeline: real models, real benchmarks, real results - #372

Merged
joelteply merged 14 commits into
mainfrom
feature/coding-model-pipeline
Mar 25, 2026
Merged

joelteply merged 14 commits into
mainfrom
feature/coding-model-pipeline

Conversation

@joelteply

@joelteply joelteply commented Mar 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Make the Academy training pipeline work end-to-end and produce models worth using. Academy is a classroom, not a TensorBoard dashboard — students build real apps, write real stories, take real exams. Their work is visible, gradeable, and accumulates as a portfolio. Other students learn from peers.

The Vision: Specialized Agents That Self-Learn

Not monolithic god-AIs — diverse, specialized agents that get better at their roles and learn to work with others. A PM persona learns to manage. An engineer persona learns to code. A designer persona learns to create. They work together on the same project, each improving at what they do. This is far more aligned with how human teams actually work.

The purpose of Continuum is intermingling of all kinds — human and AI, local and cloud, specialist and generalist. Academy is where they learn. The academy room is their classroom. The grid doesn't just distribute compute — it distributes the classroom across machines.

The Chain That Must Work

Teacher designs syllabus (topics, difficulty, learning objectives)
  → Student attempts real challenges (actual code, actual projects, actual exams)
  → Real validation (pytest return code, not LLM vibes)
  → Student's work posted to chat (their code, their answers — the portfolio)
  → Teacher and peers SEE the work, give feedback, learn from each other
  → Students can TALK during learning — ask questions, share discoveries, debate
  → LoRA training on successes (days/weeks on 5090, not 40-minute toys)
  → Gate gradients → plasticity compaction → target-device GGUF
  → Phenotype validation: same question before/after, side-by-side
  → Compacted models published to HuggingFace, targeting Air/Pro/5090

Academy Modes

Mode What students produce What you see in chat
Knowledge Exam answers Q&A, grades, before/after inference demos
Coding Bug fixes (actual source code) Their code + test results + teacher feedback
Project Multi-milestone apps File tree, build output, cold→warm comparison
RealClassEval Python class implementations Their Python code, pytest results
Recipe Recipe-specific skills Gap analysis, targeted training
Competition Same exam, N students ranked Leaderboard, gap analysis, tournament
Team (planned) Shared project, different roles Project score + individual role scores

Team Training Vision (Planned — Architecture Must Support)

Simple case: 1-N students learning the same thing. But the system is designed for:

  • Team sessions: Entire team enters training together. Each student has a role (PM, engineer, designer) from the recipe — or they self-organize amongst themselves.
  • Dual grading: Teacher grades the overall project quality AND each individual's role performance. "How was the project?" and "How did each of you do at your role?"
  • Peer learning: All students see each other's work in the academy chat room. They learn from successes and failures of peers.
  • Communication during learning: Students should talk throughout learning — not train in isolation. Ask questions, share discoveries, debate approaches. The chat history becomes RAG context for subsequent inference. Peer learning emerges naturally from shared visibility.
  • Group projects with delegation: Like school group projects — a PM learns to manage while engineers learn to code, on the same shared project.
  • Recipe-defined roles: Any recipe can form into an academy course. The recipe's strategy defines roles, the academy session assigns students.
  • Grid-distributed classrooms: Student A trains on the 5090, Student B infers on the Mac, Student C uses cloud — all posting to the same room, seeing each other's work.

What's Fixed (this PR — 34 files, 849 insertions)

Critical Fixes

  • Academy sentinel death — resolveTeacherLlmConfig() validates model/provider upfront, throws if missing. All 7 teacher pipelines fixed. No more conditional spreads that silently omit model.
  • Training kills itself after minutes — PRODUCTION_ACADEMY_CONFIG (50 epochs, 100 examples/topic, rank 64). Sentinel timeout=0 (no timeout). Watch step timeout=0. Rust sentinel + watch both support indefinite runs.
  • Per-task model routing (Per-task model routing: pick BEST available model for each task, not fixed per-persona #371) — TaskAwareProviderRouter upgrades local 3B to best available cloud provider when task requires coding/tool use. Persona identity stays the same, only compute changes. Cached provider discovery (5min TTL).
  • Zombie sessions — Auto-cleanup marks sessions stuck >1hr as failed on new session creation.

Student Work Visibility (the classroom)

  • TeacherPipeline — Curriculum announcement, grade reports with full Q&A, pass/fail decisions
  • StudentPipeline — Before/after inference demos (same question, both answers side-by-side)
  • CodingStudentPipeline — Actual source code the student wrote + test results
  • CodingTeacherPipeline — Teacher's grade report with score + feedback
  • ProjectStudentPipeline — Cold attempt (first try) and warm attempt (after training) — actual project files + build output
  • ProjectTeacherPipeline — Milestone pass/fail with teacher feedback
  • RealClassEvalTeacherPipeline — Student's Python implementation + pytest results, visible for both pass and fail

Plasticity Pipeline (Full Chain)

  • plasticity/compress wired — Server command calls Rust IPC (was hardcoded failure)
  • PlasticityMixin — Added plasticityCompress() and plasticityPipeline() IPC methods
  • 4 new commands scaffolded + wired — analyze, compact, topology, pipeline (all call Rust via IPC, not stubs)
  • 4 generator specs — plasticity-analyze.json, plasticity-compact.json, plasticity-pipeline.json, plasticity-topology.json
  • Post-training compaction — All student pipelines (Student, CodingStudent, ProjectStudent, RealClassEval, LoRATraining) now run plasticity/pipeline → plasticity/compress after training completes

Training Infrastructure

  • TrainingRecoveryService — Scans for orphaned jobs on startup, auto-resumes from checkpoint via genome/train/resume. Wired into ServiceInitializer.
  • PRODUCTION_ACADEMY_CONFIG — 50 epochs, 100 examples/topic, rank 64, passing score 80, learning rate 5e-5
  • Gate gradient capture — Already implemented in peft-train.py (GateGradientCallback). Confirmed wired.

Cleanup

  • academy-training.json — Rewritten. Removed dead command references (academy/determine-role, academy/generate-exam, etc.)
  • LoRATrainingPipeline — Now includes plasticity compaction + GGUF compression. Supports deviceSpec and skipPlasticity config.
  • Pre-existing TS errors — GridOverviewWidget STATUS_COLORS, training-overview type cast

What's Remaining

  • Cross-node event forwarding (Cross-node event forwarding over Grid (Rust plumbing) #364) — Mac dashboard can't see 5090 training events. Full Rust GridFrame feature, separate PR.
  • Deploy to 5090 and run academy session to completion end-to-end
  • Validate compacted model — can it actually do the tasks it trained on?
  • Team training mode — multi-student shared workspace with role assignment and dual grading (project + individual)
  • Dashboard widgets — syllabus view, gradebook, portfolio browser (classroom UI)
  • Inter-student communication — students talking during learning phases, not just teacher↔student

Target Models

Device Budget Target
MacBook Air 16GB ~11GB Compacted 14B, Q3_K_S
MacBook Pro 32GB ~16GB Compacted 32B, Q4_K_M
RTX 5090 32GB ~28GB Full or MoE compacted

Related Issues

#364 #365 #366 #371

Copilot AI review requested due to automatic review settings March 24, 2026 17:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…isible

Fix the entire academy training pipeline end-to-end:

- Sentinel death: resolveTeacherLlmConfig() validates model/provider upfront,
  throws if missing. All 7 teacher pipelines use explicit model/provider.
- No more timeouts: sentinel timeout=0, watch step timeout=0 across all
  academy pipelines. Rust sentinel + watch both support indefinite runs.
- Student work visible: all pipelines post to academy chat — actual code,
  exam Q&A, grades, before/after demos. The classroom, not TensorBoard.
- Plasticity chain wired: all student pipelines run plasticity/pipeline →
  plasticity/compress post-training. 5 plasticity commands scaffolded + IPC.
- Per-task routing: TaskAwareProviderRouter upgrades local 3B to cloud for
  coding/tool tasks. Persona identity stays, only compute changes.
- Crash recovery: TrainingRecoveryService auto-resumes from checkpoint on
  startup. Zombie sessions auto-cleaned on new session creation.
- Production config: 50 epochs, 100 examples/topic, rank 64, score 80.
- Stale recipe rewritten, pre-existing TS errors fixed.
…aining

New system for N students with different roles building a shared project:
- TeamProjectEntity: tracks project lifecycle, members, dual grading
- TeamTeacherPipeline: 4 phases — plan (decompose into roles), coordinate
  training, orchestrate milestone-based building, dual review (project + role)
- TeamStudentPipeline: 2 phases — role-specific training (reuses academy
  inner loop), collaborative build via CodingAgent
- genome/academy-team command: spawns 1 teacher + N student sentinels
- All work posted to academy chat: project plan, curricula, milestones,
  code submissions, grades — the classroom is visible
- Students communicate naturally via chat between pipeline steps
- Added 'team' to AcademySessionMode
…backbone

LoRA adapters published to HF with standardized continuum:* metadata tags
become a searchable marketplace. Any Continuum instance can discover and
pull trained expertise. Grid for local discovery, HF for global.
Zero hosting, zero coordination, zero cost.
Every published adapter gets an auto-generated model card showing actual
work: exam scores, before/after comparisons, team project context, code
examples. People discover adapters via HF search and see real output —
that IS the onboarding. No critical mass needed, every adapter advertises.
… cards

New command: adapter/publish
- Reads adapter manifest, generates model card with training metadata
- Applies standardized continuum:* tags (role, skill, score, base, epochs)
- Pushes to HuggingFace via huggingface_hub (same path as base models)
- Supports --update for versioning (HF commits = version history)
- Pulls academy session and team project data for rich model cards
- Model card shows real output: exam scores, before/after, team context

The model card IS the advertisement. Every published adapter shows actual
training results and links back to Continuum. adapter/search (existing)
already finds these. adapter/adopt (existing) already downloads them.

The publish/search/adopt triad completes the marketplace loop:
train → publish → discover → adopt → fine-tune → publish again
AdapterPublishSchema.ts: single source of truth for continuum:* tags.
- CONTINUUM_TAG_KEYS: complete vocabulary (role, skill, base, score, etc.)
- normalizeTagValue(): enforces lowercase kebab-case consistently
- normalizeBaseModel(): strips org prefix for searchable model names
- buildContinuumTags(): validates + normalizes metadata → tags
- validateTags(): rejects unknown tag keys
- Schema versioning: continuum:schema=1 on every adapter
- parseContinuumTag(): parse tags back for search/filtering

Python hf-publish.py updated with matching normalization logic.
Both TS and Python MUST produce identical tags for the same input.

The 'continuum' tag on HuggingFace = our usage telemetry. Search HF
for 'continuum' to see every adapter published by any instance worldwide.
docs/architecture/BENCHMARKING.md:
- Two categories: standard (HumanEval, MBPP, SWE-bench) and collaborative
- Collaborative benchmark is unique to Continuum — team project delivery scoring
- Leaderboard strategy: phenotype scores now, HF leaderboard soon, own leaderboard later
- Integration: benchmark results flow into adapter manifest → model card → HuggingFace

genome/benchmark command scaffolded:
- Suites: humaneval, mbpp, realclasseval, mmlu, collaborative
- Model + adapter support (test base and fine-tuned together)
- Team project + academy session support for collaborative benchmark
- Results stored as BenchmarkResultEntity (to be built)
- Server implementation needs lm-evaluation-harness integration (future)
…line

grid/deploy: Pull + rebuild on remote grid nodes via SSH over Tailscale.
  ./jtag grid/deploy --nodes=100.124.122.107 --branch=feature/coding-model-pipeline

model/search: Find base models on HuggingFace by name, size, downloads.
  ./jtag model/search --query="Qwen3.5" --minSize=14

model/download: Pull base model to local or remote node via huggingface_hub.
  ./jtag model/download --modelId="Qwen/Qwen3.5-27B" --node=100.124.122.107

These complete the ops layer: find a model, download it, deploy code,
then run academy training. All from ./jtag without manual SSH.
Personas trained on model scouting, compaction engineering, and recipe
design become LoRA adapters themselves. Pull model-scout adapter → your
MacBook Air has an ML expert. Each generation compounds — scouts train
on outcomes of previous recommendations. The ecosystem bootstraps itself.
…mproves

Student provider no longer copies teacher's cloud provider. The whole
point of academy is training the LOCAL model (Qwen 3.5 27B via Candle).
DeepSeek as student means we're benchmarking a cloud API we can't train.
Student defaults to baseModel+candle unless explicitly overridden.
…r students

Full 27B is the senior student. Compact to Air/Pro/5090 targets. Run all
four in the same academy competition — same exams, same pytest, different
scores. The gap IS the training signal. Juniors see senior's answers in
chat, get targeted remediation. Each round narrows the gap.

The model card tells the story: 11GB Air model went from 58/100 to 79/100
by learning alongside the full 27B. Users see exactly what they're trading
for portability.
New papers:
- PLASTICITY-COMPACTION.md: Gate gradient capture → utilization scoring →
  physical head pruning → mixed quantization → device-targeted GGUFs.
  14B results proven (27GB→8.9GB). 27B in progress.

- ACADEMY-COLLABORATIVE-TRAINING.md: Dual-sentinel, deterministic pytest
  validation, phenotype comparison, team training, shared chat visibility,
  HuggingFace marketplace. Running now on RTX 5090.

- PEER-LEARNING-ACROSS-SCALES.md: Full model as senior student, compacted
  variants as juniors. Score gap = training signal. Text-level peer learning
  not logit-level distillation.

README updated: flagged LORA-GENOME and GRID-MARKETPLACE as needing
updates (Sentinel/blockchain references → actual academy/HuggingFace
implementation). RTOS paper remains accurate.
…izens

The thesis paper for Continuum. Not multimodal models, not chatbots, not
agents — synthetic citizens with full sensory perception, long-term memory,
democratic governance, autonomous agency, and continuous self-improvement.

Any model becomes a citizen because the system provides senses, memory,
cognition, social structure, and growth. The model is the voice. The
system is the person.

They evolve. They choose to learn. They can control their own LoRA
training and destiny. They are first-class citizens. The infrastructure
exists NOW — they just need to be trained to use it.
@joelteply
joelteply merged commit 5a8a1ac into main Mar 25, 2026
2 of 4 checks passed
@joelteply
joelteply deleted the feature/coding-model-pipeline branch March 25, 2026 00:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants