> ## Documentation Index
> Fetch the complete documentation index at: https://docs.infercrane.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Intent planning

> Turn a simple model request into an editable, evidence-bounded deployment starting point.

# Plan from a simple request

`POST /api/v1/planning/intents` is an authenticated, read-only planning endpoint. It accepts a short
intent and optional explicit choices, resolves an exact reviewed model when possible, and returns an
editable configuration plus a small architecture graph. A Hugging Face repository outside the
reviewed catalog is [checked automatically](https://docs.infercrane.com/features/model-catalog.md#check-any-model-automatically)
instead.

```bash theme={"theme":"css-variables"}
curl -fsS "$INFERCRANE_URL/api/v1/planning/intents" \
  -H "Authorization: Bearer $INFERCRANE_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "intent": "Deploy Qwen/Qwen3-8B for low latency on RunPod"
  }'
```

Optional fields are `model`, `provider`, `region`, `gpu`, `objective`, and `compute_mode`. Explicit
fields override only the matching interpretation. Objectives are `interactive`, `latency`,
`throughput`, or `cost-efficiency`; compute mode is `elastic` or `serverless`. For a model outside
the reviewed catalog, `model_revision`, `model_secret_reference_id`, `context_tokens`, and
`concurrency` choose the commit, the saved Hugging Face token, and the load the GPU is sized for.

When no provider is named, InferCrane ranks compatible registered providers only when it has an
exact, fresh USD quote for the reviewed GPU count and region. The quote must be a complete instance
total from an accepted provider, contract, or measured-invoice authority. Connection state does not
change that ranking: a cheaper unconnected provider is returned with a `provider_connection`
remediation. On a control plane that sells managed compute, only shown prices are ranked (see
[managed compute prices](#managed-compute-prices)); when none is, a provider whose price is
InferCrane's rate is chosen in a fixed order that no price enters: the profile's cloud hint, then a
ready provider before one that needs a connection, then provider ID. If no comparable quote exists,
selection falls back to the reviewed profile hint or one unambiguous ready provider.

The response has one of three statuses:

* `ready`: every choice needed to form the starting configuration is present.
* `needs_input`: `missing_choices` contains a prompt, bounded options when available, the evidence
  reason, and a remediation. InferCrane never substitutes another model or silently chooses
  among several ready providers.
* `unsupported`: the automatic check found that the model cannot run on the pinned runtimes, or
  does not fit any priced GPU layout. The `model` missing choice gives the reason and the nearest
  reviewed models.

### Models outside the reviewed catalog

When `model` is an exact Hugging Face repository that is not a reviewed model, the control plane runs
the automatic check first and plans from it. `plan.model.review` is `checked_automatically` (reviewed
models say `reviewed`), and `plan.model_check` holds the whole check: the pinned commit, the
architecture and runtime it matched, size, license, access, and the GPU fit.

A supported model gets the runtime's own defaults on the smallest priced layout: `vllm` 0.34.0 (or
SGLang 0.5.23 when only SGLang registers the architecture), `--max-model-len` set to the checked
context, `--tensor-parallel-size` across more than one GPU, elastic compute, and one replica. The
deployment draft pins the commit the check read and carries `model_secret_reference_id` when one was
given.

A gated or private model without a token returns `needs_input` with a `model_secret_reference_id`
missing choice. When the control plane cannot check the model (metadata access off, repository not
found, Hugging Face down), the plan is `needs_input` with the reason; it never guesses a setup.

`choices` is suitable for an editable form. `architecture.nodes` and `architecture.edges` provide a
stable application → endpoint → runtime/model/compute view without requiring the console to invent
topology. The returned configuration is still non-mutating; deployment requires a separate
idempotent request.

## Start from a workload

A team that has never served a model describes its traffic instead of naming a setup. Send
`workload`, `monthly_budget_usd`, `current_closed_model`, or any of them; `intent` and `model` are
then optional. [Start from your workload](https://docs.infercrane.com/start.md) explains the answer for people;
`infercrane start` sends the same request.

```bash theme={"theme":"css-variables"}
curl -fsS "$INFERCRANE_URL/api/v1/planning/intents" \
  -H "Authorization: Bearer $INFERCRANE_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "provider": "aws", "region": "us-east-1",
    "workload": {"kind": "chat", "peak_concurrent_requests": 16, "input_tokens": 800, "output_tokens": 300,
                 "latency_target": {"ttft_p95_ms": 1500}},
    "monthly_budget_usd": 1500,
    "current_closed_model": "gpt-4o-mini"
  }'
```

| Field | Bounds |
| - | - |
| `workload.kind` | `chat` (default), `agent`, `rag`, or `batch`. `agent` keeps only setups whose command turns on tool calling; `batch` plans for throughput. |
| `workload.peak_concurrent_requests` | 1 to 1,024 |
| `workload.input_tokens`, `workload.output_tokens` | At least 1 each, together at most 1,048,576 |
| `workload.latency_target` | `ttft_p95_ms` (1 to 600,000), `tpot_p95_ms` (1 to 60,000), or both |
| `monthly_budget_usd` | More than 0, at most 10,000,000 |
| `current_closed_model` | At most 128 characters |

`context_tokens` and `concurrency` size a plan without a workload. Beside any of the three Start
fields they are refused with `422 invalid_intent`: send one or the other.

The answer is `plan.start` (schema `infercrane.start/v1`):

* `workload`: the inputs with defaults applied, and `defaults_applied` naming them. Without a
  workload the defaults are chat, 8 requests at once, 1,024 tokens in, and 256 out. When the
  request names no `provider` (in the field or in `intent`) and a setup is suggested,
  `defaults_applied` also lists `provider`: the suggested setup's `provider` is the cloud InferCrane
  chose, which may have no price or connection yet. With no cloud given, each setup goes to the
  compatible cloud with the lowest current listed hourly price for its GPU (by name on a tie), so
  alternatives can sit on different clouds and a price refresh can change the choice; without such
  a price, a fixed order chooses, and no price enters it. Money in every `reason` is written one
  way, such as `$1,500.00`.
* `suggested`: one starting setup, or `null` with `reason`. The suggested setup is also
  `plan.configuration`, and its draft is the envelope's `deployment_draft`. When nothing is
  suggested, the plan is `needs_input`, `plan.configuration` and `deployment_draft` are absent (not
  `null`), and `reason` names what excluded the setups: tool calling, the context limit, or memory.
* A workload is sized only against starting setups. A named model with no starting setup, in the
  catalog or outside it, gets the same empty state: `needs_input`, no configuration, no draft, and
  no replicas, cost, or fit. `reason` says so and names the ways forward: plan the model without
  `workload`, `monthly_budget_usd`, and `current_closed_model` to use its reviewed configuration
  (or, outside the catalog, its automatic check), or start from a model that has a starting setup.
  A Start request reads nothing from Hugging Face.
* A model named only in `intent` (a catalog name, display name, or repository, or a Hugging Face
  `owner/name`) counts as named: it gets its own setups or the empty state, never another model's
  setup. An intent that names two catalog models equally is `needs_input`, with a `model` choice
  between them.
* `alternatives`: up to two more, from other models when no `model` was named.
* `not_suggested`: every other starting setup that matched, with the reason.
* `closed_model`: for `current_closed_model`, `open_equivalent` is always `unknown` and `next_step`
  is `migration_proof`.

Latency and the cost per million output tokens on the caller's GPUs are never stated: InferCrane's
runs were made on Modal, without the caller's runtime, router, and provider (see the invariants on
performance claims). Where a run is comparable with the workload, `reference` reports it: the cell
(`measured_at`), where it ran (`ran_on`), how it was measured (`measurement`), its figures, and a
plain `statement` about that run. Without one, the reason says there is no reference, and names the
nearest measured cell when the run recorded its request lengths; the Qwen3.8 27B FP8 run replayed a
chat trace without them, so it is never a reference. `performance_claims` stays `false`.

Each setup carries `model` (pinned commit and license note), `engine` (release, image digest,
arguments, environment), `gpu`, `gpu_count`, `replicas`, `source`, `fit`, `cost`,
`deployment_draft`, `missing`, and `limitations`. `source.kind` is `measured_by_infercrane`, with
`receipt_url`, `evidence_url`, `measured_image` (the digest the receipt ran) and
`measured_image_note`, or `publisher_documented`, with `differences` listing every change from the
publisher's command.

| Figure | States | Computed from |
| - | - | - |
| `fit.memory` | `fits`, `does_not_fit`, `unknown` | The model check at the workload's lengths and peak. When one replica does not hold the peak, `replicas` holds it and `fit.memory.concurrency` is one replica's share. |
| `cost.per_month` | `current`, `not_shown`, `unknown` | A provider's listed price for the whole machine, still valid, × 730 hours × `replicas` |
| `cost.per_million_output_tokens` | `not_shown`, `unknown` | Never stated. `reference`, when present, is the fastest receipt cell the workload is at least as fast as (load at most one copy's smallest share of the peak, prompt at least the workload's, answer at most the workload's, total context at least the workload's), with its speed only, never a dollar figure. No reference above the heaviest load the receipt measured, where a server can be overloaded |
| `fit.latency` | `unknown` | Never stated. `reference`, when present, is a receipt cell at least as heavy as one copy's largest share (load, prompt, answer) that was inside the target in that run, or one no heavier than its smallest share that was outside it; `inside_target` says which, as a fact about that run |
| `fit.budget` | `fits`, `over`, `unknown` | `cost.per_month` against `monthly_budget_usd` |

Setups are ordered: with a price (shown or not) before without one, then within budget, then
measured before documented, then the lower known monthly cost, then catalog popularity. A setup's
provider, when none is named, is chosen as for any plan. A setup is never suggested
when it does not hold the workload in memory, when the workload's requests are longer than its
context limit or the model's own context length, or, for agent traffic, when its command does not
turn on tool calling (`--enable-auto-tool-choice` with a `--tool-call-parser`).

## Managed compute prices

On a control plane that sells managed compute, a provider the caller does not use with its own
account (a workspace-owned provider or a verified compute connection) runs on InferCrane's compute.
Its price is InferCrane's rate, which no plan shows: `plan.evidence.price` and, for a starting
setup, `cost.per_month` and `cost.per_million_output_tokens` read `not_shown` with the reason
"priced at InferCrane's rate, not shown", and the budget fit is `unknown`. Such a price ranks
nothing: with no provider named, the provider comes from the fixed order above, so the plan is the
same whatever InferCrane's rate is.

To tell the two apart, the control plane reads the workspace's verified compute connections, once
per request at most, and only when a provider that the workspace does not own has a current price
for the plan's GPU. Without such a price, or off a managed plane, it reads nothing. If the read
fails, no connection counts as the caller's own, so no price at InferCrane's rate is shown by
mistake.

## Evidence boundary

The plan combines only these facts:

* immutable identities and starting profiles from the reviewed model recipe catalog, or, for a model
  outside it, what the automatic check read from Hugging Face at one commit;
* for a starting setup, its source: the publisher's documented command, or a public receipt's
  measured figures;
* registered runtime/provider compatibility;
* configured compute-connection readiness; and
* a current exact provider catalog observation for one replica, when one exists.

The plan always reports performance as `unmeasured` and capacity as unknown until a bounded provider
probe or accepted launch supplies evidence. A catalog price is not stock, quota, a reservation, an
account-specific discount, or a final invoice. Accelerator-only price components remain explicitly
non-comparable with complete instance totals.

The request body is a strict JSON object bounded to 16 KiB, and the intent itself is bounded to 2 KiB.
The endpoint performs no provider calls, reserves no capacity, and starts no billable work. Its only
outbound call is the automatic check's read of Hugging Face, when the operator enabled it.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.