Commit Graph
4 Commits
Author SHA1 Message Date
Andrew Park f338d64b21 orchestrator: track the SFT training pipeline and fix ToolOrchestra tracing
The orchestrator SFT pipeline was living entirely in the working tree and
never got committed. One script in that lineage (clean_sft_data.py) has
already been lost with no way to recover it, so track the rest before the
same thing happens again:

  run_sft_fsdp.py      full-parameter FSDP trainer (launched via accelerate)
  sft_tokenize.py      conversation -> tokens + assistant-only masking
  render_sft_data.py   record -> chat-template rendering
  make_splits.py       train / holdout / overfit splits
  format_eval_sample.py, upload_to_braintrust.py
  scripts/train/       fsdp4.yaml, fsdp8.yaml, eval sbatch

toolorchestra/tracing.py was also untracked despite being imported by
unified.py and rollout.py, which left the branch broken for a fresh
checkout. Add it along with the rest of the ToolOrchestra package split.

Also here: mmlu_pro / supergpqa scorers, expert pricing for the OpenRouter
Qwen builds (estimates, flagged in-file), an expanded calculator/web_search
tool surface, and the reject-sampling clean gate that run_sft_fsdp reads
via --require-clean.

Paths in the sbatch and litellm helpers are now env-driven rather than
hardcoded to one cluster home.
2026-07-11 11:55:59 -07:00
Andrew Park 6862b50da8 orchestrator: expand tool catalog, fix shell_exec confirmation gate, wire SFT data pipeline
Tools:
- Bridge 4 more real OpenJarvis tools into the orchestrator catalog
  (think, apply_patch, pdf_extract, db_query); catalog is now 6 models
  + 11 basic tools.
- Fix the dispatch path so confirmation-gated tools actually run: the
  ToolExecutor was built with no confirm callback, so shell_exec (and
  any requires_confirmation tool) returned a "requires confirmation"
  error instead of executing -- which silently broke TerminalBench.
  Headless eval/rollouts now auto-approve.
- Drop dead-end candidates: git_* (need the unbuilt openjarvis_rust
  extension and just duplicate shell_exec), browser_* (needs Playwright),
  and knowledge_search/sql/retrieval (personal-data RAG, empty on the
  academic benchmarks).

SFT data pipeline:
- Reasoning-task loaders (GeneralThought-430K + OpenThoughts3) with an
  8K cold-start set and a 30K GRPO prompt pool.
- Domain-dispatched verifier (math/code checkers + Gemini judge fallback,
  since the OpenAI key is dead).
- Rejection-sampling generator + unified <tool_call> serializer matching
  the GRPO rollout format; base self-sampling driver.
- Drop the old paradigm/tier scaffolding (adp_loader, build, paradigms,
  select, serialize, tiers) replaced by the unified path.

Training/eval:
- SFT + GRPO configs for Qwen3.5-9B and gemma-4-12B-it.
- OrchestratorBackend + eval harness over GAIA/TerminalBench/TauBench/
  MMLU-Pro/SuperGPQA.
- Cost-aware GRPO reward.

Ignore generated data/ artifacts.
2026-06-18 20:31:40 -07:00
Andrew Park 08916ec468 feat(orchestrator): faithful ToolOrchestra unified-tool + rejection-sampling SFT pipeline
Replace the ADP-relabel cold-start with a ToolScale-backed, execution-grounded
rejection-sampling pipeline in the paper's real action space (arXiv:2511.21689).

- expert_registry: faithful unified tool calling — one named tool per model
  (gpt_5, qwen3_32b, ...) + basic tools, per-instance subset/price sampling (§3.1/3.3)
- toolorchestra/: split the 1663-line module into a package (prompts/experts/
  sandbox/clients/parsing/workers/agent), behavior preserved
- toolorchestra/rollout.py: faithful reason->act->observe loop (pure, injectable)
- toolorchestra/unified.py: real teacher caller + tool dispatch
- sft_data/toolscale.py: nvidia/ToolScale loader
- sft_data/unified_serialize.py: trajectory -> conversations JSONL (<tool_call> tags)
- sft_data/reject_sample.py: generate_sft_dataset (sample N -> verify -> keep)
- scripts/orchestrator/build_unified_sft.py: CLI
- 25 new offline tests; 127 orchestrator-learning tests green

Verifier is a gold-action-coverage proxy (full ToolScale DB checker + LLM judge
are follow-ups); deployed _run_rl still uses the 3-meta-tool eval port.
2026-06-17 11:35:55 -07:00
Andrew Park 28ef7e5cb5 feat(orchestrator): ADP-derived SFT cold-start data pipeline
Train a single ~9B orchestrator (Qwen3-8B) for local<->cloud routing via SFT
on synthetic traces derived from NeuLab ADP (agent-data-collection).

- sft_data/: full ADP trajectory loader, tier model + pricing, 4 paradigm
  renderers, reward-ranked selection, conversations-JSONL serializer, CLI
- wire sft_trainer._generate_traces() to the pipeline (no GPU / no API keys)
- Qwen3-8B SFT config + scripts/orchestrator CLI wrapper
- offline fixture tests (12)

Heuristic competence labels for the cold-start; real paradigm execution +
GRPO are the documented v2.
2026-06-05 10:27:02 -07:00