Build 01 / 04 — 123ofAI · Platform Infrastructure
Serverless Code-Execution Engine
A secure, low-latency engine that runs untrusted user code in ephemeral sandboxes on Modal — no standing servers, scales to zero.
- 01Run untrusted code, safelyUsers submit arbitrary Python to execute remotely. The hard part is isolation, latency, and resource limits — without paying for standing infrastructure.
- 02Authenticated dispatchSubmissions hit a Next.js API route that authenticates the user, enforces quotas, and dispatches the job to Modal.
- 03Ephemeral sandboxModal spins up an isolated sandbox capped at 512 MB / 1 CPU with a restricted-builtins namespace — created on demand, scaled to zero when idle.
- 04Execute with an ML stackCode runs against a preinstalled stack (PyTorch, TensorFlow, Transformers, LangChain, FAISS) under a 120-second hard timeout.
- 05Return & tear downstdout streams back to the client and the sandbox is destroyed — clean, stateless, and cost-efficient by design.








