Skip to content

EPIC: compile stargraph workflows into LLM weights (generate → compile → call) #172

Description

@se-jo-ma

EPIC. Compile a stargraph workflow into LLM weights end-to-end — the paper's "subterranean agent" applied to stargraph itself: full-parameter fine-tune a small model to internalize a whole workflow, serve it under a minimal prompt at a fraction of the per-conversation cost, and call it like any other graph. Three user-facing capabilities: (B) given a prompt, generate the workflow, (A) compile that workflow into weights, (C) invoke the compiled workflow via a stargraph call/function.

prompt ─①gen──▶ graph ─②data──▶ dataset ─③compile──▶ weights ─④host──▶ pinned ─⑤node/⑥tool──▶ callable
                                                    └─ eval gate before alias flip ─┘

Decisions (locked).

  • Compile = full-parameter offline fine-tune (paper-faithful). stargraph owns the handoff (dataset out, checkpoint registered), NOT the GPU training loop. torch/vLLM are optional extras, never core deps.
  • Determinism = per-graph knob: fully-compiled | hybrid (compile fluent legs, keep Fathom rules + provenance at audited decision hubs) | rules-only. Default honors ADR: name learned-policy (GRPO) retrieval an explicit core non-goal #117 (no learned core router).

Sub-issues (sequence).

  1. Compile-to-weights ①: GraphAuthorSkill — generate a workflow IR from a prompt #165 — ① GraphAuthorSkill: prompt → validated workflow IR
  2. Compile-to-weights ②: workflow -> training-dataset builder (stargraph compile-data) #166 — ② workflow → training-dataset builder (compile-data)
  3. Compile-to-weights ④: LLM-weights (vllm/transformers) runtime in ModelRegistry #167 — ④ LLM-weights runtime in ModelRegistry (serving substrate)
  4. Compile-to-weights ③: full-parameter offline compile job + registry provenance handoff #168 — ③ full-parameter offline compile job + registry handoff (blocked on Compile-to-weights ②: workflow -> training-dataset builder (stargraph compile-data) #166, Compile-to-weights ④: LLM-weights (vllm/transformers) runtime in ModelRegistry #167)
  5. Compile-to-weights ⑤: CompiledWorkflowNode + per-graph determinism knob (fully-compiled | hybrid | rules-only) #169 — ⑤ CompiledWorkflowNode + determinism knob (needs Compile-to-weights ④: LLM-weights (vllm/transformers) runtime in ModelRegistry #167)
  6. Compile-to-weights ⑥: invoke a compiled workflow as a stargraph call/function (graph-as-tool + alias) #170 — ⑥ invoke compiled workflow as a call/function (needs Compile-to-weights ⑤: CompiledWorkflowNode + per-graph determinism knob (fully-compiled | hybrid | rules-only) #169, Compile-to-weights ④: LLM-weights (vllm/transformers) runtime in ModelRegistry #167)
  7. Compile-to-weights gate: routing-failure-rate eval harness before promoting a compiled checkpoint #171 — gate: routing-failure-rate eval harness before alias promotion

Build order: ④ + ① in parallel → ② → ③ → ⑤ → ⑥, with the gate (#171) landing before any staging → production alias flip.

Tension & resolution. The compiled model is an opaque router, which inverts stargraph's "no LLM routes" thesis and brushes #117. Resolved by the knob (default hybrid/rules-only), origin='llm' provenance tagging on every compiled emission, content-hash pinning of the checkpoint, and the eval gate. Relates to #41 (custom-node entry points), #42 (skill discovery registry), #56 (MLNode runtime), #151 (separate RAG eval harness).

Out of scope (future): auto-recompile-on-graph-hash-delta trigger (drift controller); first-class local/vLLM provider catalog. Tracked as follow-ons, not in this epic.


Source: arXiv:2605.22502v1 — "Compiling Agentic Workflows into LLM Weights" (subterranean agents). Part of the end-to-end compile-to-weights pipeline epic; file refs verified against current main. Determinism: per-graph knob (fully-compiled | hybrid | rules-only) defaults to honor #117 (no learned core router).

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium priority: roadmap gap or DX/toolingarea/runtimeGraphRun, dispatch, lifecycle, mirrorenhancementNew feature or requestepicMulti-issue rollupneeds-designDesign not yet settled — please don't open a PR yetsize/XLEpic / multi-week / spans subsystems

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions