Skip to main content

CLI reference

The public CLI uses Cobra for grouped help, typo suggestions, aliases, and shell completion. It talks to the authenticated control-plane API and never opens PostgreSQL directly. Run infercrane help for the current command tree and infercrane version for the build version.

Global conventions

  • Commands that return data accept --output human|json.
  • status --watch --output json emits one JSON document per state refresh.
  • Mutation commands accept --idempotency-key; generated keys are printed in human and JSON output and attached to uncertain-request errors. Reuse the same key after an uncertain result.
  • --wait polls persisted operation state and prints only changed progress. Closing the client does not cancel server-side work; the operation ID and exact infercrane operation watch ID resume command are printed before waiting begins.
  • --wait-timeout 20m bounds the local watcher without cancelling the durable operation. Resume with infercrane operation watch ID; cancel only with infercrane operation cancel ID.
  • JSON failures contain code, category, message, retryable, remediation, and provider HTTP status when available.
  • Command help is available before authentication: infercrane COMMAND --help never contacts the control plane.
  • infercrane --context NAME COMMAND selects a context for one invocation.
  • infercrane --no-color COMMAND and the standard NO_COLOR environment variable disable ANSI styling. Redirected output and JSON are never decorated.

Configure and diagnose

init

Validate and store a control-plane URL and an already-issued credential in a named private client context.
init verifies authentication through the read-only identity endpoint before writing configuration. Use --skip-check only when intentionally configuring an offline control plane. It does not create or enroll a principal.

Contexts and authentication

JSON output uses stable lowercase fields (id, tenant_id, name, role, kind, and scopes) so authentication checks can be consumed directly by scripts without depending on Go field names. Legacy single-context configuration is migrated on the next init. Context listing and display never print stored credentials.

Shell completion

Homebrew installs generated completions automatically. Completion is read-only and may suggest deployment names from the configured control plane; an unavailable control plane produces no completion error or mutation.

doctor

Ask the control plane to check its own dependencies.
--cloud adds SkyPilot credentials and RunPod advisory accelerator availability; --serverless adds RunPod Serverless credentials and template validation; --aws performs a read-only role assumption and identity probe for the configured AWS BYOC adapter; --gcp checks Application Default Credentials plus read-only Compute zone access; --kubernetes checks the explicit context, optional KServe CRD, and required namespaced permissions. Diagnostics are read-only and do not create provider resources. The capability table distinguishes supported, unsupported, and unknown. InferCrane never silently changes hardware, and never claims cache or fast-resume behavior that an adapter cannot observe.

Operations workspaces

inbox

The inbox reads tenant-scoped endpoint and deployment summaries, ranks non-serving state and staged candidates deterministically, and prints the exact persisted field behind each item. It fails the whole read if either fleet API is unavailable, so a partial inventory cannot look healthy. It does not run Doctor implicitly and never reads prompt or response content.

observe

The default snapshot is read-only. Endpoint snapshots combine logical identity, serving plans, Guard, admission, and alerts; deployment snapshots combine lifecycle, traffic, active operation, Guard, and events. --diagnose explicitly persists a fresh deterministic Doctor evaluation.

artifact

Prefetch records durable intent; only a fresh provider observation is cache-hit evidence.

evaluation

ingest accepts the strict evaluator-result v1 interchange contract, rejects unknown content fields, binds it to one immutable revision, signs it, and optionally attaches it. Evidence is signature-verified and contains aggregate values only.

mcp

Starts a stdio MCP server with read-only deployment, endpoint, request, operation, and curated-recipe tools. No mutation tool is registered. See MCP for coding agents.

Admission and async inference

async submit persists protocol-native request content only after explicit encrypted-storage consent, returns a durable job ID, and does not depend on the client remaining connected. See Admission and async inference for retry, retention and webhook rules.

Terminal

The terminal workspace is reconnectable, supports state-valid guarded actions, and can be forced read-only with infercrane ui --read-only. It requires an interactive terminal and never uses tmux for persistence. See Terminal operations workspace.

Plan and deploy

workload

Create a repository-local inference project, validate it without allocating a GPU, and use the same DeploymentSpec for build, plan, and deployment:
workload init --recipe NAME pins a reviewed model commit. workload build --tag IMAGE performs a local Docker Buildx build for custom OCI projects; add --push to record a registry-confirmed immutable digest. workload dev binds a custom OCI workload only to loopback. See Inference projects.

plan

Preview semantic changes without provider or database mutation.
Provisioned and serverless plans include an explicit readiness-evidence boundary:
This is intentionally not a time estimate. Once an operation starts, durable events replace unknown stages with provider and runtime observations where those boundaries are actually exposed.

deploy and apply

deploy creates a cloud or existing-target deployment. apply declaratively converges a deployment using the same input shape.
A YAML path cannot be combined with deployment flags. See DeploymentSpec. SGLang and custom OCI use the YAML form because their runtime contract is part of the immutable revision. See SGLang and Custom OCI workloads. After submission, human output prints the exact commands to follow durable progress. A successful wait prints the command for the first inference request.

integrations

Displays registered provider, runtime, and external composition capabilities, evidence state, and the exact qualified runtime/provider/compute-mode combinations. Registration alone never implies production support.

sandbox

