Skip to content

Deployment

Deployment takes a version and puts it live behind the public runtime, so callers can invoke your function by slug without knowing anything about prompts, models, or versions.

create version → deploy → invoke

There is no separate approval step — deploy is the gate. Deploying a draft:

  • compiles it and refuses if the artifact has errors;
  • refuses if the version ran the design (readiness) gate and failed it;
  • refuses if any score flagged as a gate is unmeasured, or below the bar, in a completed experiment pinning this version;
  • then freezes the version (it can’t be edited again — start a new version from it instead) and points the function’s public endpoint at it.

A version that was live before stays frozen and can be put live again (change version / rollback) without re-running the gate.

The same in the SDK (from the quickstart):

c.deployments.deploy(fn["id"], v["id"])

Deployed functions are called on the public runtime (/v1/run/{slug}) with a per-function invoke key (fnk_…) — never a personal token. Mint a key, then call the function by slug:

key = c.keys.invoke.mint(fn["id"], name="prod") # fnk_… shown once
result = c.function(fn["slug"], api_key=key["key"]).run(document="…")
print(result.ok, result.output, result.meta["cost_usd"], result.trace_id)

Invoke keys are deliberately narrow: one key calls one function’s runtime and nothing else. Hand them to the systems that call your function, not to people. Credential kinds are covered in authentication.

Because every deployed version is a frozen, compiled artifact, rolling back is re-pointing the deployment at a previous version — no rebuild, no redeploy of code, no re-running the gate. The last known-good version is always one switch away if a new one misbehaves.

Every invocation lands as a trace in the same pipeline you used during evaluation:

c.functions.health(fn["id"]) # is my function okay?
c.traces.list(function_id=fn["id"]) # recent executions
c.traces.flag(trace_id) # a bad output → straight into a dataset

Flagging a production trace turns a real-world failure into a regression dataset row, so the next version’s evaluation covers the case that broke. That closes the loop: production feeds evaluation, evaluation gates deployment.

  • Evaluation — prove the next version before you promote it.
  • API reference — the deployment, key, and trace endpoints.