NitroStack SDK • Code Mode Architecture
NitroStack Code Mode Studio
Sandboxed QuickJS WebAssembly runtime enabling agents to write atomic JavaScript batches, orchestrating complex tool chains in a single turn while eliminating 95%+ of LLM context token overhead.
QuickJS WASM Runtime
Atomic Batch Orchestration
callTool() Programmatic API
~95% Context Token Savings
Architectural Paradigm
Multi-Turn LLM Round-Trips vs. Atomic Code Mode
Traditional Multi-Turn ExecutionHigh Overhead
Each tool invocation requires an independent round-trip to the LLM. Intermediate results flood the conversation context, causing exponential latency and token cost inflation.
ROUND-TRIP TRAFFIC:
Turn 1: LLM ──► call(filter_records) ──► LLM (1,200 tokens)
Turn 2: LLM ──► call(aggregate_sum) ──► LLM (2,850 tokens)
Turn 3: LLM ──► call(format_output) ──► LLM (4,920 tokens)
Total: 3 Round Trips • ~4,900 Tokens Consumed
Turn Latency~4,500ms
Context Footprint~4,900 tokens
NitroStack Atomic Code Mode~95% Token Savings
The LLM writes an expressive JavaScript script orchestrating synthetic tools inside a secure QuickJS WebAssembly sandbox. Intermediate records stay in WASM memory without touching LLM context.
ATOMIC QUICKJS EXECUTION:
Turn 1: LLM ──► execute({ code })
├── QuickJS runs callTool('filter_records') in WASM
├── QuickJS runs callTool('aggregate_sum') in WASM
◄── Return single clean structured result + UI Widget
Total: 1 Round Trip • ~250 Tokens Consumed
Turn Latency< 250ms
Context Footprint~250 tokens (~95% saved)
Live Interactive Code Mode Studio
Test QuickJS scripts, query schema catalogs, and preview interactive widgets live.
Code Mode Studio
Client-sandboxed JavaScript with atomic tool orchestration.
QuickJS WASM•~0% fewer prompt tokens
Ready to execute in QuickJS WASM sandbox
Horizontal pipeline trace will display real-time execution here.
Click "Run in Sandbox" to inspect Pre-flight, Gateway, Micro-task, State Integrity & Output.