The LLM Sandwich: Automating AI with Deterministic Tools
LLMs are powerful yet prone to non-deterministic errors, requiring a structured approach to ensure reliability. By sandwiching AI between deterministic tools and formal processes, developers can capture the brilliance of LLMs while minimizing their clumsiness. Beagle SCM enables this by allowing AI to script its own automated routines in JavaScript.
Key Points
- LLMs are brilliant at high-level reasoning but inherently clumsy and non-deterministic.
- AI inconsistency should be managed by sandwiching the LLM between deterministic tools and formal workflows.
- Malleable processes allow the LLM to automate its own repetitive actions into reliable, simple tools.
- Beagle SCM enables this philosophy by providing a JavaScript layer for LLMs to script their own routines.
Sentiment
The overall sentiment is supportive and constructively critical. Most commenters agree with the article's central point that repeatable work should be pushed into deterministic tools and that LLMs should be used for tool creation, orchestration, or judgment rather than as fragile substitutes for scripts. The disagreement is not mainly rejection of the thesis, but refinement: commenters want clearer implementation examples, stronger guardrail models, and more precise language about whether the real problem is nondeterminism, ambiguity, or rule-following.
In Agreement
- Domain-specific tool layers can turn broad, unstable model tasks into narrow, reliable choices, especially in browser automation and other UI workflows.
- For code refactoring, asking an LLM to generate compiler-aware transformations or AST-based scripts is safer than asking it to directly edit large codebases.
- Agents should be used as glue or tool builders, with deterministic scripts handling repeated API calls, parsing, testing, validation, and mechanical transformations.
- LLMs are well suited to helping convert manual processes into documented procedures, commands, scripts, and eventually stable automation.
- Formal checkers and proof systems can pair well with LLMs because they provide feedback loops that constrain model output.
- Organizations should prefer deterministic software for repeatable tasks, then use LLMs for ambiguous judgment or tool creation, instead of forcing AI into every workflow.
Opposed
- The article reads more like a promising introduction than a complete explanation, and readers want concrete examples of how Beagle prevents real agent failures.
- Nondeterminism may be the wrong framing; natural-language ambiguity, limited model cognition, and unreliable rule-following are arguably the deeper issues.
- If an agent can modify tests, hooks, or guardrails, deterministic checks may not help unless enforcement is external or protected from the agent.
- Formal specifications can be as hard to write correctly as implementations, so formal methods only help when the specification is substantially simpler than the target system.
- Humans and software development processes are not fully deterministic either, so the more important goal may be reliable outcomes rather than deterministic creation processes.
- Some commenters worry that the post is too close to a product teaser and does not yet show enough practical detail to evaluate the claims.