Compose an externally operated sandbox with one stable inference endpoint:
connect and rotate reveal a credential once. It expires within 24 hours, can invoke only the selected endpoint alias, and cannot use control-plane routes. revoke disables InferCrane access without mutating the external sandbox. See External agent sandboxes.

training

Verify a signed, content-free artifact handoff from an external training system:
The private signing key remains local. Attachment binds immutable identity to one revision but does not promote it or claim that InferCrane executed training. See Training artifact handoffs.

Send a request

Use the logical deployment name without assembling an HTTP request by hand:
--output json returns the OpenAI-compatible choices and usage object for non-streaming requests. The command uses the configured endpoint and credential; applications can continue to use any OpenAI-compatible SDK directly. --protocol accepts chat, responses, embeddings, completions, or batch; the endpoint must explicitly qualify the selected surface. Inspect the persisted routing and timing evidence for a returned X-Request-Id without retrieving prompt or output content:

Stable endpoints

Separate the name applications call from the deployment that currently serves it:
endpoint plan makes the first plan active and stages later plans as candidates. Inspect and promote explicitly:
--bindings is ordered and accepts optional bounded weights, for example primary:80,overflow:20. See stable endpoints and serving plans. Authenticated external APIs add provider-neutral policy flags to endpoint bind:
The control plane rejects raw credentials, missing consent, absent hard limits, cross-tenant secret references, and adapter/target mismatches before creating the binding. Stage one environment’s active immutable plan as another endpoint’s candidate:
The first command is a non-mutating preview. Staging never switches production traffic; destination Release Guard and explicit endpoint promotion remain required.

Connect an existing workload

The simple path verifies the upstream model list through the control-plane API and starts in observe-only mode:
Use --model when the endpoint exposes more than one physical model. Use --manage-traffic only when the endpoint has been qualified and should immediately enter the InferCrane logical route. The advanced ownership-compatible command remains available:
Use traffic-managed only when InferCrane should publish the healthy existing target. Neither mode transfers provider lifecycle ownership. See Adopt and diagnose.

Existing targets and routing

Supported strategies are round-robin, consistent-hash, power-of-two, and cache-aware, delegated to the pinned vLLM Router.

Observe and explain

Long operations belong to the control plane, not the terminal. deploy, apply, rollout, scale, and deletion continue after the CLI disconnects. Pressing Ctrl-C stops only the local watcher. Run infercrane operation watch ID later to resume from persisted progress; add --wait-timeout 20m to bound only the new local watch. Explicit infercrane operation cancel ID is the separate action that requests cooperative server-side cancellation and provider cleanup. status deliberately separates two concerns. Serving answers whether the current route can accept inference traffic. Convergence answers whether desired capacity, a rollout, or deletion is still progressing. A deployment can therefore be serving · converging while a provider allocates another replica; this is not reported as an outage. JSON output exposes the same stable fields under lifecycle_status, including ready and desired replica counts, provisioning and draining counts, candidate state, and the blocking durable operation. Deterministic explanations use only persisted state and measurements:

Benchmark

Run AIPerf and persist the exact reproduction metadata.
--revision accepts active, candidate, or an explicit revision ID. Defaults are 100 requests, concurrency 10, and seed 17. Capture and search immutable recipes only after a matching benchmark exists:
Compare persisted measured configurations without provisioning new capacity:
See Recipes and Inference Lab for the provenance and missing-evidence contract.

Replay and capacity

Replay captures content-free production shape by default. Running an AIPerf approximation requires both --execute and --acknowledge-cost. See Replay and capacity intelligence.

Revisions and Release Guard

Candidate creation also accepts --model-revision, --runtime, --runtime-version, --runtime-args, --routing, and --region. Promotion remains policy-gated; no LLM decides the outcome. rollout validate is explicit synthetic traffic, not shadowing. It runs the existing AIPerf adapter against active and candidate revisions using the same workload and persisted hard bounds. The acknowledgement is mandatory because both runs may incur provider cost.

Signed release evidence

passport keygen and passport verify work without a configured control-plane context. Issue and list use the authenticated API. See Inference Passports.

Delete

Preview cleanup, then confirm it explicitly.
--plan is side-effect-free. --yes is required for mutation. After a paid test, also verify the provider inventory reaches zero.

Tenant administration

These commands require an admin/bootstrap credential.
New and rotated tokens are returned once. Service-account scopes can only restrict the role ceiling; they can never grant an action unavailable to viewer, operator, or admin. Omitting --scopes uses every action allowed by the selected role for compatibility.

Secret references

Register metadata that points to an injected environment value. InferCrane never accepts the raw secret on the command line or through its API.

Signed alerts

Alerts contain deterministic Doctor findings and HMAC headers; delivery is idempotent and bounded.

Governed external fallback

External targets require manage_external. They are selected only when ordinary targets are unhealthy and require an explicit privacy acknowledgement plus hard budgets.
See Governed external capacity for transmission and reservation semantics.

SLO policy and recommendations

Define explicit fail-closed thresholds, then evaluate persisted benchmark evidence. Recommendations are advisory and never mutate the deployment.
recommended identifies a qualified candidate satisfying the policy. no_match means measured candidates violate it. unknown means required evidence is missing. See Inference decisions.