Start with one small calculation tool
The model proposes Python that operates on a small inline dataset. Your application validates the request, applies fixed limits and submits it through the jobs API. Return stdout, stderr, terminal status and exit code to the model. A POST response only means the job was accepted.
Use standard-library calculations for this pilot. Package installation, arbitrary input files and chart downloads are not supported. Keep model-provider credentials in your application rather than embedding them in the submitted code. Restrict retry counts and inspect the cause before resubmitting.
The supported job workflow
Create a workspace, connect a Node 24 + Docker worker and submit a Python or Node job. Poll its state and inspect the terminal result. stdout and stderr are returned after execution; they are not streamed live.
const response = await fetch("https://cpuos.si/v1/jobs", { method: "POST", headers: { Authorization: "Bearer " + process.env.CPUOS_API_KEY, "Content-Type": "application/json", }, body: JSON.stringify({ template: "python", code: "print(sum([12, 18, 25]))", vcpu: 1, memoryMb: 512, timeoutSeconds: 30, }),})if (!response.ok) throw new Error(await response.text())const job = await response.json()// GET /v1/jobs/:id until status is completed, failed or cancelled.// Use the result only after checking status and exitCode.Validate a representative task
- Verify a successful script and a nonzero exit code with known expected output.
- Test timeout, output truncation, queued cancellation and running cancellation.
- Disconnect the worker and inspect stale status and failure handling before retrying.
- Confirm that code and logs contain no long-lived credentials or unnecessary customer data.
Keep reasoning and execution separate
gpuOS supplies open-model inference on your GPUs. Your application validates tool arguments, sets fixed limits and submits authorized jobs to cpuOS. There is no automatic built-in tool connection between the products.
See LangChain tool wiring and n8n HTTP jobs for the same contract in an application workflow.