Skip to content
smol.Docs

    Open console

    Handle routing and streaming failures

    Recover from an unavailable target or interrupted generation without replaying an uncertain request.

    Routing protects the start of a request. It cannot transplant a partially generated answer to a second server and guarantee the same continuation. Your client should record one logical request before dispatch and keep its idempotency key, any returned Smol request ID, and whether output was received.

    What happened? What it means for recovery
    Preferred target is known to be ineligible before dispatch An eligible alternate can be chosen under the effective policy and its limits
    Earlier submission is proven not to have executed A policy permitting another submission may use an eligible target within the original deadline and attempt limit
    Timeout, lost connection, or execution outcome unknown There may already be model work, cost or output. Do not treat it as proof of non-execution
    Part of a stream was delivered Treat it as a partial answer; don’t splice another generation into it
    All eligible targets are unavailable, draining, over limit or unhealthy A request can be refused. Adding retries doesn’t create capacity or a healthy target
    1. Do not automatically replay the generation, mint a new request key to “fix” the first one, or let a general-purpose HTTP retry loop resubmit it. An HTTP connection opening isn’t proof the model finished; a connection failure isn’t proof the provider did no work.
    2. Read Inference → endpoint → Activity. Use the Smol request ID if available; otherwise inspect the recent time window. Review execution and delivery separately, and check attempt/target evidence where available. The caller’s idempotency key isn’t an Activity search ID.
    3. Inspect Traffic routing for effective revision, unhealthy/draining targets, concurrency and circuit state. Recover an unhealthy target by correcting the runtime or model connection and checking health. A health probe is not an inference retry.
    4. If a human explicitly wants a fresh generation, treat it as new work with its own identity, possible cost and visible distinction from any partial answer. Preserve the earlier record.

    For parsing SSE, completion and terminal events refer to Streaming; for authentication and ambiguous submissions see Errors and idempotency.