Duplicate retries representing the same logical operation should generally share one reservation when the idempotency key, its scope, and the material request parameters match. Use separate keys and isolated reservations for distinct business intents, intentional fan-out, or independently consumable work. If an existing key is paired with materially different parameters, reject or flag the request rather than silently sharing capacity.
The short answer: one logical operation should usually map to one reservation
The reservation decision should follow logical intent—not payload similarity alone. When a client retries because of a timeout, connection loss, or uncertain response, creating another reservation can double-count capacity or launch duplicate work. Resolving both attempts to the same operation record and reservation reduces that risk.
A new reservation is appropriate when the client is asking for additional work that may be consumed independently. Two inference jobs can contain identical prompts and model settings yet still represent separate business operations. Conversely, requests with slightly different transport metadata may still be retries of the same operation.
A practical decision model looks like this:
| Scenario | Key and request relationship | Reservation action | Suitable API behavior |
|---|---|---|---|
| Transport retry for the same operation | Same scoped key and equivalent material parameters | Share the existing reservation | Return the result, wait, or report that processing remains in progress |
| Concurrent duplicate while the original is running | Same scoped key and equivalent fingerprint | Share the pending reservation | Wait, report in progress, or provide a conflict/retry signal according to the API contract |
| Retry after completion | Same scoped key and equivalent fingerprint | Do not reserve capacity again | Replay the stored outcome while the idempotency record remains valid |
| Same key used for materially different work | Same scoped key but mismatched fingerprint | Do not share or create another reservation under that key | Reject or flag the key reuse |
| New business operation | Different logical intent and a new key | Create an isolated reservation | Process as new work |
| Intentional fan-out | Independently consumable requests with distinct keys | Create isolated reservations | Schedule each operation independently |
| Matching payload from another tenant or principal | Different identity scope | Keep reservations isolated | Evaluate as a separate operation within that scope |
| Outcome cannot be determined safely | Existing operation is in an indeterminate state | Preserve ownership and reconcile before reallocating | Report uncertainty or a retryable state without assuming that no work occurred |
Why idempotency does not guarantee exactly-once execution
An idempotency key helps a server recognize repeated attempts, but it does not by itself provide exactly-once execution across distributed components. A failure can occur after capacity has been reserved but before the response reaches the client. It can also occur after downstream work starts but before the final outcome is stored.
These failure windows mean the control plane needs a durable concept of operation ownership and a way to reconcile uncertainty. A retry should not automatically be treated as proof that the first attempt failed. The system should instead determine whether the original operation is pending, complete, released, failed, or indeterminate.
Idempotency is therefore best treated as a coordination contract with three responsibilities:
- Recognize the logical operation. Associate retries with a stable, properly scoped key.
- Protect the operation from conflicting reuse. Verify that material request parameters remain equivalent.
- Return a consistent disposition. Share pending work, replay a completed outcome, reject conflicting reuse, or expose an uncertain state that requires reconciliation.
When independently consumable work needs a new reservation
Requests should receive separate reservations when completing one does not satisfy the others. Examples include intentional parallel generations, multiple batch partitions, speculative alternatives that are all allowed to run, or repeated business actions that happen to use the same inputs.
The client should assign a new idempotency key to each independent operation. This preserves separate scheduling, cancellation, accounting, and outcome histories. Reusing one key for intentional fan-out can collapse valid work into a single reservation; generating a new key for every transport retry can create the opposite problem by multiplying reservations.
A useful client-side rule is:
- Retrying the same intended result: reuse the key.
- Requesting another independently valid result: create a new key.
- Changing parameters that alter operation identity: create a new key rather than mutating the request associated with the old one.
Coordinate reservation creation atomically
Concurrent duplicates can arrive before either request observes an existing record. If idempotency ownership and reservation creation are independent, both attempts may believe they are first and both may allocate capacity.
The recommended pattern is to coordinate creation of the idempotency record and reservation as one indivisible ownership decision. Only one request becomes the operation owner. Matching duplicates then reference that operation instead of creating competing reservations. The specific transaction, lock, or persistence mechanism depends on the architecture; the invariant is more important than the implementation technology:
For one scoped idempotency identity, no more than one active reservation should be created for the same logical operation.
The operation record should retain enough metadata to explain who established ownership, which request fingerprint was accepted, the current reservation state, and what outcome can be returned to later callers.
Model the full reservation lifecycle
A reservation should have explicit states rather than a simple present-or-absent flag. A useful conceptual lifecycle is:
- Pending: ownership exists and capacity is being held or scheduling is underway.
- Committed: the reservation has been applied to work that has started or been accepted for execution.
- Released: the hold was intentionally removed before consumption.
- Expired: the reservation reached its policy-defined lifetime without a valid transition.
- Failed: the operation ended in a known failure with a recordable outcome.
- Indeterminate: the system cannot yet establish whether downstream work started, completed, or consumed the reservation.
Not every implementation needs the same labels, but it should preserve the distinctions. In particular, an indeterminate reservation should not be treated automatically as released. Reconciliation may need to inspect downstream state before capacity can be made available or the operation can be retried.
A reservation timeout and an idempotency-record retention period also solve different problems. Reservation expiry controls how long capacity may remain held. Idempotency retention controls how long a retry can be recognized and a prior result replayed. Policies should reflect maximum execution time, expected retry horizons, reconciliation needs, and audit requirements rather than relying on one universal TTL.
Identify a duplicate by key, scope, and request fingerprint
A request is a true duplicate only when three elements agree:
- The idempotency key is the same.
- The key is being used within the same defined scope.
- The request fingerprint shows equivalent material intent.
The key provides correlation, the scope prevents unrelated callers from colliding, and the fingerprint prevents one key from being reused for different work. None of these elements is sufficient alone.
Scope keys by tenant, principal, endpoint, operation, and resource
An API should define where an idempotency key is unique. Depending on the operation, that scope may include the tenant, authenticated principal, endpoint, operation type, and relevant resource.
Tenant and principal isolation are especially important. Identical keys or payloads from different tenants must not cause their reservations to be shared. Endpoint and operation scope can also prevent a key used for one action from accidentally referring to an unrelated action elsewhere in the API.
The documented contract should make the scope clear enough that clients know when to reuse a key and when to generate a new one. Internally, the operation identity can be thought of as a composite of the scoped key and the fields needed to separate security and business domains.
Reject or flag materially different requests that reuse a key
A request fingerprint should cover the parameters that determine logical operation identity. For an inference scheduling request, these might conceptually include the requested work, model or routing intent, relevant execution policy, and resource context. Transport-only details that do not alter the operation may not belong in the fingerprint.
There is no universal field list or fingerprint algorithm. The important behavior is consistent comparison of material parameters. If a caller reuses an existing key with a materially different request, the API should not silently attach that request to the old reservation or overwrite the original operation. It should reject or clearly flag the mismatch so the client can correct its key handling.
This validation also supports operational diagnosis. A high rate of mismatches can reveal a client that stores keys too broadly, retries mutated requests, or unintentionally shares key state across workflows.
Distinguish transport retries from new requests and intentional fan-out
Transport retries arise when the client still wants the original result but does not know whether the server received or completed the request. A new scheduling request asks for another unit of work. Intentional fan-out deliberately creates multiple independently consumable operations.
These categories can look similar at the payload level, so intent must be expressed through key lifecycle:
- A transport retry carries the original key.
- A new request receives a new key.
- Each independently consumable fan-out branch receives its own key.
Clients should persist the key for at least as long as they may retry the operation. They should also avoid generating a replacement key merely because the first connection timed out; doing so removes the server's primary correlation signal.
Choose an explicit policy for concurrent in-flight duplicates
When a matching retry arrives while the original request is still running, an API generally has three contract choices:
- Wait for the original outcome. This offers a simple client experience but can tie up connections and may not suit long-running work.
- Report that the operation is in progress. This works well when clients can poll or retrieve status asynchronously.
- Return a conflict or retry signal. This keeps the immediate response bounded but requires clients to understand when and how to retry.
No single response policy is correct for every API. The choice depends on whether work is synchronous or asynchronous, expected duration, connection behavior, client retry logic, and the cost of holding concurrent waiters. Whichever policy is selected, duplicates should continue to reference the same reservation rather than race to create new ones.
After completion, a matching retry should normally receive the stored outcome while the idempotency record remains valid. “Outcome” can include a successful result or a stable recorded failure. Replaying that outcome avoids allocating capacity again and gives the client a consistent answer.
Handle disconnects, uncertain execution, and cancellation separately
A common failure window occurs when the server creates a reservation and the client disconnects before receiving confirmation. Another occurs when downstream work starts but the control plane fails before persisting the final state. In both cases, immediate reallocation may duplicate work or distort capacity accounting.
The safer pattern is to preserve the operation identity, mark uncertainty when necessary, and reconcile against downstream state. Useful audit metadata includes ownership and transition timestamps, correlation identifiers, accepted request fingerprints, reservation references, and recorded outcomes. Observability should make duplicate rates, contention, expiry, mismatch, and indeterminate operations visible.
Cancellation requires its own semantics. Cancelling one caller's wait should not automatically cancel shared underlying work. Multiple duplicate callers may be observing the same operation, and one disconnected or impatient caller should not implicitly release the reservation for everyone. Cancelling the operation itself should require explicit authorization and a clear operation-level rule that determines whether committed work can still be stopped.
Applying the decision model to private inference scheduling
Reservation semantics matter in a private inference control plane because scheduling decisions can affect GPU capacity allocation and queue ownership. Duplicate reservations may cause the same logical request to compete with itself or distort capacity accounting. Over-broad sharing creates the opposite risk by merging independent inference jobs that should be scheduled and observed separately.
Token Forge Cloud Private LLM Inference supports private deployment and serving-layer optimization for enterprise AI workloads, with capabilities spanning GPU scheduling, model routing, caching, batching, and quantization. When evaluating retry behavior around an inference control plane, teams should align the API contract with their workload model: latency-sensitive chat, asynchronous batch enrichment, and agentic workflows may need different waiting, cancellation, and reconciliation policies.
Key design questions include:
- What constitutes one logical inference operation?
- Which request parameters are material to reservation identity?
- How are keys isolated across tenants and authenticated principals?
- What happens when matching requests arrive concurrently?
- How long can completed outcomes be replayed?
- How are uncertain downstream executions reconciled?
- Who is authorized to cancel shared underlying work?
- Which metrics expose duplicate contention, expiry, and indeterminate states?
Teams validating demand through Token Forge Cloud Managed Model APIs can apply the same client-side distinction between transport retries and new work. For private deployment, the decision model becomes particularly relevant when reservation behavior must align with enterprise scheduling and capacity-control policies.
Next step
Contact Token Forge Cloud to discuss API access, private deployment, and LLM inference cost control.