cpuosBeta

Tutorials · 2 min read · updated Oct 7, 2026

Build a bounded code tool with open models

Submit a small Python job, poll its real result and return bounded evidence to a model. Keep authorization and retries in your application.

The current pilot runs trusted Python and Node jobs on your Docker worker. Containers share its kernel. Browser and repository workflows need capabilities beyond this pilot.

On this page

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.

REST API through fetch
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.

Questions

What runs in cpuOS today?
Python 3.13 and Node 24 standard-library jobs on your connected Docker worker, up to 120 seconds, 2 CPUs and 2048 MiB. No browser, custom image, exposed port, file-transfer API or persistent session is available.
Where is the isolation boundary?
Restricted Docker containers share the worker host kernel. The pilot is for trusted team code on a purpose-allocated worker, not hostile multi-tenant execution.
How do I know a task succeeded?
Wait for a completed result and inspect exitCode, stdout, stderr and outputTruncated. Failed, cancelled and lost-worker attempts are not successful tool results.
Can I use an open model?
Yes. Model reasoning and job submission are separate HTTP calls controlled by your application. gpuOS serves open models on your own GPUs; cpuOS jobs do not require a specific model provider.

Related

Connect a worker and run a job

Start with a small trusted Python or Node task, fixed limits and an expected result.

gpuOS · where models think

Need the model too? Run it on gpuOS

gpuOS serves open models on your own GPUs behind one OpenAI-compatible API. Your application can submit authorized actions to cpuOS jobs.