Workflow Forge: Open Source Launch - GPU-Native Flow Control for AI Workflows

smithblack: <p>This is a crosspost from the huggingface forums, with original post located here <a href="https://discuss.huggingface.co/t/workflow-forge-open-source-heavy-duty-workflow-system/159007" rel="noopener nofollow ugc">link</a>. Mods, please feel free to move this to a different catagory if needed, but I think I found the right one?</p>
<p>A few weeks ago, I posted an RFC about a system I’d built for my research needs - a way to let AI models control their own prompt feeds through GPU-native token stream interception. The response was encouraging, so I’ve spent the time since then getting everything production-ready for open source. That response chain was located here: <a href="https://discuss.huggingface.co/t/request-for-comments-simple-universal-prompting-system/157648/4" rel="noopener nofollow ugc">SUPS</a></p>
<p>I have gone through with developing this into open source status, as I had enough interest. I think the broader community will find it very useful.</p>
<p>Please note this is still under development, and I want to have an initial version done within a month or so to compete in ARC. Nonetheless, since the core architecture is planned out and proof-of-concepted, and I have a UDPL parser and the entire Token Triggered Finite Autonoma backend mapped out, I think I am going to open source it and release the broader picture, the repo, and the current status. It is currently released as an open source github project <a href="https://github.com/smithblack-0/WorkflowForge?tab=readme-ov-file" rel="noopener nofollow ugc">here</a>. This is also the primary coordination point atm; if anyone wants to volunteer to get a website set up I am all in on the idea.</p>
<p>The intention is to have something community and production grade that may serve as a new, better standard for complex workflow. The staged design means existing bespoke prompting config languages can still use the backend if they can compile to ZCP, or you can write your own backend with extended functionality.</p>
<h2><a name="p-471691-the-core-problem-1" class="anchor" href="#p-471691-the-core-problem-1"></a>The Core Problem</h2>
<p>Complex AI workflows force you to choose between “simple but inflexible” tools and “powerful but brittle” frameworks. Want multi-step reasoning with flow control? You’re writing Python glue code with constant CPU-GPU round trips. It’s like being stuck with BASIC or Assembly when you need C++.</p>
<h2><a name="p-471691-what-workflow-forge-does-2" class="anchor" href="#p-471691-what-workflow-forge-does-2"></a>What Workflow Forge Does</h2>
<p>Instead of calling the model multiple times with different prompts, Workflow Forge lets the model <strong>control its own execution flow</strong> during a single generation:</p>
<pre><code class="lang-auto">Model generates: "I need to think more... [Jump]"
                                            ^
Workflow Forge intercepts this token -------|
                 
Instantly begin to replace stream with: "Let me reconsider the problem..."

