A test utility that simulates LLM output without burning tokens.
Generate plausible-looking gibberish text with configurable delays to test Duso's concurrency model and worker swarms at scale without making actual LLM API calls.
Perfect for testing:
zlm = require("zlm")
// Generate mock output with default params (200 tokens, 1.5s delay)
text = zlm.prompt()
// Custom parameters
text = zlm.prompt(tokens=500, delay=2.5)
sleep() to simulate real processing latencyzlm = require("zlm")
store = datastore("workers")
ctx = context()
if ctx == nil then
// Main: spawn workers
store.set("completed", 0)
for i = 1, 1000 do
spawn("swarm_worker.du")
end
// Wait for all to finish
store.wait("completed", 1000)
print("All workers done!")
end
// Worker code runs when ctx != nil
text = zlm.prompt(tokens=300, delay=1.0)
store.increment("completed", 1)
exit({text = text})