CommonCompute
Get startedDownload the Mac app
Getting started

Your first job

The simplest possible job: embed a few strings. The response is OpenAI-shaped, so it drops into code that already speaks that format.

python
res = cc.embeddings.create(
    model="bge-small",
    input=["hello", "world"],
)
print(res["data"][0]["embedding"][:5])

For anything larger than a handful of inputs, use submit_many — it fans out across the fleet and streams results back as they land, in completion order rather than input order. Batch priority is half the price of realtime (realtime is exactly 2× batch on every workload).

python
for result in cc.submit_many(
    "coreml_embed",
    [{"input": [line]} for line in open("docs.txt")],
    priority="batch",
    max_spend_usd=50,
):
    db.upsert(result.task_id, result.output)
max_spend_usd is a hard per-job ceiling. A job whose unit price already exceeds it is rejected at submission rather than silently billed.