One token is replaced per generative step until all tokens in the prompt are used, and model then continues generating from new context.
</code></pre>
<p><strong>This happens entirely in tensor operations</strong> - no Python roundtrips, no generation restarts, no external orchestration. The model literally loads precompiled and tokenized prompts by generating special control tokens, then reads through them and generates its own responses. This happens in parallel, during evaluation, across batches, and with flow control.</p>
<h2><a name="p-471691-how-workflow-forge-compares-to-existing-tools-3" class="anchor" href="#p-471691-how-workflow-forge-compares-to-existing-tools-3"></a>How Workflow Forge Compares to Existing Tools</h2>
<div class="md-table">
<table>
<thead>
<tr>
<th>Tool</th>
<th style="text-align:center">Easy to Start</th>
<th style="text-align:center">Scale &amp; Change</th>
<th style="text-align:center">Serial Prompts</th>
<th style="text-align:center">Flow Control</th>
<th style="text-align:center">GPU-Native</th>
<th style="text-align:center">Batched</th>
<th style="text-align:center">Tool Use</th>
<th style="text-align:center">Online Interaction</th>
<th style="text-align:center">Production Ready</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>LangChain</strong></td>
<td style="text-align:center"><img src="https://discuss.pytorch.org/images/emoji/apple/white_check_mark.png?v=14" title=":white_check_mark:" class="emoji only-emoji" alt=":white_check_mark:" loading="lazy" width="20" height="20"></td>
<td style="text-align:center"><img src="https://discuss.pytorch.org/images/emoji/apple/cross_mark.png?v=14" title=":cross_mark:" class="emoji only-emoji" alt=":cross_mark:" loading="lazy" width="20" height="20"></td>
<td style="text-align:center"><img src="https://discuss.pytorch.org/images/emoji/apple/white_check_mark.png?v=14" title=":white_check_mark:" class="emoji only-emoji" alt=":white_check_mark:" loading="lazy" width="20" height="20"></td>
<td style="text-align:center"><img src="https://discuss.pytorch.org/images/emoji/apple/cross_mark.png?v=14" title=":cross_mark:" class="emoji only-emoji" alt=":cross_mark:" loading="lazy" width="20" height="20"></td>
<td style="text-align:center"><img src="https://discuss.pytorch.org/images/emoji/apple/cross_mark.png?v=14" title=":cross_mark:" class="emoji only-emoji" alt=":cross_mark:" loading="lazy" width="20" height="20"></td>
<td style="text-align:center"><img src="https://discuss.pytorch.org/images/emoji/apple/cross_mark.png?v=14" title=":cross_mark:" class="emoji only-emoji" alt=":cross_mark:" loading="lazy" width="20" height="20"></td>
<td style="text-align:center"><img src="https://discuss.pytorch.org/images/emoji/apple/white_check_mark.png?v=14" title=":white_check_mark:" class="emoji only-emoji" alt=":white_check_mark:" loading="lazy" width="20" height="20"></td>
<td style="text-align:center"><img src="https://discuss.pytorch.org/images/emoji/apple/white_check_mark.png?v=14" title=":white_check_mark:" class="emoji only-emoji" alt=":white_check_mark:" loading="lazy" width="20" height="20"></td>
<td style="text-align:center"><img src="https://discuss.pytorch.org/images/emoji/apple/white_check_mark.png?v=14" title=":white_check_mark:" class="emoji only-emoji" alt=":white_check_mark:" loading="lazy" width="20" height="20"></td>
</tr>
<tr>
<td><strong>AutoGen</strong></td>
<td style="text-align:center"><img src="https://discuss.pytorch.org/images/emoji/apple/cross_mark.png?v=14" title=":cross_mark:" class="emoji only-emoji" alt=":cross_mark:" loading="lazy" width="20" height="20"></td>
<td style="text-align:center"><img src="https://discuss.pytorch.org/images/emoji/apple/warning.png?v=14" title=":warning:" class="emoji only-emoji" alt=":warning:" loading="lazy" width="20" height="20"></td>
<td style="text-align:center"><img src="https://discuss.pytorch.org/images/emoji/apple/white_check_mark.png?v=14" title=":white_check_mark:" class="emoji only-emoji" alt=":white_check_mark:" loading="lazy" width="20" height="20"></td>
<td style="text-align:center"><img src="https://discuss.pytorch.org/images/emoji/apple/warning.png?v=14" title=":warning:" class="emoji only-emoji" alt=":warning:" loading="lazy" width="20" height="20"></td>
<td style="text-align:center"><img src="https://discuss.pytorch.org/images/emoji/apple/cross_mark.png?v=14" title=":cross_mark:" class="emoji only-emoji" alt=":cross_mark:" loading="lazy" width="20" height="20"></td>
<td style="text-align:center"><img src="https://discuss.pytorch.org/images/emoji/apple/cross_mark.png?v=14" title=":cross_mark:" class="emoji only-emoji" alt=":cross_mark:" loading="lazy" width="20" height="20"></td>
<td style="text-align:center"><img src="https://discuss.pytorch.org/images/emoji/apple/white_check_mark.png?v=14" title=":white_check_mark:" class="emoji only-emoji" alt=":white_check_mark:" loading="lazy" width="20" height="20"></td>
<td style="text-align:center"><img src="https://discuss.pytorch.org/images/emoji/apple/white_check_mark.png?v=14" title=":white_check_mark:" class="emoji only-emoji" alt=":white_check_mark:" loading="lazy" width="20" height="20"></td>
<td style="text-align:center"><img src="https://discuss.pytorch.org/images/emoji/apple/white_check_mark.png?v=14" title=":white_check_mark:" class="emoji only-emoji" alt=":white_check_mark:" loading="lazy" width="20" height="20"></td>
</tr>
<tr>
<td><strong>Guidance</strong></td>
<td style="text-align:center"><img src="https://discuss.pytorch.org/images/emoji/apple/warning.png?v=14" title=":warning:" class="emoji only-emoji" alt=":warning:" loading="lazy" width="20" height="20"></td>
<td style="text-align:center"><img src="https://discuss.pytorch.org/images/emoji/apple/warning.png?v=14" title=":warning:" class="emoji only-emoji" alt=":warning:" loading="lazy" width="20" height="20"></td>
<td style="text-align:center"><img src="https://discuss.pytorch.org/images/emoji/apple/white_check_mark.png?v=14" title=":white_check_mark:" class="emoji only-emoji" alt=":white_check_mark:" loading="lazy" width="20" height="20"></td>
<td style="text-align:center"><img src="https://discuss.pytorch.org/images/emoji/apple/warning.png?v=14" title=":warning:" class="emoji only-emoji" alt=":warning:" loading="lazy" width="20" height="20"></td>
<td style="text-align:center"><img src="https://discuss.pytorch.org/images/emoji/apple/cross_mark.png?v=14" title=":cross_mark:" class="emoji only-emoji" alt=":cross_mark:" loading="lazy" width="20" height="20"></td>
<td style="text-align:center"><img src="https://discuss.pytorch.org/images/emoji/apple/cross_mark.png?v=14" title=":cross_mark:" class="emoji only-emoji" alt=":cross_mark:" loading="lazy" width="20" height="20"></td>
<td style="text-align:center"><img src="https://discuss.pytorch.org/images/emoji/apple/cross_mark.png?v=14" title=":cross_mark:" class="emoji only-emoji" alt=":cross_mark:" loading="lazy" width="20" height="20"></td>
<td style="text-align:center"><img src="https://discuss.pytorch.org/images/emoji/apple/white_check_mark.png?v=14" title=":white_check_mark:" class="emoji only-emoji" alt=":white_check_mark:" loading="lazy" width="20" height="20"></td>
<td style="text-align:center"><img src="https://discuss.pytorch.org/images/emoji/apple/white_check_mark.png?v=14" title=":white_check_mark:" class="emoji only-emoji" alt=":white_check_mark:" loading="lazy" width="20" height="20"></td>
</tr>
<tr>
<td><strong>OpenAI API</strong></td>
<td style="text-align:center"><img src="https://discuss.pytorch.org/images/emoji/apple/white_check_mark.png?v=14" title=":white_check_mark:" class="emoji only-emoji" alt=":white_check_mark:" loading="lazy" width="20" height="20"></td>
<td style="text-align:center"><img src="https://discuss.pytorch.org/images/emoji/apple/cross_mark.png?v=14" title=":cross_mark:" class="emoji only-emoji" alt=":cross_mark:" loading="lazy" width="20" height="20"></td>
<td style="text-align:center"><img src="https://discuss.pytorch.org/images/emoji/apple/white_check_mark.png?v=14" title=":white_check_mark:" class="emoji only-emoji" alt=":white_check_mark:" loading="lazy" width="20" height="20"></td>
<td style="text-align:center"><img src="https://discuss.pytorch.org/images/emoji/apple/cross_mark.png?v=14" title=":cross_mark:" class="emoji only-emoji" alt=":cross_mark:" loading="lazy" width="20" height="20"></td>
<td style="text-align:center"><img src="https://discuss.pytorch.org/images/emoji/apple/cross_mark.png?v=14" title=":cross_mark:" class="emoji only-emoji" alt=":cross_mark:" loading="lazy" width="20" height="20"></td>
<td style="text-align:center"><img src="https://discuss.pytorch.org/images/emoji/apple/cross_mark.png?v=14" title=":cross_mark:" class="emoji only-emoji" alt=":cross_mark:" loading="lazy" width="20" height="20"></td>
<td style="text-align:center"><img src="https://discuss.pytorch.org/images/emoji/apple/white_check_mark.png?v=14" title=":white_check_mark:" class="emoji only-emoji" alt=":white_check_mark:" loading="lazy" width="20" height="20"></td>
<td style="text-align:center"><img src="https://discuss.pytorch.org/images/emoji/apple/white_check_mark.png?v=14" title=":white_check_mark:" class="emoji only-emoji" alt=":white_check_mark:" loading="lazy" width="20" height="20"></td>
<td style="text-align:center"><img src="https://discuss.pytorch.org/images/emoji/apple/white_check_mark.png?v=14" title=":white_check_mark:" class="emoji only-emoji" alt=":white_check_mark:" loading="lazy" width="20" height="20"></td>
</tr>
<tr>
<td><strong>Workflow Forge</strong></td>
<td style="text-align:center"><img src="https://discuss.pytorch.org/images/emoji/apple/warning.png?v=14" title=":warning:" class="emoji only-emoji" alt=":warning:" loading="lazy" width="20" height="20"></td>
<td style="text-align:center"><img src="https://discuss.pytorch.org/images/emoji/apple/white_check_mark.png?v=14" title=":white_check_mark:" class="emoji only-emoji" alt=":white_check_mark:" loading="lazy" width="20" height="20"></td>
<td style="text-align:center"><img src="https://discuss.pytorch.org/images/emoji/apple/white_check_mark.png?v=14" title=":white_check_mark:" class="emoji only-emoji" alt=":white_check_mark:" loading="lazy" width="20" height="20"></td>
<td style="text-align:center"><img src="https://discuss.pytorch.org/images/emoji/apple/white_check_mark.png?v=14" title=":white_check_mark:" class="emoji only-emoji" alt=":white_check_mark:" loading="lazy" width="20" height="20"></td>
<td style="text-align:center"><img src="https://discuss.pytorch.org/images/emoji/apple/white_check_mark.png?v=14" title=":white_check_mark:" class="emoji only-emoji" alt=":white_check_mark:" loading="lazy" width="20" height="20"></td>
<td style="text-align:center"><img src="https://discuss.pytorch.org/images/emoji/apple/white_check_mark.png?v=14" title=":white_check_mark:" class="emoji only-emoji" alt=":white_check_mark:" loading="lazy" width="20" height="20"></td>
<td style="text-align:center"><img src="https://discuss.pytorch.org/images/emoji/apple/warning.png?v=14" title=":warning:" class="emoji only-emoji" alt=":warning:" loading="lazy" width="20" height="20"></td>
<td style="text-align:center"><img src="https://discuss.pytorch.org/images/emoji/apple/warning.png?v=14" title=":warning:" class="emoji only-emoji" alt=":warning:" loading="lazy" width="20" height="20"></td>
<td style="text-align:center">Soon!</td>
</tr>
</tbody>
</table>
</div><h3><a name="p-471691-legend-4" class="anchor" href="#p-471691-legend-4"></a>Legend</h3>
<ul>
<li><img src="https://discuss.pytorch.org/images/emoji/apple/white_check_mark.png?v=14" title=":white_check_mark:" class="emoji" alt=":white_check_mark:" loading="lazy" width="20" height="20"> <strong>Yes</strong> - Strong capability</li>
<li><img src="https://discuss.pytorch.org/images/emoji/apple/warning.png?v=14" title=":warning:" class="emoji" alt=":warning:" loading="lazy" width="20" height="20"> <strong>Somewhat</strong> - Limited or requires workarounds</li>
<li><img src="https://discuss.pytorch.org/images/emoji/apple/cross_mark.png?v=14" title=":cross_mark:" class="emoji" alt=":cross_mark:" loading="lazy" width="20" height="20"> <strong>No</strong> - Not supported or very difficult</li>
</ul>
<h3><a name="p-471691-what-each-column-means-5" class="anchor" href="#p-471691-what-each-column-means-5"></a>What Each Column Means</h3>
<ul>
<li><strong>Easy to Start:</strong> Can you get a basic workflow running quickly?</li>
<li><strong>Scale &amp; Change:</strong> How easy is it to modify complex workflows or scale to thousands of samples?</li>
<li><strong>Serial Prompts:</strong> Support for chaining multiple prompts together?</li>
<li><strong>Flow Control:</strong> Loops, conditionals, branching based on model outputs?</li>
<li><strong>GPU-Native:</strong> Execution stays on GPU without Python roundtrips?</li>
<li><strong>Batched:</strong> Run many independent workflow instances in parallel?</li>
<li><strong>Tool Use:</strong> Function calling, external API integration, tool orchestration?</li>
<li><strong>Online Interaction:</strong> Real-time chat, user input, interactive workflows?</li>
<li><strong>Production Ready:</strong> Stable and ready for production use today?</li>
</ul>
<h3><a name="p-471691-the-trade-offs-6" class="anchor" href="#p-471691-the-trade-offs-6"></a>The Trade-offs</h3>
<p><strong>Workflow Forge</strong> trades immediate usability for powerful capabilities - it’s harder to get started but offers unique features like GPU-native batched execution with model-driven flow control that other tools can’t match.</p>
<p><strong>Choose Workflow Forge when:</strong> You need mass synthetic data generation, complex reasoning chains with flow control, or research requiring hundreds/thousands of parallel reasoning paths.</p>
<p><strong>Choose existing tools when:</strong> You need production-ready systems today, simple prompt chains, are just getting started with AI workflows, or do not feel comfortable extending your tokenizer and embeddings.</p>
<p>I will mention that it is designed to be a LangChain replacement eventually if interest materializes; It can be extended for single-user sessions across threads that even include tool usage. Nonetheless, while I plan on using it this way it is not the immediate point.</p>
<h2><a name="p-471691-intended-trajectory-and-commitments-7" class="anchor" href="#p-471691-intended-trajectory-and-commitments-7"></a>Intended trajectory and commitments.</h2>
<p>Ultimately, I would be thrilled to see this eventually be taken up under the umbrella of one of the existing mature open source organizations. Lets get the core release done first, though, and I will maintain it for at least two years myself.</p>
<h2><a name="p-471691-the-architecture-4-stage-compilation-pipeline-8" class="anchor" href="#p-471691-the-architecture-4-stage-compilation-pipeline-8"></a>The Architecture (4-Stage Compilation Pipeline)</h2>
<p>Workflow Forge uses a 4-stage compilation pipeline inspired by traditional compilers. An extra stage exists as it turns out flow control is easier to capture in python rather than TOML:</p>
<pre><code class="lang-auto">UDPL (Config) → SFCS (Programming) → ZCP (Bytecode) → TTFA (Execution)
     ↓               ↓                  ↓               ↓
