Skip to main content
This guide is for developers with work that is too slow for one process: scraping a list, embedding a corpus, converting files, or running a simulation sweep. Prerequisites: CYCLS_API_KEY. Docker only if you want to test locally.

1. Write the unit of work

Write the function for one item. Parallelism is a call site decision, not a code change.
scrape.py
Returning the error as data matters. map raises on the first exception, so a single bad URL would otherwise abort the batch. concurrency=1 gives each call its own instance, which is what you want for CPU-bound work. Leave it high for I/O-bound work so one instance handles many calls.

2. Test one item locally

3. Fan out

map runs one call per item across autoscaled instances and returns results in input order. The entrypoint runs on your machine, so it can read local files and print progress while the work happens in the cloud.

4. Keep expensive setup warm

The process survives between calls on an instance, so a mutable default holds a loaded model.
embed.py
The first call on each instance loads the model. Every later call on that instance skips the load. Batch the input so each call does real work:

5. Write results where they persist

Return values travel over the wire, so keep them small. Large output belongs on a volume.
Pull them down later without writing an endpoint:

6. Deploy it as a named endpoint

Any machine with your CYCLS_API_KEY can call it, including a laptop with no source and no Docker. An agent can call it from a tool handler, which keeps heavy dependencies out of the chat container.

Sizing

Limits

  • Payloads should stay well under 30MB per call. Use a volume for anything larger.
  • A call times out after one hour. Split longer work or checkpoint it.
  • If the executor is replaced mid-fan, the whole fan retries, so side effects should be idempotent.
  • Tracebacks from remote code have correct file names and line numbers but no source lines, because the container holds bytecode rather than your files.

Next

Scheduled reports

Run the same work nightly and leave the output somewhere durable.