TOML Files → Python Flow Control → IR Graph → GPU Tensors
</code></pre>
<p>Each stage is modular and extensible - you can write your own frontend languages or target different backends.</p>
<p><strong>Key technical insight:</strong> Vector indexing in tensors = pointer dereferencing. Add a program counter and you have a complete computer running batched flow control entirely on the GPU.</p>
<h2><a name="p-471691-whats-actually-built-and-working-9" class="anchor" href="#p-471691-whats-actually-built-and-working-9"></a>What’s Actually Built and Working</h2>
<p><strong>Architecture Planning and Modules</strong></p>
<ul>
<li>This is not general purpose computation. A restricted subset of control, smart TOML, and a new kind of graph subset eliminates entire catagories of errors.</li>
<li>Intuitive flow control and prompt structuring.</li>
<li>Main dependencies between stages, though I no doublt missed a few.</li>
</ul>
<p><strong>Complete UDPL Parsing Pipeline</strong></p>
<ul>
<li>Human-readable TOML configuration for complex prompt sequences.</li>
<li>Comprehensive error checking across 5 functional stages. If there is an issue, it will tell you how and where.</li>
<li>Full unit test coverage with proper CI/CD</li>
</ul>
<p><strong>Infrastructure</strong></p>
<ul>
<li>MIT licensed and properly open sourced</li>
<li>GitHub Actions CI pipeline</li>
<li>Initial Python packaging with pyproject.toml. No experimental release yet, though, we will wait until the core system is operational unless pressured otherwise</li>
<li>Contributions guidelines.</li>
<li>Living documentation and examples</li>
</ul>
<h3><a name="p-471691-in-active-development-near-future-10" class="anchor" href="#p-471691-in-active-development-near-future-10"></a>In Active Development; near future</h3>
<p><strong>In Active Development</strong></p>
<ul>
<li>SFCS flow control compilation</li>
<li>TTFA execution engine with modular “OS kernel” design</li>
</ul>
<h3><a name="p-471691-in-active-development-more-remote-future-beyond-one-to-two-months-11" class="anchor" href="#p-471691-in-active-development-more-remote-future-beyond-one-to-two-months-11"></a>In active development; more remote future beyond one to two months.</h3>
<ul>
<li>Tool usage.</li>
<li>User stream tool</li>
</ul>
<h3><a name="p-471691-under-consideration-12" class="anchor" href="#p-471691-under-consideration-12"></a>Under Consideration</h3>
<ul>
<li>Automatic special token extension tools</li>
<li>Automatic special token fine-tuning data synthesis tools.</li>
<li>“Hello World” guide and quickstart abbreviations to make this a LangChain replacement tool too.</li>
</ul>
<h2><a name="p-471691-real-example-philosophical-self-play-13" class="anchor" href="#p-471691-real-example-philosophical-self-play-13"></a>Real Example - Philosophical Self-Play</h2>
<p>Here’s what a complete workflow looks like using the actual UDPL syntax. While this cannot currently run, the architecture is planned out to this point. These are the commands, and the way to use them, you use in a real workflow.</p>
<p><strong>UDPL Configuration (TOML):</strong></p>
<pre data-code-wrap="toml"><code class="lang-toml">[config]
zone_tokens = ["[Prompt]", "[Answer]", "[EOS]"]
sequences = ["control", "reasoning", "conclusion"]
valid_tags = ["Training", "Correct", "Feedback"]
control_token = "[Jump]"
escape_token = "[Escape]"

[[control]]
text = """
[Prompt] If satisfied with your answer, emit [Escape] "[Jump]".
Otherwise continue thinking. If this is the first time you have seen this,
say nothing.
[Answer]
"""
tags = [[], []]

[[reasoning]]
text = """
[Prompt]
Answer the following question, thinking it
through from a first person perspective {user_question}
[Answer]"""
[reasoning.user_question]
type="control"
name="question"

[[conclusion]]
text = "[Prompt] State your final conclusion. Only tokens after the answer count. [Answer]"
tags = [[], ["answer"]]
</code></pre>
<p><strong>SFCS Programming (Python-like):</strong></p>
<pre data-code-wrap="python"><code class="lang-python"># Parse configuration
sequences, config = forge.parse_udpl_file("workflow.toml")

# Program the flow control
program = forge.new_program(sequences, resources, config, tokenizer)
with program.loop("control") as loop:
    loop.run("reasoning", question="Are you alive?")  # Model decides when to break via [Jump] token
program.run("conclusion")
program.extract("training_data", tags=["answer"])

# Compile to execution engine
controller_factory = program.compile()
</code></pre>
<p><strong>Deployment (Batched Sampling):</strong></p>
<pre data-code-wrap="python"><code class="lang-python"># Each batch creates independent workflow streams
samples = []
for batch in range(1000):
    
    # Note that this sets up the FSM backend. No further dynamic injection is possible. 
    flow_manager = controller_factory(batch_size=32, starting_token="[BOS]")
    
    # Workflow runs autonomously on GPU
    while not flow_manager.done():
        tokens = flow_manager.next()      # Get next tokens to feed
        tokens = model.generate(tokens)   # Model generates response
        flow_manager.advance(tokens)      # System processes output
    
    # Extract results
    results = flow_manager.extract()
    for batch in results:
        samples.append(results["training_data"])
</code></pre>
<h2><a name="p-471691-why-this-matters-14" class="anchor" href="#p-471691-why-this-matters-14"></a>Why This Matters</h2>
<p><strong>Single Workflow, Multiple Streams (SWMS):</strong> One workflow definition, but each batch element makes different decisions based on what it generates. Perfect for massive synthetic data generation where you want variety in the reasoning paths.</p>
<p><strong>Zero-Latency Flow Control:</strong> Model decisions instantly change execution path without dropping back to Python.</p>
<p><strong>Mass Sampling:</strong> Designed for evaluation and particularly suitable for mass sampling of a particular workflow, as in synthetic training data generation.</p>
<p><strong>Simple Deployment:</strong> Once compiled, using it is as simple as passing the token stream through a function.</p>