# SaladCloud > SaladCloud documentation: Salad Container Engine, AI Gateway, Transcription API, S4 storage, and Gateway Service. Agents: start at /general/tutorials/build-with-ai-agents. > ## Agent Instructions > For autonomous tasks, use live SaladCloud API responses for current state, availability, quotas, models, and other dynamic values. Use current OpenAPI specifications where provided for paths, schemas, required fields, and enums. Never invent endpoints, fields, prices, availability, quotas, models, or state. Prefer API workflows over Portal steps. Read before changing and never expose credentials, signed media URLs, prompts, or sensitive outputs. Retry only safe or idempotent operations with bounded backoff, honoring Retry-After. Verify every write with a read. Stop rather than repeat an uncertain non-idempotent or billable request. AI Gateway uses an organization-specific Bearer key and live /v1/models discovery. Do not delete, cancel, stop, or reduce capacity without explicit user intent. Bind shared operation IDs to the selected product path. Treat Container Engine instances as interruptible and local state as ephemeral. Install the SaladCloud skills (npx skills add https://docs.salad.com), start from the salad skill and /agents/overview; docs MCP: https://docs.salad.com/mcp. # Select a Model and Send an AI Gateway Request Source: https://docs.salad.com/agents/ai-gateway/select-model-and-send-request Discover live Salad AI Gateway models, send one authorized chat completion, and verify the response without exposing credentials or automatically repeating uncertain billable work. *Last Updated: October 19, 2026* ## When to use this runbook Use when an agent needs to discover currently available Salad AI Gateway models or send one OpenAI-compatible chat completion using an existing organization-specific AI Gateway key. ## When not to use it Do not use this runbook to create an account, organization, credit balance, or API key; operate a self-hosted Container Engine model; run an unapproved load test; or automatically repeat a request whose outcome or charge is uncertain. ## Required inputs * `SALAD_AI_GATEWAY_API_KEY`, containing the organization-specific AI Gateway key and supplied only through a secret environment variable. Do not substitute the user-level `SALAD_API_KEY` used with the `Salad-Api-Key` header. * The intended prompt or messages, expected output, and authorization to send their content to the selected model. * An exact model ID or enough approved capability/cost criteria to select one from the live model list. * Whether streaming is required and a caller-defined attempt and elapsed-time budget. * Any tool definitions or image inputs. Treat prompts, conversation history, tool arguments/results, images, and model output as potentially sensitive. ## Authoritative sources | Action or behavior | Exact endpoint and canonical source | | - | - | | Discover models | `GET https://ai.salad.cloud/v1/models` — [Models reference](/ai-gateway/reference/models) | | Create a chat response | `POST https://ai.salad.cloud/v1/chat/completions` — [Getting Started](/ai-gateway/tutorials/getting-started) | | Authenticate | `Authorization: Bearer ` — [Pay-Per-Token Onboarding](/ai-gateway/tutorials/pay-per-token-onboarding) | | Compare published rates | [AI Gateway Pricing](/ai-gateway/reference/pricing) | | Key lifecycle | [Manage Your AI Gateway API Key](/ai-gateway/how-to-guides/manage-api-key) | | Access errors | [AI Gateway Errors](/ai-gateway/reference/errors) | This repository does not currently contain an OpenAPI specification for Salad AI Gateway. Do not infer unsupported request fields, response fields, idempotency, retry guarantees, or model availability from the SaladCloud public API specification, a different OpenAI-compatible provider, an SDK type alone, or an example. ## Dynamic values to retrieve * Live model IDs from `/v1/models` immediately before model selection. * Current response status, headers, server-provided retry guidance, and response body for the exact request. * Published input/output rates when cost affects selection; do not treat an old copied price as current. * Response usage metadata when the live response supplies it. The Gateway API does not expose the organization's credit balance through these endpoints. Do not infer balance from a successful models read or from historical usage. ## Preflight checks 1. Confirm the credential is an AI Gateway key and will be sent only as a Bearer token to `ai.salad.cloud`. 2. Confirm prompts, messages, images, tool definitions, and conversation history are authorized for processing and will not be printed in logs or returned as evidence unless explicitly requested. 3. Call `GET /v1/models`. If the requested model ID is absent, stop or ask the user to approve a live alternative. 4. Check the [published rates](/ai-gateway/reference/pricing) when model cost is part of the decision. 5. Use the smallest documented request that satisfies the task. Do not copy provider-specific fields without evidence that Salad AI Gateway supports them. 6. Define the expected output, streaming mode, attempt budget, and stop condition before sending the billable request. ## Procedure ### Discover live models ```bash theme={null} curl --fail-with-body --silent --show-error \ --url 'https://ai.salad.cloud/v1/models' \ --header "Authorization: Bearer ${SALAD_AI_GATEWAY_API_KEY}" \ --header 'Accept: application/json' ``` Select only a model ID returned by the live response. Documentation lists supported models for reference, but the live catalog is authoritative for immediate request routing. The models endpoint answers without authentication, so a successful response does not verify the key; only a completion does. ### Send one non-streaming request ```bash theme={null} curl --fail-with-body --silent --show-error \ --request POST \ --url 'https://ai.salad.cloud/v1/chat/completions' \ --header "Authorization: Bearer ${SALAD_AI_GATEWAY_API_KEY}" \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --data '{ "model": "qwen3.6-35b-a3b", "messages": [ {"role": "user", "content": "Say hello in one sentence."} ], "stream": false }' ``` Replace the model and content in memory or a protected local configuration. Do not place sensitive prompts, keys, or complete responses in shell history, source control, telemetry, or evidence output. For streaming, use the documented SDK or set `stream` to `true` only when the caller can consume and preserve partial output safely. A disconnected stream can have an uncertain final outcome and charge. ## Decision rules | Evidence or outcome | Action | | - | - | | Requested model appears in the live catalog | Use that exact ID. | | Requested model is absent | Stop or request approval for a live alternative; do not silently substitute. | | Model choice is open and cost matters | Compare current published rates and required capabilities, then state the selected tradeoff. | | `401` or other `403` | Stop; distinguish the AI Gateway key from the regular SaladCloud API key and request valid authorization. | | `402 credits_exhausted` | Stop; ask the user to restore the key's organization's positive credit balance before retrying. | | `403 no_access` | Stop; confirm the intended organization, key, membership, and access. Do not substitute the account API key. | | Clear validation failure | Correct only documented fields; do not retry the unchanged body. | | `429` with `Retry-After` | Honor the header within the caller's budget; retry only when the response clearly rejected the request. | | Transport failure, timeout, or `5xx` after sending | Treat completion and billing as uncertain; do not automatically repeat the prompt. | | Stream disconnects after partial output | Preserve the partial result and stop unless the caller explicitly accepts a new, separately billed generation. | | `2xx` response lacks the required output | Report an unresolved response mismatch; do not claim success from status alone. | ## Expected states and responses The model-list request should return `200` and a live catalog. A non-streaming chat completion should return `200` and an OpenAI-compatible response containing the generated choice. Streaming returns a sequence of events rather than one complete JSON response. An accepted or partially streamed request is billable work, not an idempotent resource mutation. The service exposes no read endpoint that can reconcile whether an uncertain chat completion finished after the client disconnected. The key and pay-per-token access conditions are checked at request admission. Requests already admitted can complete and are billed even if the key is revoked or regenerated, or organization credits run out during generation. Do not use key deletion or rotation as cancellation, and do not assume these events make an uncertain completion safe to retry. ## Retry behavior Retry `GET /v1/models` only for plausible transient transport, `429`, or server failures within the declared budget. Honor `Retry-After` when present. Do not blindly retry authentication, authorization, validation, or model-not-found responses. Do not automatically retry `POST /v1/chat/completions` after an uncertain transport failure, timeout, server failure, or partial stream. A retry can produce a different answer and another charge. A new attempt requires either clear evidence that the prior request was rejected before processing or explicit caller acceptance of duplicate billable work. ## Verification Success requires all of the following: the exact model appeared in the live catalog, the request returned successfully within budget, and the response or completed stream contains the expected output shape. Record response class, model ID, streaming mode, UTC time, and usage fields when returned. Never treat a successful model-list request as proof that the organization has sufficient credits for a completion. ## Rollback or recovery A generated response cannot be rolled back and consumed tokens cannot be refunded. If output is incomplete or wrong, preserve a redacted failure summary and require approval before sending a revised prompt. Delete sensitive temporary prompt/output artifacts when they are no longer required by the authorized workflow. ## Stop and escalation conditions Stop for a missing or wrong credential type, absent model, unapproved sensitive content, unknown request field, exhausted budget, uncertain completion, repeated rate limiting, persistent service failure, or missing required output. Escalate with the exact endpoint, model ID, UTC time, response class, safe request/trace identifiers, retry history, and redacted error details. Never include the key, prompt, conversation, images, tool arguments/results, or generated content unless the user explicitly authorizes that evidence. ## Evidence to return to the user Return the endpoint, selected live model ID and selection reason, streaming mode, response class, UTC observation time, attempt count, elapsed time, usage metadata when supplied, expected-output check, and any uncertain or escalation state. Report only field names or redacted summaries for sensitive request/response content and credential-bearing headers. # Troubleshoot an AI Gateway Request Source: https://docs.salad.com/agents/ai-gateway/troubleshoot-request Classify Salad AI Gateway authentication, model, request, rate-limit, transport, streaming, and output failures using live evidence without repeating uncertain billable requests. *Last Updated: October 19, 2026* ## When to use this runbook Use when a Salad AI Gateway model-list or chat-completion request fails, times out, is rate limited, disconnects during streaming, or returns missing or unusable output. ## When not to use it Do not use it to inspect SaladCloud backend logs, reveal credentials or prompt content, create or fund an organization, operate a self-hosted Container Engine model, or repeat a completion without explicit authorization when the first request may have been processed. ## Required inputs * Confirmation that `SALAD_AI_GATEWAY_API_KEY` contains an organization-specific AI Gateway key; never collect or print its value. * Exact endpoint path, method, model ID, streaming mode, UTC incident window, client/SDK name and version, and caller attempt/time budget. * Response status, safe headers, redacted error body, and any safe request/trace identifier returned by the service. * The expected output shape and a redacted description of the observed mismatch. * Explicit approval before any new billable diagnostic completion. Treat prompts, messages, conversation history, images, tool definitions/arguments/results, generated output, API keys, and organization billing context as sensitive. ## Authoritative sources | Evidence or behavior | Canonical source | | - | - | | Authentication and key | [Pay-Per-Token Onboarding](/ai-gateway/tutorials/pay-per-token-onboarding) and [Using the API](/reference/api-usage) | | Model IDs and endpoint | [Models reference](/ai-gateway/reference/models) | | Request examples | [Getting Started](/ai-gateway/tutorials/getting-started) | | Rates and billing model | [AI Gateway Pricing](/ai-gateway/reference/pricing) | | Access error codes | [AI Gateway Errors](/ai-gateway/reference/errors) | | Key lifecycle | [Manage Your AI Gateway API Key](/ai-gateway/how-to-guides/manage-api-key) | | Global safety rules | [Safety, Retries, and Freshness](/agents/reference/safety-retries-and-freshness) | No AI Gateway OpenAPI specification is stored in this repository. Treat live responses as evidence, clearly label undocumented behavior, and do not invent fields, error meanings, retry guarantees, backend state, or provider logs. ## Dynamic values to retrieve * Current reachability and response from `GET https://ai.salad.cloud/v1/models`. This endpoint answers without authentication, so its response says nothing about the supplied key. * Current live model IDs and whether the failing exact ID is present. * Exact response class, safe headers, server-provided retry guidance, and redacted problem details. * Current published rate for the selected model when billing is part of the incident. * Client runtime, provider/SDK version, configured base URL, and whether a proxy changed request or streaming behavior. ## Preflight checks 1. Confirm the base URL is exactly `https://ai.salad.cloud/v1` and the selected endpoint is `/models` or `/chat/completions`. 2. Confirm Bearer authentication uses the organization-specific AI Gateway key, not `Salad-Api-Key` or the regular user-level key. 3. Remove key values, prompt/output content, images, tool payloads, and unrelated headers from collected evidence. 4. Determine whether the failed completion could have reached the service. If yes or unknown, prohibit an automatic retry. 5. Define the classification and evidence needed before any diagnostic request. ## Procedure 1. Capture the client/runtime, endpoint, model ID, stream flag, UTC window, response class, safe headers, and redacted error without reproducing the secret or content. 2. Call `GET /v1/models` within a bounded read budget to check reachability and model discovery. A successful catalog read does not verify the key, organization access, or credits for a completion. 3. Check whether the exact model ID is present. Do not normalize spelling or silently choose another model. 4. Compare the request's field names and types with the minimal examples in Getting Started and with the SDK version in use. Do not infer support from another provider. 5. Classify the incident as local configuration, authentication/authorization, unavailable model, request validation, rate limiting, billing/access, transport, service failure, stream handling, or output mismatch. 6. Send a minimal diagnostic completion only with explicit approval and only when it will add evidence not available from the original response and model-list read. 7. Verify the correction once, preserve redacted evidence, and stop or escalate within budget. ## Decision rules | Evidence | Classification and action | | - | - | | Base URL/path differs from the documented endpoint | Correct local configuration, then verify once if authorized. | | Completion returns `401` or `403` | Credential type, validity, or authorization problem; stop and request a valid AI Gateway key. | | `/models` succeeds but exact model is absent | Model-catalog mismatch; stop or request approval for a listed alternative. | | `/models` succeeds and completion returns a clear `4xx` | Inspect documented field names/types and billing/access evidence; do not retry unchanged. | | `402 credits_exhausted` | Ask the user to add credits to the organization associated with the key; stop until its balance is positive. | | `403 no_access` | Verify the intended organization's Gateway key, membership, and access; stop or escalate without retrying unchanged. | | `429` includes retry guidance | Honor it within budget; do not create concurrent retry storms. | | Timeout, transport error, `5xx`, or disconnected stream | Outcome and charge may be uncertain; preserve partial evidence and do not automatically resend. | | `2xx` lacks required choice/content | Output-shape mismatch; record safe response structure and client version, then escalate if reproducible. | | Only a different client fails | Compare base URL, Bearer header construction, serialization, stream parsing, proxies, and exact package versions. | | User reports unexpected spend | Preserve model/usage/time evidence; do not infer credit balance or billing records the Gateway endpoints omit. | ## Expected states and responses `GET /v1/models` should return `200` with a live catalog. `POST /v1/chat/completions` should return a successful OpenAI-compatible response or stream. Error status alone does not prove whether a timed-out or disconnected completion was processed; no reconciliation endpoint for an individual completion is documented. The key and pay-per-token access conditions are checked at admission. Revoking or regenerating a key, or exhausting credits mid-request, does not cancel work already admitted: it can complete and is billed. Do not infer cancellation or absence of charges from a later authentication or credit error. ## Retry behavior Retry only the model-list read for plausible transient failures within a bounded budget, honoring `Retry-After`. Retrying an unchanged authentication, authorization, model, or validation error adds no evidence. Never automatically retry an uncertain completion or partial stream. A diagnostic or replacement completion is new billable work and requires explicit approval. If the service clearly rejected the request before processing, apply a documented correction and verify once within the original budget. ## Verification A diagnosis is verified when live evidence isolates the failure class and the next action has a measurable predicate. When a correction is authorized, success requires the live model list to contain the exact model and one request to return the required output shape. Report unresolved uncertainty instead of converting a successful `/models` read into completion success. ## Rollback or recovery Restore only local client configuration changed during diagnosis. A completion cannot be rolled back, and token usage cannot be reversed from these endpoints. Preserve partial stream output only as long as authorized and never send it again automatically as conversation history. ## Stop and escalation conditions Stop for missing credential/type confirmation, sensitive evidence that cannot be redacted, absent model, unsupported field, unclear billing/access error, uncertain completion, exhausted retry budget, repeated rate limiting, persistent service failure, or reproducible output mismatch. Escalate through [SaladCloud Support](/support/contact) with endpoint, model ID, UTC window, safe request/trace identifiers, client/runtime versions, response class, retry history, and redacted error structure. State which backend or billing evidence is unavailable. ## Evidence to return to the user Return the failure classification, endpoint, exact live model result, stream flag, response classes, safe headers and identifiers, UTC times, client/runtime versions, attempt budget, observed versus expected output shape, correction and verification result, and unresolved evidence. Never return credentials, prompts, conversations, images, tools, model output, or billing details beyond what the user explicitly authorized. # Configure Job Queue Autoscaling Source: https://docs.salad.com/agents/container-engine/configure-job-queue-autoscaling Create or discover a SaladCloud Job Queue and configure a safely verified queue-autoscaled worker group. *Last Updated: October 19, 2026* ## When to use this runbook Use for discrete JSON jobs handled by an HTTP application through the SaladCloud Job Queue Worker, when worker capacity should follow managed queue depth. ## When not to use it Do not use Job Queue autoscaling for direct gateway traffic, stateful jobs that cannot be retried, work that depends on instance-local durable state, or extremely long jobs that are incompatible with the documented interruption/retry model. Do not use it to attach a queue to an already-created group: `queue_connection` is absent from the current Container Group patch schema. ## Required inputs * `SALAD_API_KEY`, `SALAD_ORGANIZATION`, `SALAD_PROJECT`, `SALAD_QUEUE`, and `SALAD_CONTAINER_GROUP`. * A unique queue name and group name, both resolved against live list operations. * Worker image containing the SaladCloud Job Queue Worker and application; application HTTP path and port. * Image/resources/priority, readiness behavior, `min_replicas`, `max_replicas`, and `desired_queue_length`. * Optional `polling_period`, `max_upscale_per_minute`, and `max_downscale_per_minute`. * Explicit user intent for test-job submission, job cancellation, scale-down, stop, group deletion, or queue deletion. ## Authoritative sources | Purpose | Operation and canonical reference | | - | - | | Discover queues | Operation: `list_queues` — [List Queues](/reference/saladcloud-api/queues/list-queues) | | Read queue | Operation: `get_queue` — [Get Queue](/reference/saladcloud-api/queues/get-queue) | | Create queue | Operation: `create_queue` — [Create Queue](/reference/saladcloud-api/queues/create-queue) | | Read/create group | Operations: `get_container_group`, `create_container_group` — [Create Container Group](/reference/saladcloud-api/container-groups/create-container-group) | | Update autoscaler | Operation: `update_container_group` — [Update Container Group](/reference/saladcloud-api/container-groups/update-container-group) | | Submit/read jobs | Operations: `create_queue_job`, `get_queue_job`, `list_queue_jobs` — [Create Job](/reference/saladcloud-api/queues/create-job) | | Cleanup | Operations: `delete_queue_job`, `delete_queue`, `delete_container_group` — [Queue API](/reference/saladcloud-api/queues/delete-queue) | Use [Job Queues](/container-engine/explanation/job-processing/job-queues), [Job Queue Worker](/container-engine/how-to-guides/job-processing/queue-worker), [Job Queue Autoscaling](/container-engine/explanation/infrastructure-platform/autoscaling), and [Autoscaling Settings](/container-engine/reference/autoscaling/settings) for canonical behavior. Use [Cold Starts and Iterating Quickly](/container-engine/how-to-guides/cold-starts-and-iterating-quickly) for test-loop tactics. ## Dynamic values to retrieve * Exact queues and groups already present in the project. * Queue `current_queue_length` and current job states/events. To find the groups attached to a queue, read each group's `queue_connection`. * Group `queue_connection`, `queue_autoscaler`, desired replicas, status/version, instances, and readiness. * Live quota headroom using the planned `max_replicas`, plus current hardware availability. * Worker and application logs for the relevant UTC window. ## Preflight checks 1. Complete [Discover Scope and Preflight](/agents/container-engine/discover-scope-and-preflight), reserving quota headroom for `max_replicas` as required by canonical quota guidance. 2. Call `list_queues` and `list_container_groups`; compare exact names to prevent duplicates. 3. Confirm the application and worker are in the image, the application accepts/returns valid JSON, and the path/port match `queue_connection`. 4. Confirm jobs are idempotent and durable state/results are externalized before acknowledging success. 5. Validate bounds: desired queue length 1–100; minimum replicas 0–100; maximum replicas 1–500; polling period 15–1800 seconds when supplied; optional up/down rates 1–100. Require `min_replicas <= max_replicas`. 6. For scale from zero, accept cold-start latency and configure readiness so the worker does not receive jobs before the application is ready. ## Procedure ### Create or discover the queue 1. Operation: `list_queues`. If the exact queue name exists, call `get_queue` and reuse it only when that is the user's intent. 2. If absent, Operation: `create_queue`. The minimal request is: ```bash theme={null} curl --fail-with-body --silent --show-error \ --request POST \ --url "https://api.salad.com/api/public/organizations/${SALAD_ORGANIZATION}/projects/${SALAD_PROJECT}/queues" \ --header "Salad-Api-Key: ${SALAD_API_KEY}" \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --data '{ "name": "agent-example-queue", "display_name": "Agent Example Queue", "description": "Queue for an approved worker workload" }' ``` Replace the example with the approved `SALAD_QUEUE`; never treat the example as a real resource. Verify with `get_queue`. ### Associate a new worker group and enable autoscaling The actual association is `queue_connection` in Operation: `create_container_group`. The queue and group must be in the same supplied project. Create the group with `queue_connection` and the readiness probe, then set `queue_autoscaler` with Operation: `update_container_group`, then read the group back to confirm the values. This schema-derived scale-from-zero template uses a replica count of 0: ```bash theme={null} curl --fail-with-body --silent --show-error \ --request POST \ --url "https://api.salad.com/api/public/organizations/${SALAD_ORGANIZATION}/projects/${SALAD_PROJECT}/containers" \ --header "Salad-Api-Key: ${SALAD_API_KEY}" \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --data '{ "name": "agent-example-workers", "container": { "image": "/:", "resources": { "cpu": 4, "memory": 8192 }, "environment_variables": { "SALAD_LOG_LEVEL": "info" }, "priority": "batch" }, "autostart_policy": true, "restart_policy": "always", "replicas": 0, "queue_connection": { "path": "/process", "port": 8080, "queue_name": "agent-example-queue" }, "readiness_probe": { "http": { "headers": [], "path": "/ready", "port": 8080, "scheme": "http" }, "failure_threshold": 3, "initial_delay_seconds": 10, "period_seconds": 5, "success_threshold": 1, "timeout_seconds": 2 } }' ``` Then enable autoscaling on the new group with a merge patch. This example scales from zero to a maximum of 2 replicas. The three optional fields (`polling_period`, `max_upscale_per_minute`, `max_downscale_per_minute`) may be left out, and they stay `null`: ```bash theme={null} curl --fail-with-body --silent --show-error \ --request PATCH \ --url "https://api.salad.com/api/public/organizations/${SALAD_ORGANIZATION}/projects/${SALAD_PROJECT}/containers/agent-example-workers" \ --header "Salad-Api-Key: ${SALAD_API_KEY}" \ --header 'Content-Type: application/merge-patch+json' \ --header 'Accept: application/json' \ --data '{ "queue_autoscaler": { "desired_queue_length": 1, "min_replicas": 0, "max_replicas": 2, "polling_period": 30, "max_upscale_per_minute": 2, "max_downscale_per_minute": 1 } }' ``` Replace all examples with approved values and a live hardware plan. For an existing group that already has the correct `queue_connection`, read it, then patch only `queue_autoscaler` with Operation: `update_container_group` and verify. When the worker image is not yet proven, create the group with an approved fixed replica count instead of 0, confirm a test job reaches `succeeded` (test-job submission needs explicit intent), and only then apply `queue_autoscaler`. The autoscaler sets the replica count from queue length, so it overrides the fixed count. See [Cold Starts and Iterating Quickly](/container-engine/how-to-guides/cold-starts-and-iterating-quickly). ### Verify scaling behavior 1. Read the group and queue; verify both sides of the association. 2. Submit a test job only with explicit user intent. Operation: `create_queue_job` returns the job and generated ID. 3. Poll `get_queue`, `get_container_group`, `list_container_group_instances`, and `get_queue_job` within a bounded budget. 4. Verify the queue grows, desired/observed worker capacity changes within the configured boundaries, a current-version instance becomes ready, and the job reaches a terminal status. 5. After the queue drains, verify the group returns no lower than `min_replicas`; with minimum 0, expect cold starts on subsequent jobs. Scaling from zero adds a cold start of a few minutes before the first job runs, while a new instance is allocated, pulls the image, and passes readiness. Plan the polling budget for it. ### Worker, retry, and webhook behavior The canonical queue documentation states that the worker forwards JSON to the configured HTTP application; `200` indicates job success and `500` indicates failure. A failed job can be retried up to three times (four total attempts), and an instance interruption counts as a failed attempt. Design handlers to be idempotent by job ID or application idempotency key, and commit output to external storage before returning success. The current local queue docs/OpenAPI do not define an agent-configurable acknowledgment timeout. Do not invent one. Observe job events and worker logs. When a job uses a webhook, validate the documented `webhook-signature`, `webhook-id`, and `webhook-timestamp` headers as described in [Webhook Signatures](/container-engine/how-to-guides/job-processing/webhook-signature). Never expose the webhook secret. ## Decision rules | Situation | Action | | - | - | | Exact queue/group name already exists | Read and reconcile; do not create a duplicate. | | Existing group has correct `queue_connection` | Patch autoscaler only after a read. | | Existing group lacks or has wrong `queue_connection` | Stop; patch schema cannot attach/change it. Ask for an approved replacement strategy. | | Minimum replicas is 0 | Accept cold-start delay and require readiness before dispatch. | | Maximum replicas exceeds live quota headroom | Stop or request an approved lower maximum/quota increase. | | Queue has jobs but no scaling | Check association, autoscaler, quota/availability, group status, readiness, and worker logs in that order. | | Job retries repeat the same application error | Fix the worker/application; do not reallocate nodes blindly. | | Cleanup would cancel jobs, reduce capacity, or delete resources | Require explicit user intent. | ## Expected states and responses Queue/group creation returns `201`; update returns `200`; job creation returns `201`; delete/cancel operations return `202`. Queue job statuses are `pending`, `running`, `succeeded`, `cancelled`, and `failed`. A queue response can include `current_queue_length`; treat an absent optional current length as unknown. Confirm an association from the group's `queue_connection`. Canonical autoscaling guidance uses `ceil(queue length / desired queue length)` bounded by minimum/maximum and rate settings. Verify actual live behavior rather than calculating success from the formula alone. ## Retry behavior Reconcile any uncertain queue or group create by exact name before retrying. Reconcile a job create only by its returned job ID; if the outcome is unknown and no ID was returned, stop rather than submitting the job again. Retry reads within a bounded budget; honor `Retry-After` when present. Do not resubmit a failed job automatically: the handler may already have produced side effects. Use an application idempotency record and explicit retry intent. ## Verification | Mutation | Read before | Read after | Success | Failure or unresolved | | - | - | - | - | - | | Create queue | `list_queues` | `get_queue` | Exact queue exists with intended metadata | Duplicate ambiguity, mismatch, or unresolved `404` | | Create associated group | Queue/group lists | `get_container_group` | Group has the intended `queue_connection`; `queue_autoscaler` is applied by the following update | Mismatch, group failure, or `queue_connection` absent past budget | | Update autoscaler | `get_container_group` | Same plus queue/instances | `queue_autoscaler` values match and scaling stays within bounds | Mismatch, quota/availability block, or no response to queued work past budget | | Submit test job | `get_queue` | `get_queue_job` plus scaling reads | Job reaches intended terminal status and scaling predicate is observed | Failed/cancelled unexpectedly or pending/running past budget | ## Rollback or recovery * Restore only the previous autoscaler object with a fresh merge patch when it is known and authorized. * Do not detach a queue through an undocumented field; the current patch schema has no `queue_connection`. * Preserve a failed job and logs for diagnosis. Resubmit only after the cause is corrected and idempotency is proven. * Safe cleanup begins with `get_queue`, `list_queue_jobs`, `get_container_group`, and instance reads. The queue's `container_groups` list can be empty even while a connected group is running, so check each group's `queue_connection` to find groups attached to the queue. If any group is attached or any job is active, stop. Cancel jobs, reduce/stop/delete capacity, and delete the queue only with explicit intent, then verify each deletion in the same trusted scope. * Deleting a queue permanently removes its connection from every attached group, and the group keeps running with no queue. Recreating a queue with the same name does not reconnect it. * Stopping or deleting a group does not stop its worker at once, and the old container can take new jobs for a short time afterwards. Those jobs read `running` until the queue notices the worker is gone, which takes several minutes, and longer when no other worker is polling the queue. Stop job submission or let the queue drain first. * Cancelling a running job does not stop it. The instance runs the job to the end and the output is discarded. ## Stop and escalation conditions Stop for missing worker/image/path/port, non-idempotent state handling, duplicate ambiguity, unsupported association changes, insufficient quota/availability, missing destructive intent, repeated job failure, no scale response past the polling budget, or missing logs/events. Escalate with queue/group/job IDs, UTC times, association/autoscaler settings, queue length, instance readiness, worker logs, and dynamic quota/availability evidence. ## Evidence to return to the user Return validated scope and exact names; operation IDs/status classes; queue ID/current length; group version/status; redacted association and autoscaler settings; quota headroom; observed min/max/ready capacity; test job ID/status/events; polling window; retries; idempotency/external-state confirmation; cleanup performed or skipped; and unresolved or escalation status. Never return API, registry, or webhook secrets. # Deploy or Update a Container Group Source: https://docs.salad.com/agents/container-engine/deploy-or-update-container-group Create or safely update a SaladCloud Container Group with duplicate prevention and post-write verification. *Last Updated: October 13, 2026* ## When to use this runbook Use to create a new Container Group or change the configuration of one existing Container Group through the public API. ## When not to use it Do not use it to start, stop, monitor, or replace an individual instance; use [Monitor and Operate a Container Group](/agents/container-engine/monitor-and-operate-container-group). Do not create a second group as an implicit rollback or workaround. ## Required inputs * `SALAD_API_KEY`, `SALAD_ORGANIZATION`, `SALAD_PROJECT`, and intended `SALAD_CONTAINER_GROUP` name. * Container image reference, CPU cores, RAM in MB, optional storage in bytes, live GPU class UUIDs if needed, desired replicas, priority, restart policy, and autostart choice. * Optional command, environment-variable map, private-registry credentials, countries, networking, probes, queue connection, autoscaler, and scheduled scaling settings. * Explicit user intent for an update that scales down, interrupts/replaces running replicas, changes the image or resources, weakens authentication/health controls, or stops/deletes a resource. Use caller-provided secret variables such as `SALAD_REGISTRY_USERNAME`, `SALAD_REGISTRY_PASSWORD`, `SALAD_REGISTRY_TOKEN`, or `SALAD_REGISTRY_SERVICE_KEY` only when the selected registry schema requires them. Never echo them or include them in evidence. ## Authoritative sources | Purpose | Operation and canonical reference | | - | - | | Duplicate check | Operation: `list_container_groups` — [List Container Groups](/reference/saladcloud-api/container-groups/list-container-groups) | | Read current target | Operation: `get_container_group` — [Get Container Group](/reference/saladcloud-api/container-groups/get-container-group) | | Create | Operation: `create_container_group` — [Create Container Group](/reference/saladcloud-api/container-groups/create-container-group) | | Update | Operation: `update_container_group` — [Update Container Group](/reference/saladcloud-api/container-groups/update-container-group) | | Verify instances | Operation: `list_container_group_instances` — [List Instances](/reference/saladcloud-api/container-groups/list-container-group-instances) | Use [Managing Deployments](/container-engine/how-to-guides/managing-deployments), [Container Registries](/container-engine/explanation/infrastructure-platform/container-registries), and [Health Probes](/container-engine/explanation/infrastructure-platform/health-probes) for product behavior. Use [Cold Starts and Iterating Quickly](/container-engine/how-to-guides/cold-starts-and-iterating-quickly) for test-loop tactics. ## Dynamic values to retrieve * Exact existing group names and the current target representation, including `version`, `pending_change`, `replicas`, `current_state`, container settings, priority, networking, probes, and queue settings. * Current quota, GPU class UUIDs, and CPU/GPU availability from [Discover Scope and Preflight](/agents/container-engine/discover-scope-and-preflight). * Current instances and their versions when the update can roll out new configuration. Registry authentication is not present in the Container Group response schema. Require credentials again when a private image update needs them; do not assume they can be recovered from a read. ## Preflight checks 1. Complete the scope, duplicate, quota, hardware, and availability checks in the preflight runbook. 2. Call `list_container_groups` and compare the exact `name`, not `display_name`, with the intended name. 3. If the exact name exists, call `get_container_group` and compare current versus intended configuration. 4. If it does not exist, validate the create body against `ContainerGroupPrototype`. Required fields are `name`, `container`, `replicas`, `restart_policy`, and `autostart_policy`; `container` requires `image` and `resources`; create resources require `cpu` and `memory`. 5. For an update, use `application/merge-patch+json` and the `ContainerGroupPatch` schema. Do not send response-only fields such as `id`, `current_state`, `version`, `create_time`, or `update_time`. 6. Record a redacted pre-change copy and success predicate. If a current secret value is masked or omitted and the planned update could replace it, stop for that value. ## Procedure ### Create a group Create only when the exact-name list check proves the group is absent. This example is a schema-derived template; the image placeholder must be replaced, and GPU class UUIDs must come from the live API when GPUs are required. ```bash theme={null} curl --fail-with-body --silent --show-error \ --request POST \ --url "https://api.salad.com/api/public/organizations/${SALAD_ORGANIZATION}/projects/${SALAD_PROJECT}/containers" \ --header "Salad-Api-Key: ${SALAD_API_KEY}" \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --data '{ "name": "agent-example-group", "display_name": "Agent Example Group", "container": { "image": "/:", "resources": { "cpu": 4, "memory": 8192, "storage_amount": 10737418240 }, "environment_variables": { "APP_MODE": "production" }, "priority": "high" }, "autostart_policy": false, "restart_policy": "always", "replicas": 2, "networking": { "protocol": "http", "auth": true, "port": 8080 }, "readiness_probe": { "http": { "headers": [], "path": "/ready", "port": 8080, "scheme": "http" }, "failure_threshold": 3, "initial_delay_seconds": 10, "period_seconds": 5, "success_threshold": 1, "timeout_seconds": 2 } }' ``` Replace `agent-example-group` with the approved `SALAD_CONTAINER_GROUP` value when constructing the actual request; do not execute the example name. Set `autostart_policy: true` only when the user intends creation to start capacity. When the image or configuration is not yet proven, follow [Cold Starts and Iterating Quickly](/container-engine/how-to-guides/cold-starts-and-iterating-quickly): validate ports, probes, and queue or gateway settings with a small image first, then update to the real image. For a start failure, debug with `"command": ["sleep", "2147483647"]` and the startup and liveness probes removed. Each of these is an update and needs the same user intent as any other. ### Update a group 1. Read with `get_container_group` immediately before the patch. 2. Build nested objects using only fields allowed by `ContainerGroupPatch`, carrying forward any unrelated caller-managed values that the selected patch could replace. For environment variables, preserve unrelated key/value pairs locally and do not log secret values. 3. Send the smallest merge patch that has an unambiguous effect. For example, an approved scale-up from the observed replica count to 3 is: ```bash theme={null} curl --fail-with-body --silent --show-error \ --request PATCH \ --url "https://api.salad.com/api/public/organizations/${SALAD_ORGANIZATION}/projects/${SALAD_PROJECT}/containers/${SALAD_CONTAINER_GROUP}" \ --header "Salad-Api-Key: ${SALAD_API_KEY}" \ --header 'Content-Type: application/merge-patch+json' \ --header 'Accept: application/json' \ --data '{"replicas":3}' ``` 4. Call `get_container_group` after the write. If runtime configuration changed, call `list_container_group_instances` and compare each instance `version` with the group `version`. 5. Poll within the declared budget until the success condition is met or report partial/pending state. ## Decision rules | Current evidence and intent | Action | | - | - | | No exact-name group exists | Create after complete preflight. | | Exact-name group exists and matches intent | Return no-op success with the fresh read. | | Exact-name group exists but differs | Patch it; do not create a duplicate. | | Only `display_name` matches | Treat as ambiguous and ask for the intended immutable `name`. | | User requests fewer replicas | Require explicit capacity-reduction intent before patching. | | User changes image, command, environment, probes, or gateway settings | Warn that canonical deployment guidance says a new container version can restart replicas. | | User changes CPU, RAM, GPU, or storage | Warn that noncompliant instances may be reallocated. | | User lowers priority on a running group | Warn that lowering is allowed only after 1 hour at the current priority; if the API returns `400` `container_group_update_exception`, report it and offer stop, change priority, start. | | User requests autostart/restart-policy update | Stop: those fields are required on create but absent from the current patch schema. | | User requests gateway auth/protocol update | Stop: the current patch schema exposes only networking `port`. | | Existing group lacks `queue_connection` | Do not attach it with update: the current patch schema has no `queue_connection`; request an approved replacement strategy. | Priority is `container.priority` in create/update requests. Valid values are `high`, `medium`, `low`, and `batch`. Priority changes apply to running instances immediately without a restart. Raising priority on a running group is allowed at any time. Lowering it is allowed only after the group has been running at its current priority for 1 hour, counted from the last start or last priority change; an earlier request fails with HTTP `400` and problem type `container_group_update_exception`, and the group keeps its current priority. Stopping clears the timer. See [Changing Priority](/container-engine/explanation/billing-pricing/priority-pricing#changing-priority). Select at most the approved countries through `country_codes`; omitting the field permits any country. For a probe, choose the intended `exec`, `grpc`, `http`, or `tcp` handler and include all required timing fields. Startup protects slow initialization; readiness controls whether work or gateway traffic should reach a running instance; liveness detects an unrecoverable running application. Misconfigured startup or liveness probes can cause reallocation, so validate the handler inside the image before enabling it. ## Expected states and responses * Create returns `201` with a Container Group representation. With image preparation or autostart, status may progress through `pending`, `stopped`, `deploying`, and `running`; use the live response, not a fixed sequence assumption. * Update returns `200`. `pending_change: true` means requested configuration has not reached all containers. * Group status enum values are `pending`, `running`, `stopped`, `succeeded`, `failed`, and `deploying`. * Instance state enum values are `allocating`, `downloading`, `creating`, `running`, and `stopping`. * `replicas` is desired capacity. Compare it with `current_state.instance_status_counts` and the instance list; ready capacity requires `state: running` and `ready: true` when readiness matters. ## Retry behavior Retry reads within a bounded budget. Do not retry `create_container_group` until an exact-name list/get reconciliation proves the first request did not create the resource. Before retrying a patch, re-read and skip it if the desired state already applied. Do not retry unchanged `400`, `401`, or `403` responses. Honor `Retry-After` on `429` when present. ## Verification | Mutation | Verification read | Success | Failure or unresolved | | - | - | - | - | | `create_container_group` | `get_container_group` by the exact created name | Configuration matches and reaches the user-approved stopped or running predicate | `failed`, mismatch, `404` after reconciliation, or pending past budget | | `update_container_group` | `get_container_group`, then `list_container_group_instances` when runtime changes | Intended fields match, `pending_change` clears, and required instances run the current group version | Mismatch, group `failed`, partial old versions past budget, or pending past budget | Never claim deployment success solely from `201` or `200`. ## Rollback or recovery * For an update, re-read, then merge-patch only changed fields back to captured pre-change values. Verify again. * Image rollback for a private registry requires the prior image reference and usable registry credentials; stop if they are unavailable. * If a create prepares but fails, retain it for logs and system events. Deletion requires explicit user intent. * If availability or quota prevents convergence, do not silently relax hardware, countries, priority, or replicas. ## Stop and escalation conditions Stop for ambiguous names, missing required fields or secrets, insufficient quota/availability, unsupported patch fields, masked values that cannot be preserved, missing interruption authorization, persistent `pending_change`, a `failed` group, or instances that do not converge before the polling budget. Continue with the [troubleshooting runbook](/agents/container-engine/troubleshoot-container-group) before escalation. ## Evidence to return to the user Return the scope and exact group name; create-versus-update decision; redacted changed field names; operation IDs and response classes; old/new group versions; desired replicas; status and instance counts; current-version ready/running instances; UTC start/end times; retry/poll count; and rollback, partial, or escalation status. Do not return environment values or registry/API credentials. # Discover Scope and Preflight Source: https://docs.salad.com/agents/container-engine/discover-scope-and-preflight Validate SaladCloud scope, quotas, hardware constraints, and live CPU or GPU availability before deployment. *Last Updated: August 24, 2026* ## When to use this runbook Use before creating, updating, starting, or scaling a Container Group, and before configuring Job Queue autoscaling. ## When not to use it Do not use static examples to answer whether a GPU, quota, country, or priority is currently available. Do not use this runbook to create resources. ## Required inputs * `SALAD_API_KEY` as a secret environment variable. * Candidate `SALAD_ORGANIZATION` and `SALAD_PROJECT` names from the user, a trusted deployment file, or the Portal. * Required CPU cores, RAM in MB, storage in bytes, replica count, country constraints, and priority. * For GPU workloads, a required GPU model/class or workload requirement. If minimum VRAM is mandatory, obtain a trusted mapping to an API-returned GPU class; the current public schema does not expose a VRAM field. ## Authoritative sources | Purpose | Operation and canonical reference | | - | - | | Validate organization and read quota | Operation: `get_quotas` — [Get Quotas](/reference/saladcloud-api/organizations/get-quotas) | | Validate project and list existing groups | Operation: `list_container_groups` — [List Container Groups](/reference/saladcloud-api/container-groups/list-container-groups) | | Discover live GPU class IDs and constraints | Operation: `list_gpu_classes` — [List GPU Classes](/reference/saladcloud-api/organizations/list-gpu-classes) | | Estimate GPU availability | Operation: `get_gpu_availability` — [Get GPU Availability](/reference/saladcloud-api/organizations/get-gpu-availability) | | Estimate CPU availability | Operation: `get_cpu_availability` — [Get CPU Availability](/reference/saladcloud-api/organizations/get-cpu-availability) | Also read [Availability](/container-engine/explanation/infrastructure-platform/availability), [Priority Pricing](/container-engine/explanation/billing-pricing/priority-pricing), and [Quotas](/container-engine/reference/quotas) for product context. ## Dynamic values to retrieve * `container_replicas_quota` and `container_replicas_used` from the live quota response. * GPU class UUIDs, names, priority prices, and current minimum/maximum vCPU, RAM, and storage values. * Priority-specific GPU counts or CPU counts for the exact resource and `country_codes` filter. * Existing Container Group names in the project and the target's current representation, if present. Availability is an estimate of currently online capacity, not a reservation or allocation guarantee. Re-query after a meaningful delay or immediately before a later mutation; do not cache it as permanent inventory. ## Preflight checks 1. Require candidate organization and project **names**. The public spec has no operation to enumerate accessible organizations or projects. 2. Call `get_quotas`. A successful response validates the candidate organization in the caller's current access scope. 3. Call `list_container_groups`. A successful response validates the candidate project and returns the exact existing Container Group names in its `items` collection. The current operation defines no pagination parameters. 4. Confirm `requested replicas <= quota - used`, accounting for current target capacity and autoscaler maximum where relevant. 5. For GPU work, call `list_gpu_classes`; select UUIDs only from that response, then call `get_gpu_availability` with those UUIDs and exact CPU, memory, storage, and country constraints. 6. For CPU-only work, call `get_cpu_availability` with the exact constraints. 7. Confirm requested values meet current schema bounds. `replicas` is 0–500; GPU class IDs are UUIDs; memory is MB; storage is bytes; priority enum values are `high`, `medium`, `low`, and `batch`. 8. Confirm any country restriction uses the `country_codes` field. The current Container Group schema has no separate region field. ## Procedure Set the non-secret scope variables without echoing `SALAD_API_KEY`: ```bash theme={null} export SALAD_ORGANIZATION='' export SALAD_PROJECT='' ``` Validate the organization and quota: ```bash theme={null} curl --fail-with-body --silent --show-error \ --url "https://api.salad.com/api/public/organizations/${SALAD_ORGANIZATION}/quotas" \ --header "Salad-Api-Key: ${SALAD_API_KEY}" \ --header 'Accept: application/json' ``` Validate the project and retrieve existing groups: ```bash theme={null} curl --fail-with-body --silent --show-error \ --url "https://api.salad.com/api/public/organizations/${SALAD_ORGANIZATION}/projects/${SALAD_PROJECT}/containers" \ --header "Salad-Api-Key: ${SALAD_API_KEY}" \ --header 'Accept: application/json' ``` For a GPU workload, first call `list_gpu_classes`, choose only UUIDs returned for this organization, and submit the exact planned requirements to `get_gpu_availability`: ```bash theme={null} curl --fail-with-body --silent --show-error \ --request POST \ --url "https://api.salad.com/api/public/organizations/${SALAD_ORGANIZATION}/availability/sce-gpu-availability" \ --header "Salad-Api-Key: ${SALAD_API_KEY}" \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --data '{ "gpu_classes": [""], "cpu": 4, "memory": 8192, "storage_amount": 10737418240 }' ``` Use the equivalent CPU availability operation for CPU-only work. Add `country_codes` only when the user requires a location constraint. ## Decision rules | Evidence | Decision | | - | - | | Organization or project name not supplied by a trusted source | Stop; do not guess or enumerate. | | `401` or `403` | Stop and request valid authorization. | | Scoped `404` | Reconfirm the supplied name; do not search by invented variants. | | Existing group has the intended name | Read it and use the update decision path; do not create a duplicate. | | Quota headroom is insufficient | Stop before mutation and report required versus available headroom. | | Selected priority availability is below requested replicas | Report the shortfall; ask whether to change constraints or proceed with expected pending allocation. | | Required VRAM cannot be mapped to a live GPU class from trusted data | Stop and request an approved GPU class; do not infer from a model name. | | Country, RAM, CPU, storage, or GPU filters produce no capacity | Relax only constraints explicitly approved by the user. | The CPU-only product documentation describes CPU groups as Lowest priority, whose API enum is `batch`. Do not translate human labels into other enum values. ## Expected states and responses Successful reads return `200`. GPU availability exposes `available_gpu_high`, `available_gpu_medium`, `available_gpu_low`, `available_gpu_batch`, and `on_call_gpu` when present. CPU availability exposes `available_cpu_batch` and `on_call_cpu` when present. Treat absent optional properties as unknown, not zero. ## Retry behavior Reads and availability checks may be retried for transient transport, `429`, or `5xx` failures within a bounded attempt/time budget. Honor `Retry-After` when present. Do not retry an unchanged invalid request or authorization error. ## Verification Preflight succeeds only when the supplied names are validated by successful scoped reads, the intended resource name is checked for duplicates, quota headroom is sufficient, selected hardware satisfies schema and live class constraints, and current availability has been queried for the exact plan. ## Rollback or recovery This runbook performs reads only, so no API rollback is required. Discard cached availability and re-run preflight after the deployment plan, priority, hardware, countries, replica count, or scope changes. ## Stop and escalation conditions Stop on missing scope, missing credentials, insufficient access, insufficient quota, unknown GPU/VRAM mapping, ambiguous existing resources, invalid constraints, or unavailable required capacity. Escalate quota or sustained capacity needs with the exact requested constraints and UTC query time; never include the API key. ## Evidence to return to the user Return the validated organization/project names, exact target name, quota/usage/headroom, requested replica count, selected GPU class UUIDs and names or CPU-only selection, RAM/CPU/storage/country/priority constraints, priority-specific availability response, duplicate check result, UTC observation time, and a clear proceed/stop recommendation. # Monitor and Operate a Container Group Source: https://docs.salad.com/agents/container-engine/monitor-and-operate-container-group Read, scale, start, stop, and monitor SaladCloud Container Groups with bounded polling and verification. *Last Updated: November 12, 2026* ## When to use this runbook Use to read current group and instance state, retrieve logs or system events, scale safely, start or stop a group, and report asynchronous or partial outcomes. ## When not to use it Do not use it to create or change runtime configuration beyond replica count. Do not reallocate, recreate, restart, delete, or replace anything without the task-specific evidence and explicit user intent described here and in the [troubleshooting runbook](/agents/container-engine/troubleshoot-container-group). ## Required inputs * `SALAD_API_KEY`, `SALAD_ORGANIZATION`, `SALAD_PROJECT`, and exact `SALAD_CONTAINER_GROUP` name. * The requested observation window in UTC for logs/events. * For scaling, the intended replica count and quota/capacity constraints. * Explicit user intent before stop, scale-down, delete, reallocate, recreate, restart, or replacement. * A caller-defined polling attempt and elapsed-time budget. ## Authoritative sources | Purpose | Operation and canonical reference | | - | - | | Read group | Operation: `get_container_group` — [Get Container Group](/reference/saladcloud-api/container-groups/get-container-group) | | Read instances | Operation: `list_container_group_instances` — [List Instances](/reference/saladcloud-api/container-groups/list-container-group-instances) | | Inspect one instance | Operation: `get_container_group_instance` — [Get Instance](/reference/saladcloud-api/container-groups/get-container-group-instance) | | Scale | Operation: `update_container_group` — [Update Container Group](/reference/saladcloud-api/container-groups/update-container-group) | | Start | Operation: `start_container_group` — [Start Container Group](/reference/saladcloud-api/container-groups/start-container-group) | | Stop | Operation: `stop_container_group` — [Stop Container Group](/reference/saladcloud-api/container-groups/stop-container-group) | | Query application and system logs | Operation: `query_log_entries` — [Query Log Entries](/reference/saladcloud-api/logs/query-log-entries) | | Legacy group system logs | Operation: `get_system_logs` — [Get Container Group Logs](/reference/saladcloud-api/container-groups/get-container-group-logs) | | Scale-up preflight | Operations: `get_quotas`, `list_gpu_classes`, `get_gpu_availability`, `get_cpu_availability` — [Preflight](/agents/container-engine/discover-scope-and-preflight) | | Queue drain evidence | Operations: `get_queue`, `list_queue_jobs` — [Queue API](/reference/saladcloud-api/queues/get-queue) | The canonical `get_system_logs` page marks that endpoint deprecated and directs users to `query_log_entries`, although the current OpenAPI operation is not marked deprecated. Prefer `query_log_entries` and use [Log Queries](/container-engine/reference/log-queries) for filters. ## Dynamic values to retrieve * Group `status`, `replicas`, `version`, `pending_change`, and `instance_status_counts`. * Every instance `id`, `machine_id`, `state`, `ready`, `started`, `version`, `update_time`, and pulling progress when present. * Current quota/availability before scale-up. * Queue length and in-flight jobs before reducing workers. * Logs and events for a bounded UTC range; query both controller resource types and `container` logs when diagnosing. ## Preflight checks 1. Read the group, then list instances. Stop on `404` until the supplied scope/name is reconfirmed. 2. Compare the current state with the requested state; avoid a no-op mutation. 3. Before scale-up, run quota and availability preflight for the additional replicas. 4. Before scale-down or stop, identify active jobs/requests, externalize state, and obtain explicit user intent. If `queue_connection` is configured, read the exact queue with `get_queue` and jobs with `list_queue_jobs`. For direct gateway traffic, stop if the caller cannot provide a safe drain predicate; no active-request read is documented. 5. Record the current version, desired replicas, instance IDs/states, and a success predicate. 6. For log queries, use explicit UTC `start_time`/`end_time`, project and group filters, and the smallest useful page size/window. ## Procedure ### Read and classify current capacity 1. Call `get_container_group`. 2. Call `list_container_group_instances`. 3. Treat `replicas` as desired capacity. Use `current_state.instance_status_counts` for allocating, creating, running, and stopping totals. The summary has no downloading count; count `state: downloading` in the instance list. 4. Count ready capacity from instances where `state` is `running` and `ready` is `true`. Do not infer a `failed` instance state; it is not in the current enum. ### Scale up or down 1. Read with `get_container_group` immediately before the mutation. 2. For scale-up, validate quota and availability. For scale-down, confirm explicit intent and workload drain behavior. 3. Operation: `update_container_group`. Send `Content-Type: application/merge-patch+json` and only the approved `replicas` value. 4. Verify with `get_container_group` and `list_container_group_instances` until the desired and required ready capacity predicate is met or the polling budget ends. ### Start 1. Read with `get_container_group`; skip if it already satisfies the user's running predicate. 2. Operation: `start_container_group`. A successful request returns `202 Accepted` with no response body. 3. Verify with `get_container_group` and `list_container_group_instances` until the group is `running` and required instances are current-version, running, and ready. ### Stop 1. Read with `get_container_group` and list instances. Confirm explicit stop intent and record active work. 2. Operation: `stop_container_group`. A successful request returns `202 Accepted` with no response body. 3. Verify with `get_container_group` and `list_container_group_instances`. A group can report `stopped` while stop messages are still propagating, so report pending until no instance remains running or the polling budget ends. ### Inspect logs and system events Use Operation: `query_log_entries` with resource filters: * `resource.type = "deployment_controller"` for group-level system events. * `resource.type = "instance_controller"` for instance lifecycle and probe events. * `resource.type = "container"` for stdout/stderr application logs. Always add `resource.labels.project_name` and `resource.labels.container_group_name`; add `instance_id` or `machine_id` only after retrieving it live. Keep relevant trace/span identifiers from the response when present. ## Decision rules | Operation | Meaning and authorization | | - | - | | Stop group | Retains the resource configuration but requests all workload capacity to stop; explicit intent required. | | Delete group | Removes the resource asynchronously; not part of this runbook and always requires explicit destructive intent. | | Restart instance | Restarts the container on the same node; local data may remain according to canonical deployment guidance, but interruption intent is required. | | Recreate instance | Rebuilds the container on the same node; treat local container state as disposable and require intent. | | Reallocate instance | Moves work to another node and restarts allocation/download; use only for evidence-backed node conditions and require intent. | | Replace group | Creates a separately named group and changes traffic/workflows; this is a deployment strategy, not an automatic recovery. | | Observed capacity | Report | | - | - | | Desired equals ready/running current-version count | Converged for the declared predicate. | | Some, but not all, desired instances are ready | Partial success with exact counts and states. | | Desired count is set but instances remain allocating/downloading/creating | Accepted but pending; continue bounded polling and inspect events. | | Group is `running` but ready count is zero | Runtime started but service is unavailable; troubleshoot readiness/application/networking. | | Group is `failed` | Stop normal polling and troubleshoot preparation/configuration. | ## Expected states and responses Group statuses are `pending`, `running`, `stopped`, `succeeded`, `failed`, and `deploying`. Instance states are `allocating`, `downloading`, `creating`, `running`, and `stopping`. Instance `started` reports startup completion; `ready` reports readiness. A running instance can therefore be started but not ready. `update_container_group` returns `200`; start and stop return `202`. The current spec defines `202` for `get_container_group_instance`, even though it is a read; consume the response body and do not reinterpret that status as completion of a mutation. ## Retry behavior Poll with bounded exponential backoff and jitter within the caller's total time/attempt budget. Honor `Retry-After` when present. Re-read state before retrying a start, stop, or scale request. Do not retry a scale-down or stop without the original explicit intent, and do not extend the polling budget indefinitely. Log queries (`query_log_entries`, `get_system_logs`) have [daily limits](/container-engine/explanation/container-groups/container-logs#daily-log-query-limits) per organization and per account. Use `list_container_group_instances` for instance state instead of polling logs. A `429` from a log query lasts until 00:00 UTC: stop log queries and report it to the user rather than retrying. ## Verification | Mutation | Read before | Read after | Success | Failure or unresolved | | - | - | - | - | - | | Scale | `get_container_group`, `list_container_group_instances` | Same operations | Desired `replicas` matches and required ready/current-version count is reached | Mismatch, `failed`, partial capacity, or pending past budget | | Start | `get_container_group` | Group plus instances | `running` and declared ready/current-version capacity reached | `failed`, no ready capacity, or pending past budget | | Stop | Group plus instances | Same operations | `stopped` and no instance remains running | Running/stopping instances remain past budget or status fails to converge | ## Rollback or recovery * Scale-up can be reversed only with explicit approval to reduce capacity; do not auto-scale back down. * A mistaken scale-down can be corrected by restoring the captured replica count after fresh quota/availability checks. * A mistaken start can be stopped only with explicit stop intent. A mistaken stop can be started after confirming the intended capacity and availability. * Preserve logs/events before instance turnover or another mutation changes the evidence. ## Stop and escalation conditions Stop on missing intent, ambiguous scope, insufficient quota, active work that cannot drain, group `failed`, repeated non-transient errors, or convergence beyond the polling budget. When pending, return the last state and UTC update time; do not claim failure solely because allocation is slow. Use the troubleshooting decision tree and collect an escalation package if evidence remains inconclusive. ## Evidence to return to the user Return scope/name, requested action, operation IDs/status classes, before/after group status and version, desired replicas, counts by actual instance state, current-version running/ready counts, relevant instance IDs, UTC observation window, event/log query filters, partial/pending classification, polling attempts/elapsed time, and next safe action. Redact credentials, environment values, and sensitive log content. # Troubleshoot a Container Group Source: https://docs.salad.com/agents/container-engine/troubleshoot-container-group Deterministic Container Engine troubleshooting for allocation, image, startup, probes, networking, and application failures. *Last Updated: October 7, 2026* ## When to use this runbook Use when a Container Group fails preparation, remains allocating/downloading/creating, runs without becoming ready, returns application/gateway errors, repeatedly exits, or shows inconsistent performance. ## When not to use it Do not use troubleshooting as authorization to change configuration, stop capacity, delete a group, or reallocate an instance. Do not diagnose infrastructure failure solely from performance variation. ## Required inputs * `SALAD_API_KEY`, `SALAD_ORGANIZATION`, `SALAD_PROJECT`, and exact `SALAD_CONTAINER_GROUP`. * Incident start/end timestamps in UTC and the expected healthy behavior. * The affected request/job/instance identifiers when available. * Recent configuration changes, reproduction steps, and a comparison baseline for performance incidents. * Explicit user intent before any corrective mutation that interrupts work or changes capacity/configuration. ## Authoritative sources | Evidence | Operation and canonical reference | | - | - | | Group configuration/status | Operation: `get_container_group` — [Get Container Group](/reference/saladcloud-api/container-groups/get-container-group) | | Instance inventory | Operation: `list_container_group_instances` — [List Instances](/reference/saladcloud-api/container-groups/list-container-group-instances) | | One instance | Operation: `get_container_group_instance` — [Get Instance](/reference/saladcloud-api/container-groups/get-container-group-instance) | | System/application evidence | Operation: `query_log_entries` — [Query Log Entries](/reference/saladcloud-api/logs/query-log-entries) | | Legacy system events | Operation: `get_system_logs` — [Get Container Group Logs](/reference/saladcloud-api/container-groups/get-container-group-logs) | | Availability/quota | Operations: `get_quotas`, `list_gpu_classes`, `get_gpu_availability`, `get_cpu_availability` — [Preflight](/agents/container-engine/discover-scope-and-preflight) | | Management reallocation | Operation: `reallocate_container_group_instance` — [Reallocate Instance](/reference/saladcloud-api/container-groups/reallocate-container-group-instance) | | In-instance health | Operation: `get_status` — [IMDS Status](/reference/imds/get-status) | | In-instance reallocation | Operation: `reallocate` — [IMDS Reallocate](/reference/imds/reallocate) | Use [Troubleshooting](/container-engine/how-to-guides/troubleshooting), [Deployment Lifecycle](/container-engine/explanation/container-groups/deployment-lifecycle), [System Events](/container-engine/explanation/container-groups/system-events), and [Health Probes](/container-engine/explanation/infrastructure-platform/health-probes) to interpret evidence. Use [Cold Starts and Iterating Quickly](/container-engine/how-to-guides/cold-starts-and-iterating-quickly) to debug startup by hand. ## Dynamic values to retrieve * Current group representation, status, pending-change flag, desired replicas, version, priority, countries, image, resources, command, networking, and probe configuration. * Every current instance state, `started`, `ready`, version, pulling progress, machine/instance ID, and update time. * Controller events and container logs for the incident UTC window. * Current quota, GPU class constraints, availability for exact resources/countries, and queue length when applicable. * Equivalent-instance performance measurements using the same image/version, hardware class, CPU/RAM/storage, countries, priority, application settings, input, and observation method. ## Preflight checks 1. Preserve current evidence before changing anything. 2. Confirm the incident window is within available log retention and all timestamps are UTC. 3. Confirm the expected behavior is compatible with the configured image, command, resources, probes, networking, and queue connection. 4. Identify whether the impact is group-wide, version-wide, hardware-class-wide, or isolated to one instance. 5. Define a falsifiable success condition and obtain authorization before a corrective mutation. ## Procedure Follow this evidence order without skipping directly to reallocation: 1. **Read Container Group configuration and status.** Operation: `get_container_group`. Record version, `pending_change`, desired replicas, `current_state`, image, command, environment-variable names only, resources, priority, countries, probes, networking, queue connection, and autoscaler. 2. **Read instance state.** Operation: `list_container_group_instances`; use `get_container_group_instance` for an exact live ID. Separate `allocating`, `downloading`, `creating`, `running`, and `stopping`; record `started`, `ready`, and version. 3. **Read system events.** Prefer Operation: `query_log_entries` for `deployment_controller` and `instance_controller`. `get_system_logs` exists but its canonical page marks it deprecated. 4. **Read application logs.** Query `resource.type = "container"` with project/group labels and, when known, the instance ID. Capture only relevant redacted excerpts. 5. **Check current constraints.** Re-run quota, GPU class, GPU/CPU availability, countries, priority, CPU, RAM, storage, and replica preflight for the exact current configuration. 6. **Check image-pull conditions.** Confirm image spelling/tag/digest, AMD64 Docker/OCI compatibility, documented image size limit, registry reachability/rate limits, and valid private-registry permissions. Never print credentials. 7. **Check startup and probes.** Confirm the image has a long-running process; command paths exist; GPU runtime/vendor matches selected GPU classes; probe handler/port/path and all thresholds match actual startup/readiness/liveness behavior. If events and logs don't explain a start failure or early exit, debug startup by hand with explicit intent: set `command` to `["sleep", "2147483647"]`, remove the startup and liveness probes, connect over SSH, and run the entrypoint ([steps](/container-engine/how-to-guides/cold-starts-and-iterating-quickly#debug-startup-by-hand)). Restore both afterward. 8. **Check networking and queue/gateway configuration.** Confirm the application binds the configured port and supports the documented gateway IPv6 requirements; require at least one running, ready instance. For queues, confirm worker, local path/port, readiness, queue name, and group association. 9. **Classify the failure** as application-level, configuration-level, allocation-level, or potentially node-level using the table below. 10. **Reallocate only with evidence and intent.** Preserve logs/events first. Use the management operation for a known instance ID. From inside the affected instance, read IMDS with `get_status` before using IMDS `reallocate`. Verify replacement allocation and readiness; do not repeat blindly. 11. **Collect the escalation package** if the issue cannot be resolved within the authorized action and polling budget. ## Decision rules | Evidence | Classification | Next action | | - | - | - | | Group `pending`/`failed` with registry or preparation event | Image/registry configuration | Correct image or credentials with an authorized update; verify the group. | | Instances remain `allocating`, with insufficient live quota/availability or restrictive countries/resources | Allocation constraint | Report exact shortfall; change constraints only with user approval. | | Instances loop through `downloading`/`allocating` with exit events | Usually application/start failure after pull | Inspect exit/start events and container logs; validate command/image/runtime. | | One instance remains downloading while peers with the same version progress | Potential node/network issue | Compare timestamps/progress; bounded wait, then evidence-backed reallocation if authorized. | | `running`, `started: false` or startup probe failures | Startup/application/probe configuration | Validate initialization time and startup handler; do not use reallocation for a consistently bad probe. | | `running`, `started: true`, `ready: false` | Readiness/application dependency | Validate readiness endpoint and application logs; traffic/work should remain withheld. | | Running/ready but gateway errors | Networking/application | Check port, IPv6 binding, auth, timeouts, and application response. | | Exit `0` and group restarts unexpectedly | Application lifecycle | Add/restore an intended long-running process; reallocation will not fix it. | | Exit `137` | Possible OOM or explicit termination | Correlate events and memory before changing RAM; do not assume OOM from code alone. | | Same error on equivalent instances | Application/configuration/hardware-class compatibility | Fix the shared cause; do not churn nodes. | | Only one instance persistently fails a measured real workload requirement while equivalent peers succeed | Potentially node-level | Reallocate once if explicitly authorized; compare the replacement. | ### Reallocation boundary Reallocation is appropriate only for a current, isolated instance when evidence shows a node-specific condition, such as persistent creating/download behavior or measured failure against a real workload requirement while equivalent peers succeed. Capture evidence and obtain explicit intent first. Reallocation is **not** appropriate for insufficient quota/availability, a bad image or command, missing registry credentials, invalid environment/probe/network/queue configuration, application errors reproduced across nodes, or uncontrolled performance variation. Compare equivalent hardware and workload settings before considering a performance issue node-level. ## Expected states and responses Troubleshooting reads normally return `200`; the current one-instance get operation specifies `202` with an instance body. Management reallocation returns `202`; IMDS reallocation returns `204`. Neither response alone proves a healthy replacement. After reallocation, the old instance may disappear and a replacement should progress through actual instance states toward `running`, with `started`/`ready` satisfying the workload predicate. Job statuses, when relevant, are `pending`, `running`, `succeeded`, `cancelled`, and `failed`. Do not conflate job failure with an instance-state enum. ## Retry behavior Retry evidence reads for transient failures within a bounded budget and honor `Retry-After` when present. Do not retry an invalid query unchanged. Re-read the instance list before retrying a lifecycle action; the original ID may no longer exist. Never loop through reallocations. One unresolved reallocation followed by the same evidence is an escalation, not permission to churn more nodes. ## Verification For configuration recovery, read before the patch, perform the authorized mutation, then read the group and instances; success means the corrected fields and required current-version ready capacity are present. For reallocation, read the instance before, call `reallocate_container_group_instance` or IMDS `reallocate`, then list instances; success means the old assignment is no longer active and replacement capacity reaches the defined ready/running predicate. Pending past the budget is unresolved, not success. ## Rollback or recovery * Restore captured fields with a minimal merge patch if an authorized configuration change worsens the incident. * Do not reverse a reallocation: the former node is not a durable recovery target. * Recover application/job state from external storage or a durable queue. Instance-local state is ephemeral. * Preserve the failed resource and evidence unless the user explicitly authorizes cleanup. ## Stop and escalation conditions Stop when scope, incident window, evidence, credentials, required configuration, or mutation intent is missing; when logs could expose secrets and cannot be safely redacted; when no supported API can perform the requested change; or when bounded diagnosis/recovery fails. Escalate rather than changing multiple variables at once or repeatedly reallocating. An escalation package must include, when available: * Organization and project names. * Container Group name and ID; group version and current status. * Instance ID and machine ID for affected instances. * Relevant UTC timestamps and incident duration. * Desired replicas and counts by actual instance state/readiness. * Redacted system events and relevant application log excerpts. * Request, trace, span, or job identifiers when returned by the API/application. * Exact reproduction steps, expected versus observed result, and frequency. * Recent configuration changes and a redacted current configuration summary. * Live quota, availability, priority, country, and hardware constraints. * For performance issues, comparable measurements from equivalent instances and workload settings. Send the package through [SaladCloud support](/support/contact); never include API keys or registry/environment secrets. ## Evidence to return to the user Return the escalation-package fields gathered, the evidence sequence completed, classification and confidence, ruled-out causes, any authorized mutation and its before/after reads, polling budget/result, redactions performed, and the next safe action. Clearly distinguish resolved, partially resolved, pending, and escalated outcomes. # Agent Operations Overview Source: https://docs.salad.com/agents/overview Source precedence, authorization boundaries, and evidence requirements for autonomous SaladCloud operations. *Last Updated: October 19, 2026* > [!NOTE] > > Setting up an agent rather than being one? Start with [Build with AI Agents](/general/tutorials/build-with-ai-agents): > installing the SaladCloud skills, the documentation MCP server, and API key guidance. This section is an execution layer for AI agents operating Salad Container Engine, AI Gateway, Salad Transcription API, and Transcription Lite. It adds workflow and safety rules to canonical product documentation; where a product has an OpenAPI specification, these runbooks do not replace it. ## When to use this runbook Use this page before any autonomous Container Engine, AI Gateway, or Transcription task and whenever sources disagree, identifiers are missing, or an action could stop/cancel work, reduce capacity, replace an instance, or repeat potentially billable or non-idempotent work. ## When not to use it Do not use these runbooks for Gateway Service, S4, general account administration, or as a substitute for live account data. AI Gateway account, organization, credit, and key creation remain user-facing Portal tasks. ## Required inputs * `SALAD_API_KEY` for the public SaladCloud API, supplied through a secret environment variable and sent only in the `Salad-Api-Key` header. * `SALAD_AI_GATEWAY_API_KEY` for AI Gateway, supplied through a secret environment variable and sent only as a Bearer token. This key belongs to one user and organization; never substitute the regular SaladCloud API key. * `SALAD_ORGANIZATION` for organization-scoped public API operations, obtained from the user, trusted configuration, or the Portal. An AI Gateway key already carries its organization scope; confirm the intended organization from trusted context when it affects billing. * For Container Engine only, `SALAD_PROJECT`. Transcription endpoints and AI Gateway do not use a project. * The intended outcome, target resource or model, authorized request content, and authorization boundary. * Explicit user intent before stopping or deleting a workload, scaling down, replacing or reallocating an instance, or cancelling/resubmitting a transcription job or repeating an uncertain AI Gateway completion. The relevant OpenAPI specifications address organizations, and Container Engine projects, by **name**. They do not define an operation to list organizations accessible to an API key. Never guess or enumerate names. ## Authoritative sources Use this precedence order: 1. A live API response for current account, availability, quota, or resource state. 2. The current [`salad-cloud.yaml`](https://github.com/SaladTechnologies/salad-cloud-docs/blob/main/api-specs/salad-cloud.yaml), [`salad-cloud-imds.yaml`](https://github.com/SaladTechnologies/salad-cloud-docs/blob/main/api-specs/salad-cloud-imds.yaml), [`transcribe.json`](https://github.com/SaladTechnologies/salad-cloud-docs/blob/main/api-specs/transcribe.json), or [`transcription-lite.json`](https://github.com/SaladTechnologies/salad-cloud-docs/blob/main/api-specs/transcription-lite.json) for API paths, operation IDs, schemas, required fields, and enums. 3. The applicable agent runbook for procedure, safety boundaries, and decision rules. 4. Canonical explanatory documentation, such as the [Container Engine overview](/container-engine/explanation/core-concepts/overview), for product behavior and context. 5. Examples only as illustrations. Never treat example identifiers, prices, counts, or states as current facts. Authentication behavior is documented in [Using the API](/reference/api-usage). Canonical operation pages are under the [Container Engine API reference](/container-engine/reference/api). The repository does not currently contain an AI Gateway OpenAPI specification. For AI Gateway, use the [request runbook](/agents/ai-gateway/select-model-and-send-request), the documented OpenAI-compatible request shape, and live `/v1/models` results. Do not transfer undocumented fields, idempotency guarantees, or retry behavior from another provider. ## Dynamic values to retrieve Retrieve immediately before a decision: * The current Container Group, queue, inference endpoint, or transcription job representation. * Current instances and their `state`, `ready`, `started`, and version values. * Current quotas, GPU classes, CPU/GPU availability, country constraints, and priority-specific capacity estimates. * Current queue length, job status, system events, and application logs for the relevant UTC window. * Current transcription job status, events, timestamps, and output for the exact selected product path and returned ID. * Current AI Gateway model IDs, documented rates, response and rate-limit metadata, and usage fields returned for the exact request. Do not cache these values as permanent facts. Prices and example hardware identifiers are also not account state. ## Preflight checks 1. Confirm no credential value will be printed, logged, committed, or included in returned evidence. 2. Confirm the user supplied or approved the organization and any project name required by the selected API. 3. Validate the supplied scope with the applicable product read: Container Engine quota/project reads or the exact Transcription endpoint read. AI Gateway `GET /v1/models` answers without authentication, so it confirms reachability and the live model list but not the key; only a completion verifies an AI Gateway key. 4. For a resource mutation, read the target and compare its current state with the requested outcome. 5. Run [Container Engine preflight](/agents/container-engine/discover-scope-and-preflight), [AI Gateway request preflight](/agents/ai-gateway/select-model-and-send-request), or [Transcription preflight](/agents/transcription/choose-api-and-preflight). 6. Establish a polling or attempt limit and a stop condition before sending a write or billable request. ## Procedure 1. Select the narrowest task-specific runbook and its corresponding skill. 2. Resolve names from trusted input; resolve generated IDs only from live responses or trusted application records. 3. Retrieve all dynamic values required for the decision. 4. Present or record the planned mutation or billable request and any interruption, capacity, privacy, or cost impact. 5. Obtain explicit intent when the action is destructive, capacity-reducing, instance-replacing, or repeats uncertain billable work. 6. Perform one mutation or completion, then verify it with the method defined by the selected runbook. 7. Return the requested outcome, verification evidence, and any unresolved state without secrets. ## Decision rules | Situation | Action | | - | - | | Required name is absent | Stop; request it instead of guessing. | | Read and requested state already match | Report no change; do not repeat the mutation. | | Target name matches one existing resource | Update that resource only after a fresh read. | | Multiple candidates or ambiguous intent | Stop and ask the user to identify the target. | | Mutation reduces capacity, interrupts, or cancels work | Require explicit user intent. | | Transcription operation ID is shared between specs | Bind it to the selected product and exact path before use. | | Job-create result is uncertain and no ID was returned | Stop; do not resubmit without documented idempotency. | | AI Gateway completion or stream outcome is uncertain | Stop; require explicit approval before repeating billable work. | | Requested model is absent from live `/v1/models` | Stop and ask the user to select an available alternative. | | Documentation conflicts with request/response shape | Use OpenAPI for shape and report the discrepancy. | | Live response conflicts with an example | Use the live response and identify the example as non-authoritative. | ## Expected states and responses Successful create operations return a resource or job, while start, stop, delete/cancel, and instance lifecycle operations may return `202 Accepted` and continue asynchronously. A `2xx` response confirms acceptance or immediate response handling; it is not proof that a runtime state or transcription terminal state has been reached. AI Gateway returns an immediate completion response or stream. It does not provide a documented reconciliation read for a completion whose outcome is uncertain, so do not infer that an interrupted request failed or was not billed. ## Retry behavior Follow [Safety, Retries, and Freshness](/agents/reference/safety-retries-and-freshness). Retry reads and other safe or idempotent requests only within a caller-defined attempt and elapsed-time budget. Honor `Retry-After` when present. Do not blindly retry authentication, authorization, validation, conflict, or invalid-configuration failures. Do not automatically retry an AI Gateway completion after a timeout, `5xx`, interrupted response, or partial stream. ## Verification Every mutation requires a verification read from the same trusted organization and, when applicable, project. Success means the live resource reflects the requested configuration/terminal state, or the exact transcription job reaches the expected terminal state and output. Report partial or pending results rather than inferring completion. For AI Gateway, verify the model against a fresh `/v1/models` response before the request, then verify the exact response or stream received; there is no documented completion-status read. ## Rollback or recovery Capture a redacted pre-change representation before updating. Prefer a corrective merge patch that restores only the changed fields. Never delete, cancel, replace, or resubmit as an implicit rollback. Transcription jobs cannot be updated; a replacement is a new submission requiring intent. If a prior value is unavailable or redacted, stop. AI Gateway generations and consumed tokens cannot be rolled back; a corrective prompt is a new billable request. ## Stop and escalation conditions Stop when credentials, scope, required fields, destructive authorization, current state, or a reliable prior value are missing. Stop after the polling budget expires, on repeated non-transient errors, or when the evidence indicates a product-side issue. Use the [troubleshooting runbook](/agents/container-engine/troubleshoot-container-group) to build a support package. For AI Gateway, use [Troubleshoot an AI Gateway Request](/agents/ai-gateway/troubleshoot-request) before contacting [SaladCloud support](/support/contact). ## Evidence to return to the user Return: * Organization and relevant project/resource names; instance or job IDs only when retrieved from trusted evidence. * Operation IDs or exact endpoint methods/paths and HTTP response classes used, with no credential-bearing headers. * A concise pre-change summary, the intended change, and the verification read result. * Current resource/job status, relevant instance counts or job events/output fields, version, and UTC timestamps. * For AI Gateway, the selected model, streaming mode, response class, safe usage metadata, and UTC timestamp without prompt or generated content unless the user explicitly requests it. * Partial, pending, failed, or skipped checks and the exact stop reason. * Recovery performed or the next safe action requiring user approval. # Safety, Retries, and Freshness Source: https://docs.salad.com/agents/reference/safety-retries-and-freshness Global safety, retry, verification, freshness, and stop rules for autonomous SaladCloud operations. *Last Updated: September 1, 2026* ## When to use this runbook Apply these rules to every autonomous Salad Container Engine, AI Gateway, and Transcription read, create, update, start, stop, scale, queue, job, instance, log, model-selection, completion, or IMDS workflow. ## When not to use it Do not use these generic rules to infer an endpoint-specific request body or success state. Use the current OpenAPI operation where provided and the applicable task runbook for those details. ## Required inputs * A caller-provided time budget and operational objective. * `SALAD_API_KEY` for the public SaladCloud API; never print or persist its value. * `SALAD_AI_GATEWAY_API_KEY` for AI Gateway Bearer authentication; never print, persist, or substitute the regular API key. * Trusted resource scope and explicit user intent for destructive or capacity-reducing actions. * A safe location for redacted pre-change or job evidence when recovery may be required. ## Authoritative sources * [Using the API](/reference/api-usage) * [Agent Operations Overview](/agents/overview) * [Select a Model and Send an AI Gateway Request](/agents/ai-gateway/select-model-and-send-request) * The current public API and IMDS OpenAPI specifications linked from the [Container Engine API reference](/container-engine/reference/api) ## Dynamic values to retrieve Treat resource state, versions, instances, logs, events, queues, transcription jobs, endpoint metadata, AI Gateway model IDs, quotas, GPU classes, availability, prices, and capacity as dynamic. Retrieve them for the target scope immediately before they affect a decision and again after every mutation. ## Preflight checks 1. Verify the target names or model selection and the authorization boundary. 2. Classify the operation as a read, idempotent write, non-idempotent create, destructive action, or asynchronous lifecycle or billable model request. 3. Before a resource change, read the resource and save a redacted record of fields that may change. 4. Define the success condition, verification method, maximum attempts, elapsed-time budget, and stop condition. 5. For Container Engine, check that local instance/job state is externalized before replacement. For Transcription, protect signed media URLs, metadata, webhooks, and output as sensitive data. 6. For AI Gateway, protect prompts, conversation history, images, tool definitions and results, and model output. Treat a completion as billable and non-idempotent when the documentation does not guarantee otherwise. ## Procedure 1. Retrieve the applicable live resource, job, or model state and compare it with the requested outcome. 2. Skip a write when the desired outcome is already true. 3. Use the narrowest valid mutation or documented model request. For merge patches, send only intended changes while preserving current nested values that must remain. 4. Record the response status and identifiers without credential-bearing headers or secret fields. 5. Perform the specified verification. Use a fresh read and bounded polling for asynchronous operations; for AI Gateway, confirm the live model before the request and retain the exact response or stream afterward. 6. Return the verified result or stop with the last observed state. ## Decision rules | Response or operation | Agent behavior | | - | - | | `GET` or other read | Retry only plausible transient failures within the bounded budget. | | `PATCH` with a known desired state | Re-read first; retry only after proving the first request did not apply. | | `POST` named-resource create | List by exact scope/name before retrying; never create again while outcome is uncertain. | | `POST` server-ID job create | Persist the returned ID; without an ID or documented idempotency, stop rather than resubmit. | | AI Gateway chat completion or stream | Do not repeat it when delivery, completion, or billing outcome is uncertain. | | `POST` start/stop or instance lifecycle | Re-read current state before any retry; acceptance may be asynchronous. | | `DELETE`, cancel, stop, scale-down, reallocate, or replace | Require explicit user intent; never infer authorization. | | `400` or schema/configuration error | Correct the request or stop; do not retry unchanged. | | `401` or `403` | Stop and request valid authorization; do not retry blindly. | | `404` | Recheck trusted scope once; do not enumerate or guess names. | | `429` | Honor `Retry-After` when supplied, then use bounded backoff. | | `5xx` or transport failure | Retry only safe/idempotent work; reconcile uncertain writes with a read first. | ## Expected states and responses Creation may return `201`; lifecycle and deletion requests may return `202`; merge-patch updates may return `200`. These status codes come from the current operation definitions. Runtime convergence must still be established through resource and instance reads. Container Group status values are `pending`, `running`, `stopped`, `succeeded`, `failed`, and `deploying`. Instance state values are `allocating`, `downloading`, `creating`, `running`, and `stopping`. Transcription job states are `pending`, `running`, `succeeded`, `cancelled`, and `failed`. Do not mix state enums across resource types. AI Gateway returns an immediate completion response or stream rather than a durable job state. A partial stream or transport failure is not proof that the request failed or was not billed. ## Retry behavior Use bounded exponential backoff with jitter as agent behavior, not as a SaladCloud API guarantee. The caller or task must set a maximum attempt count and elapsed-time budget. Respect a server-provided `Retry-After` value. Do not prescribe undocumented exact delays, and do not reset the overall budget after each response. Never blindly retry: * Authentication or authorization failures. * Schema validation, invalid enum, invalid configuration, or missing-field errors. * A create request whose outcome is unknown, especially a job create with no returned server ID. * An AI Gateway completion after a timeout, `5xx`, interrupted response, or partial stream. * A destructive action, cancellation, or capacity reduction. * Reallocation as a generic response to application or configuration failures. ## Verification Verification is a fresh read, not the mutation response. Compare observed configuration, version, state, counts, job events/output, and relevant instance fields with an explicit success predicate. For named creates, list/get the exact name. For queue or transcription jobs, read the returned job ID. Retain the last response and UTC observation time. For AI Gateway, verify the selected model with a fresh `/v1/models` response before sending one completion, then retain the exact response or stream result. No documented completion-status read exists for reconciliation. ## Rollback or recovery * Restore only fields changed by the failed update, using the saved pre-change values and a fresh read. * If a create succeeded but later deployment failed, keep the resource for diagnosis unless the user explicitly asks for deletion. * If a write outcome is unknown, reconcile with a read before sending another write. * If an instance is replaced, recover from external storage or a durable queue; local instance state is ephemeral. * A transcription job cannot be updated. Cancellation or replacement requires explicit intent; retrieve a succeeded job by ID instead of repeating work after a webhook failure. * AI Gateway token usage and generated output cannot be rolled back. A corrective request is new billable work. ## Stop and escalation conditions Stop when required scope, credentials, intent, current state, or rollback values are missing; when a non-transient error persists; when resources remain pending past the caller's polling budget; or when evidence suggests a service-side fault. Do not turn an unresolved operation into success. Escalate with the package defined in [Troubleshoot a Container Group](/agents/container-engine/troubleshoot-container-group) or [Troubleshoot an AI Gateway Request](/agents/ai-gateway/troubleshoot-request). ## Evidence to return to the user Return the target scope/product/path, operation IDs, redacted request field names, response classes, verification reads, UTC timestamps, attempt count, elapsed polling time, last observed state, success predicate, and recovery/escalation. Never return API keys, registry credentials, environment-variable secret values, signed media URLs, webhook secrets, prompts, conversations, images, tool definitions or results, model/transcript/media content without authorization, or full credential-bearing requests. # Submit and Monitor a Transcription Lite Job Source: https://docs.salad.com/agents/transcription-lite/submit-and-monitor-job Submit, poll, verify, and optionally cancel one Salad Transcription Lite job without using primary-only fields or creating duplicates. *Last Updated: August 24, 2026* ## When to use this runbook Use after preflight selects `transcription-lite` and every requested feature exists in the current Lite input schema. ## When not to use it Do not use Lite for primary-only LLM, insight, custom-vocabulary, classification, or translated-SRT fields. Do not resubmit an uncertain/failed job automatically or cancel without explicit user intent. ## Required inputs * `SALAD_API_KEY` and `SALAD_ORGANIZATION`. * For a new submission, a trusted downloadable `SALAD_MEDIA_URL` and exact approved Lite fields: required `url` and optional `language_code`, `return_as_file`, timestamp, diarization, `srt`, or `translate` settings. * Optional non-secret caller metadata and webhook URI. * A caller-defined polling attempt and elapsed-time budget. * For an existing job, `SALAD_TRANSCRIPTION_LITE_JOB_ID`, obtained only from a successful create response, `Location`, or trusted record. Treat media URIs, job input/output, metadata, and webhook URIs as potentially sensitive. ## Authoritative sources | Action | Operation, exact path, and canonical reference | | - | - | | Read endpoint | Operation: `get_inference_endpoint`; `GET /organizations/{organization_name}/inference-endpoints/transcription-lite` — [Transcription API reference](/transcription/reference/api) | | List jobs | Operation: `get_inference_endpoint_jobs`; `GET /organizations/{organization_name}/inference-endpoints/transcription-lite/jobs` — [Transcription API reference](/transcription/reference/api) | | Create job | Operation: `create_inference_endpoint_job`; `POST /organizations/{organization_name}/inference-endpoints/transcription-lite/jobs` — [Create Lite job](/reference/transcription-lite/inference_endpoints/create-an-inference-endpoint-job) | | Read job | Operation: `get_inference_endpoint_job`; `GET /organizations/{organization_name}/inference-endpoints/transcription-lite/jobs/{job_id}` — [Get Lite job](/reference/transcription-lite/inference_endpoints/get-an-inference-endpoint-job) | | Cancel job | Operation: `delete_inference_endpoint_job`; `DELETE /organizations/{organization_name}/inference-endpoints/transcription-lite/jobs/{job_id}` — [Delete Lite job](/reference/transcription-lite/inference_endpoints/delete-an-inference-endpoint-job) | Use `api-specs/transcription-lite.json`; the same operation IDs also occur in other specifications. ## Dynamic values to retrieve * Current Lite endpoint metadata and price description. * The create response ID, `Location`, status, events, and timestamps. * Current job status/events/output during verification. * Current source-URI accessibility and rate-limit response. ## Preflight checks 1. Complete [Choose a Transcription API and Preflight](/agents/transcription/choose-api-and-preflight). 2. Confirm the path contains `/transcription-lite/` and the endpoint read succeeds. 3. Validate against `CreateSaladCloudTranscriptionLiteAPIJob`; `input.url` is required. 4. Reject primary-only and undocumented fields, including `audio_stream_index`, `multichannel`, `enhanced_accuracy`, `summarize`, LLM/classification fields, custom vocabulary, and `srt_translation`. 5. The Lite `language_code` schema has no enum. Require a caller-approved value and do not claim arbitrary strings are supported. 6. If a trusted application record already has a job ID, read it instead of creating another. 7. Define terminal and polling predicates before submission. ## Procedure Read the Lite endpoint immediately before submitting this schema-derived request: ```bash theme={null} curl --fail-with-body --silent --show-error \ --request POST \ --url "https://api.salad.com/api/public/organizations/${SALAD_ORGANIZATION}/inference-endpoints/transcription-lite/jobs" \ --header "Salad-Api-Key: ${SALAD_API_KEY}" \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --data '{ "input": { "url": "", "language_code": "en", "return_as_file": false, "sentence_level_timestamps": true, "word_level_timestamps": false, "diarization": false, "sentence_diarization": false, "srt": false }, "metadata": { "client_request_id": "" } }' ``` Replace placeholders without logging signed query parameters. Correlation metadata is not an idempotency guarantee. Persist the ID and `Location` from the `201` response. Poll the exact Lite job: ```bash theme={null} curl --fail-with-body --silent --show-error \ --url "https://api.salad.com/api/public/organizations/${SALAD_ORGANIZATION}/inference-endpoints/transcription-lite/jobs/${SALAD_TRANSCRIPTION_LITE_JOB_ID}" \ --header "Salad-Api-Key: ${SALAD_API_KEY}" \ --header 'Accept: application/json' ``` On `succeeded`, verify required `text`, `duration`, and `processing_time`, plus any requested timestamps or SRT fields. The schema does not define the alternative file-URL shape described by canonical `return_as_file` guidance; use and redact the live response without inventing property names. For cancellation, read immediately before `delete_inference_endpoint_job`, require explicit intent, then verify with the exact get operation within the polling budget. ## Decision rules | Evidence or intent | Action | | - | - | | Requested field is absent from the Lite schema | Stop or switch to primary only with user approval. | | Trusted record contains a Lite job ID | Read it; do not submit again. | | Create returns `201` and an ID | Persist and verify that exact ID. | | Create result is unknown and no ID was returned | Stop; list/metadata cannot prove identity or idempotency. | | `pending` or `running` | Continue bounded polling. | | `succeeded` with requested output | Return verified success. | | `failed`, unexpected `cancelled`, or missing output | Troubleshoot; a replacement submission requires new intent. | | User requests an update to an existing job | Stop: no update operation exists. | ## Expected states and responses Create returns `201`, reads return `200`, and cancellation returns `202`. States are `pending`, `running`, `succeeded`, `cancelled`, and `failed`; events use `created`, `started`, `succeeded`, `cancelled`, and `failed`. ## Retry behavior Retry only reads for plausible transient transport, `429`, or server failures within a fixed budget, honoring `Retry-After` when present. Never retry an uncertain create without an ID, automatically resubmit a failed job, or retry cancellation without a fresh read and the original intent. ## Verification | Mutation | Read before | Read after | Success | Failure or unresolved | | - | - | - | - | - | | `create_inference_endpoint_job` | Endpoint and trusted job-ID lookup | `get_inference_endpoint_job` | Returned ID reaches `succeeded` with required Lite output | Unknown create, terminal failure, missing output, or timeout | | `delete_inference_endpoint_job` | `get_inference_endpoint_job` | Same operation | State becomes `cancelled` | Active past budget; post-acceptance `404` remains unresolved | ## Rollback or recovery Lite jobs cannot be edited. Do not use cancellation as automatic rollback. Preserve failed job evidence and submit a replacement only after correcting the cause and obtaining explicit new-job intent. ## Stop and escalation conditions Stop on an unsupported Lite field, missing scope/source, invalid request, uncertain create, terminal failure, missing output, or exhausted polling. Escalate persistent service behavior with product/path, organization, job ID, UTC event times, redacted field names, response problem instance, and expected versus observed result. ## Evidence to return to the user Return the Lite path, organization, job ID, response classes, requested field names, redacted source origin, status/events/timestamps, polling attempts/elapsed time, verified output property names, cancellation state, and any unresolved result. Never expose API keys, complete signed/webhook URIs, media, transcript text, or sensitive metadata unless explicitly requested through an authorized channel. # Choose a Transcription API and Preflight Source: https://docs.salad.com/agents/transcription/choose-api-and-preflight Select Salad Transcription API or Transcription Lite from required features, then validate scope, media access, and the exact request schema before submitting a job. *Last Updated: August 24, 2026* ## When to use this runbook Use before every Transcription or Transcription Lite job submission, especially when the requested features do not make the product choice obvious. ## When not to use it Do not use this runbook to submit, cancel, or retry a job. Do not use static pricing, processing-time examples, or example media URLs as current account facts. ## Required inputs * `SALAD_API_KEY` as a secret environment variable and a caller-supplied `SALAD_ORGANIZATION` name. * The intended product: `transcribe` or `transcription-lite`, or enough feature requirements to choose one. * A downloadable media URI supplied by the user or a trusted application. Treat signed query parameters as secrets. * Required language behavior and output features, including audio-stream selection, timestamps, multichannel preservation, diarization, SRT, translation, enhanced accuracy, or primary-only LLM features. * Whether a webhook, caller metadata, or file-return behavior is required. These endpoints are organization-scoped; they do not use a SaladCloud project name. ## Authoritative sources | Product | Endpoint read and specification | | - | - | | Transcription API | Operation: `get_inference_endpoint`; `GET /organizations/{organization_name}/inference-endpoints/transcribe` — [API reference](/transcription/reference/api) | | Transcription Lite | Operation: `get_inference_endpoint`; `GET /organizations/{organization_name}/inference-endpoints/transcription-lite` — [API reference](/transcription/reference/api) | | Primary create schema | `CreateSaladCloudTranscriptionAPIJob` in [`transcribe.json`](https://github.com/SaladTechnologies/salad-cloud-docs/blob/main/api-specs/transcribe.json) | | Lite create schema | `CreateSaladCloudTranscriptionLiteAPIJob` in [`transcription-lite.json`](https://github.com/SaladTechnologies/salad-cloud-docs/blob/main/api-specs/transcription-lite.json) | | Product feature context | [Transcription APIs overview](/transcription/explanation/overview) and [Speech-to-text options](/transcription/how-to-guides/speech-to-text) | The two specifications reuse the same operation IDs. Always pair an operation ID with the selected product and exact path; the operation ID alone does not identify the API. ## Dynamic values to retrieve * The live inference-endpoint representation, including its `name`, `endpoint_url`, `readme`, and `price_description`. * Current API response and rate-limit state for the supplied organization. * Current reachability and any known expiry of the exact media URI. The specifications define no minimum URL lifetime, so do not claim that a particular expiry is sufficient. * Current job state, events, and output after submission. Do not cache endpoint pricing or processing-time estimates as permanent facts. ## Preflight checks 1. Require `SALAD_API_KEY` and a trusted organization name; neither Transcription specification lists accessible organizations. 2. Select one exact endpoint. Call its `get_inference_endpoint` path to validate both organization access and product. 3. Confirm the media URI is externally downloadable. Do not print or return signed query parameters, embedded credentials, or private storage headers. 4. Validate the request only against the selected specification. Both products require `input.url`; top-level `metadata` and `webhook` are optional, and metadata permits at most 20 properties. 5. For the primary API, use only fields in `SaladCloudTranscriptionAPIInput`. Only `url` is required; omitting nullable `language_code` uses automatic detection. 6. For Lite, use only fields in `SaladCloudTranscriptionLiteAPIInput`. Its current `language_code` is a string without an enum; that does not prove every value is supported. 7. `audio_stream_index`, `multichannel`, and `enhanced_accuracy` are primary-only. Reject them on the Lite path. 8. Do not assume a webhook is authenticated, retried, or delivered with a particular payload; those behaviors are not defined by these OpenAPI specifications. ## Procedure 1. Translate the requested outcome into explicit input and output fields. 2. Choose the primary API when the request requires `audio_stream_index`, `multichannel`, `enhanced_accuracy`, `summarize`, `custom_prompt`, `llm_translation`, `srt_translation`, `custom_vocabulary`, `classification_labels`, `overall_classification`, or `overall_sentiment_analysis`; these fields are absent from Lite. 3. Choose Lite only when every requested field is present in the Lite input schema. 4. Read the selected endpoint with `get_inference_endpoint` using `Salad-Api-Key`; record the product name and current endpoint metadata without exposing the key. 5. Validate the media URI and the complete proposed JSON body. Omit optional fields rather than supplying empty or guessed values. 6. Return a preflight decision before invoking the product-specific submission runbook. ## Decision rules | Requirement or evidence | Decision | | - | - | | Only transcription, timestamps, diarization, SRT, or translation-to-English is requested | Either schema may support the fields; choose the product explicitly rather than inferring from price or speed examples. | | Multichannel, stream selection, enhanced accuracy, LLM, insight, classification, or translated SRT is required | Use the primary Transcription API. | | A requested field is absent from the selected schema | Stop or choose the other product with user approval; never send the undocumented field. | | Organization or product endpoint read returns `404` | Reconfirm the trusted organization and exact path; do not guess variants. | | Media URI is inaccessible, expired, or requires undisclosed headers | Stop and request a usable downloadable URI. | | Primary language is omitted and automatic detection is acceptable | Omit `language_code` or use `null`; do not insert an English default. | | Exact language or translation value is uncertain | Use automatic detection only with caller intent, otherwise stop for an approved value. | | Current endpoint price differs from an example | Use the live endpoint response and report the example as non-authoritative. | Only `to_eng` has defined primary `translate` behavior. Do not normalize another value or represent `to_eng` as an enum-enforced constraint. ## Expected states and responses A successful endpoint read returns `200`. Job states, once a job exists, are `pending`, `running`, `succeeded`, `cancelled`, and `failed`; event actions are `created`, `started`, `succeeded`, `cancelled`, and `failed`. The endpoint response describes the current service but does not reserve capacity or guarantee a completion time. ## Retry behavior Retry endpoint and other read-only preflight requests only for plausible transient transport, `429`, or server failures within a caller-defined attempt and elapsed-time budget. Honor `Retry-After` when present. Do not retry an unchanged invalid schema, inaccessible source URI, or authentication/authorization failure. ## Verification Preflight succeeds only when the exact product endpoint is readable in the trusted organization, every intended request field exists in that product's current input schema, required feature behavior is unambiguous, and the source is safe to submit for asynchronous download. ## Rollback or recovery This runbook performs no SaladCloud mutation. If product choice, media URI, requested output, or endpoint metadata changes, discard the prior decision and repeat preflight. ## Stop and escalation conditions Stop for missing credentials or organization, ambiguous product choice, an unsupported field, an unapproved language or translation value, inaccessible/expiring media, secret-bearing evidence that cannot be redacted, or repeated endpoint failure. Escalate persistent endpoint access or schema/product mismatch with the exact path, UTC time, redacted request field names, and returned problem details. ## Evidence to return to the user Return the validated organization, selected product and exact path, endpoint name, current price description when requested, redacted media origin and accessibility result, proposed input field names, unsupported/omitted fields, UTC observation time, and a clear proceed/stop decision. Never return the API key, a complete signed URI, media contents, webhook secrets, or sensitive metadata values. # Submit and Monitor a Transcription Job Source: https://docs.salad.com/agents/transcription/submit-and-monitor-job Submit, poll, verify, and optionally cancel one primary Salad Transcription API job without duplicate submission. *Last Updated: August 24, 2026* ## When to use this runbook Use after preflight selects the primary `transcribe` endpoint and the user intends to submit or inspect a primary Salad Transcription API job. ## When not to use it Do not use it for `transcription-lite`, to resubmit an uncertain or failed job automatically, or to cancel a job without explicit user intent. ## Required inputs * `SALAD_API_KEY` and `SALAD_ORGANIZATION`. * For a new submission, a downloadable `SALAD_MEDIA_URL` from trusted configuration and the exact approved `SaladCloudTranscriptionAPIInput` fields. * An optional non-secret caller correlation value, webhook URI, and metadata object of at most 20 properties. * A caller-defined polling attempt and elapsed-time budget. * For an existing job, `SALAD_TRANSCRIPTION_JOB_ID`, taken only from a successful create response, `Location` header, or trusted prior record. Treat the media URI, job input/output, metadata, and webhook URI as potentially sensitive. ## Authoritative sources | Action | Operation, exact path, and canonical reference | | - | - | | Read endpoint | Operation: `get_inference_endpoint`; `GET /organizations/{organization_name}/inference-endpoints/transcribe` — [Transcription API reference](/transcription/reference/api) | | List jobs | Operation: `get_inference_endpoint_jobs`; `GET /organizations/{organization_name}/inference-endpoints/transcribe/jobs` — [Transcription API reference](/transcription/reference/api) | | Create job | Operation: `create_inference_endpoint_job`; `POST /organizations/{organization_name}/inference-endpoints/transcribe/jobs` — [Create job](/reference/transcribe/inference_endpoints/create-an-inference-endpoint-job) | | Read job | Operation: `get_inference_endpoint_job`; `GET /organizations/{organization_name}/inference-endpoints/transcribe/jobs/{job_id}` — [Get job](/reference/transcribe/inference_endpoints/get-an-inference-endpoint-job) | | Cancel job | Operation: `delete_inference_endpoint_job`; `DELETE /organizations/{organization_name}/inference-endpoints/transcribe/jobs/{job_id}` — [Delete job](/reference/transcribe/inference_endpoints/delete-an-inference-endpoint-job) | Request and response shape comes from `api-specs/transcribe.json`, not the similarly named operations in another spec. ## Dynamic values to retrieve * Current endpoint metadata before submission. * The create response `id`, `Location`, status, events, and timestamps. * Current job `status`, `events`, `update_time`, and `output` on every verification read. * Current rate-limit response and `Retry-After` when supplied. Do not infer completion time from media duration or historical examples. ## Preflight checks 1. Complete [Choose a Transcription API and Preflight](/agents/transcription/choose-api-and-preflight). 2. Confirm the chosen path contains `/transcribe/`, not `/transcription-lite/`. 3. Validate the full body against `CreateSaladCloudTranscriptionAPIJob`; only `input` is required at the top level, and `input.url` is required. 4. Confirm any `audio_stream_index`, `multichannel`, or `enhanced_accuracy` setting is intentional. Do not send these primary-only fields to Lite. 5. If application state already records a job ID for this logical request, read that job instead of creating another. 6. Treat caller metadata as correlation only. The API does not document an idempotency key or uniqueness guarantee. 7. Define terminal success and failure predicates plus the polling budget before submitting. ## Procedure ### Submit once Read the endpoint immediately before submission. This schema-derived template includes only supported primary fields: ```bash theme={null} curl --fail-with-body --silent --show-error \ --request POST \ --url "https://api.salad.com/api/public/organizations/${SALAD_ORGANIZATION}/inference-endpoints/transcribe/jobs" \ --header "Salad-Api-Key: ${SALAD_API_KEY}" \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --data '{ "input": { "url": "", "multichannel": true, "word_level_timestamps": true, "diarization": true }, "metadata": { "client_request_id": "" } }' ``` This example preserves channels and requests word-level diarization. Omit `language_code` for automatic detection; add it only when the caller intends a specific Whisper language code. Replace placeholders locally without logging the complete media URI. Do not treat `client_request_id` as server-side idempotency. A successful create returns `201`, a job representation, and a `Location` header. Persist the returned ID before doing other work. ### Poll and retrieve output ```bash theme={null} curl --fail-with-body --silent --show-error \ --url "https://api.salad.com/api/public/organizations/${SALAD_ORGANIZATION}/inference-endpoints/transcribe/jobs/${SALAD_TRANSCRIPTION_JOB_ID}" \ --header "Salad-Api-Key: ${SALAD_API_KEY}" \ --header 'Accept: application/json' ``` Poll the exact ID within the declared budget. On `succeeded`, verify the requested output properties against the live response. The schema supports text, duration, processing time, word/sentence timestamps, timestamp-source metadata, SRT, summary, translations, custom-vocabulary output, LLM result, classification, and sentiment when their corresponding features apply. For multichannel diarization, verify channel identifiers in the returned timestamp segments rather than assuming the input alone took effect. The schema does not define a file-URL output shape for `return_as_file`. If the live response returns one as described by canonical guides, treat that URI as sensitive and report the observed shape rather than inventing fields. ### Cancel only when authorized Read the job immediately before cancellation. If it is already terminal, do not delete it. With explicit cancellation intent, call `delete_inference_endpoint_job`, then poll `get_inference_endpoint_job` within the budget. ## Decision rules | Evidence or intent | Action | | - | - | | A trusted record contains an existing job ID | Read and continue that job; do not submit again. | | Create returns `201` and an ID | Persist the ID and verify with `get_inference_endpoint_job`. | | Create outcome is unknown and no ID was returned | Stop. Listing jobs cannot prove identity because the API documents no idempotency key or metadata filter. | | Job is `pending` or `running` | Continue bounded polling; do not create a replacement. | | Job is `succeeded` with requested output | Return verified success. | | Job is `succeeded` but required output is absent | Report an unresolved output mismatch and preserve evidence. | | Job is `failed` or unexpectedly `cancelled` | Stop and troubleshoot; resubmission is a new operation requiring user intent. | | User asks to change an existing job | Stop: neither specification defines an update operation. | ## Expected states and responses Create returns `201`; reads return `200`; cancellation returns `202`. Job states are `pending`, `running`, `succeeded`, `cancelled`, and `failed`. Event actions are `created`, `started`, `succeeded`, `cancelled`, and `failed`. A `201` proves job creation, not transcription completion. A `202` proves cancellation acceptance, not a verified cancelled state. ## Retry behavior Retry reads for transient transport, `429`, or server failures using bounded backoff and `Retry-After` when present. Never retry a create whose result is uncertain and lacks a returned ID. Do not resubmit failed/cancelled jobs or retry cancellation without a fresh read and the original explicit intent. ## Verification | Mutation | Read before | Read after | Success | Failure or unresolved | | - | - | - | - | - | | `create_inference_endpoint_job` | `get_inference_endpoint`; trusted job-ID lookup | `get_inference_endpoint_job` | Exact returned ID exists and later reaches `succeeded` with required output | Unknown create outcome, `failed`/`cancelled`, missing output, or pending past budget | | `delete_inference_endpoint_job` | `get_inference_endpoint_job` | Same operation | Live state becomes `cancelled` | Still active past budget; `404` after acceptance is unresolved, not proof | ## Rollback or recovery A submitted job cannot be edited. Cancellation is destructive and requires explicit intent; it is not an automatic rollback. Preserve the job ID and events after failure. Submit a corrected replacement only after diagnosing the cause, confirming media access and inputs, and obtaining new submission intent. ## Stop and escalation conditions Stop on missing scope/source/feature values, invalid schema, an uncertain create without ID, exhausted polling, unexpected terminal state, missing required output, or repeated read failure. Escalate with the exact product/path, organization, job ID, UTC timestamps, events, redacted input field names, response problem instance, and expected versus observed output. ## Evidence to return to the user Return product/path, organization, job ID, response classes, requested input/output field names, redacted source origin, status/events/timestamps, polling attempts and elapsed time, verified output property names, cancellation state, and any unresolved or escalation result. Do not return the API key, complete signed/webhook URIs, media, transcript contents, or sensitive metadata unless the user explicitly requested that content through an authorized channel. # Troubleshoot a Transcription Job Source: https://docs.salad.com/agents/transcription/troubleshoot-job Diagnose primary or Lite transcription job submission, pending, failure, output, source-access, rate-limit, and webhook issues without inventing logs or resubmitting work. *Last Updated: August 24, 2026* ## When to use this runbook Use when a `transcribe` or `transcription-lite` request fails, remains non-terminal, succeeds without expected output, or completes but the caller does not receive its webhook. ## When not to use it Do not use troubleshooting as permission to cancel, delete, or resubmit a job. Do not claim access to service logs; neither Transcription specification defines a log operation. ## Required inputs * `SALAD_API_KEY`, `SALAD_ORGANIZATION`, exact product, and `SALAD_TRANSCRIPTION_JOB_ID` when creation returned one. * Request/response timestamps in UTC, HTTP response class, and returned `ProblemDetails` fields when available. * Redacted intended input field names and expected output behavior. * Source accessibility evidence and webhook delivery evidence from systems the user authorized the agent to inspect. * A caller-defined read/polling budget and explicit intent before cancellation or replacement submission. ## Authoritative sources | Product | Exact job read path and specification | | - | - | | Primary | Operation: `get_inference_endpoint_job`; `GET /organizations/{organization_name}/inference-endpoints/transcribe/jobs/{job_id}` — [Get primary job](/reference/transcribe/inference_endpoints/get-an-inference-endpoint-job) | | Lite | Operation: `get_inference_endpoint_job`; `GET /organizations/{organization_name}/inference-endpoints/transcription-lite/jobs/{job_id}` — [Get Lite job](/reference/transcription-lite/inference_endpoints/get-an-inference-endpoint-job) | | Endpoint health | Operation: `get_inference_endpoint` on the corresponding fixed endpoint path — [Transcription API reference](/transcription/reference/api) | | Recent jobs | Operation: `get_inference_endpoint_jobs` on the corresponding jobs collection, with `page` and `page_size` when needed | Use `api-specs/transcribe.json` for primary and `api-specs/transcription-lite.json` for Lite. The operation IDs are identical, so product/path evidence is mandatory. ## Dynamic values to retrieve * Live endpoint metadata and access response. * Exact job status, events, create/update times, echoed input, metadata, webhook, and output. * Current source URI reachability/expiry and webhook receiver records when access is authorized. * Current rate-limit response and any server-provided retry guidance. Redact signed URLs, metadata values, transcript/media contents, and webhook tokens before retaining evidence. ## Preflight checks 1. Confirm the product from a trusted original path or job record; do not infer it from the shared operation ID. 2. Validate the organization and endpoint with `get_inference_endpoint`. 3. If a job ID exists, call `get_inference_endpoint_job` on that exact product path. 4. If no ID was returned from an uncertain create, do not submit another job. A list response cannot reliably identify the request because no idempotency key or metadata filter is documented. 5. Establish the incident window, expected output, source access method, and polling budget. ## Procedure 1. **Classify the request response.** Preserve redacted `ProblemDetails.type`, `title`, `status`, `detail`, and `instance`; do not treat the example values as a live error taxonomy. 2. **Read the endpoint.** Distinguish an invalid organization/product path from a job-specific problem. 3. **Read the job.** Record state, every event action/time, create/update time, and whether output exists. 4. **Validate input shape.** Compare echoed field names with the selected input schema. `audio_stream_index`, `multichannel`, and `enhanced_accuracy` are valid only on primary; primary-only fields on Lite and undocumented fields are configuration errors. 5. **Check source access.** Confirm the submitted URI was downloadable by an external service during processing. Do not expose signed query parameters or use private credentials outside their authorized storage flow. 6. **Interpret state.** Use the decision table below; do not invent a `created` or `started` job state from event names. 7. **Validate output.** On success, compare observed output property names with the requested features and selected product schema. For primary multichannel diarization, check channel identifiers in the relevant word/sentence segments. Treat an undocumented file-link shape as observed live behavior, not a schema guarantee. 8. **Separate webhook delivery.** A succeeded job can be retrieved even if the receiver missed the webhook. Inspect the authorized receiver independently; the job APIs expose no delivery log or retry contract. 9. **Collect an escalation package** when bounded reads and authorized external checks cannot resolve the issue. ## Decision rules | Evidence | Classification and next action | | - | - | | Create returned a schema-validation problem | Correct only fields allowed by the selected schema; a new submission requires user intent. | | Endpoint read fails for the trusted scope | Scope, access, or product-path problem; stop rather than guessing another organization. | | Job `404` with a trusted returned ID | Recheck product path and organization once; then escalate with the create response and `Location`. | | `pending` with only a `created` event | Accepted but queued; continue bounded polling without resubmission. | | `running` with a `started` event | Processing; continue bounded polling without promising an ETA. | | `failed` | Terminal failure; preserve events/source/configuration and require new intent before replacement. | | `cancelled` without expected authorization | Preserve evidence and escalate; do not recreate automatically. | | `succeeded` but expected output is missing | Output/schema mismatch; preserve the complete response securely and escalate. | | Primary multichannel succeeds without channel identifiers | Verify diarization settings and selected stream, then preserve the response and escalate if still inconsistent. | | Job succeeded but webhook was not observed | Verify by GET, then diagnose the receiver; do not resubmit the transcription. | | `429` | Honor `Retry-After` when present and continue only within the original read/polling budget. | ## Expected states and responses Job states are `pending`, `running`, `succeeded`, `cancelled`, and `failed`. Events are separate and use `created`, `started`, `succeeded`, `cancelled`, and `failed`. Create returns `201`, reads `200`, and cancellation `202`. The specifications define no service-log endpoint, completion-time guarantee, webhook-delivery state, update operation, or idempotency key. ## Retry behavior Retry only endpoint/job reads for plausible transient failures with bounded exponential backoff and jitter. Honor `Retry-After` when supplied. Do not retry unchanged validation or authorization failures, an uncertain create without an ID, a failed job, webhook delivery by resubmitting work, or cancellation without a fresh read and explicit intent. ## Verification Diagnosis is verified by fresh endpoint/job reads and authorized source/receiver evidence. A recovery submission is a new billable/processing operation: preflight it, create once, capture the new ID, and verify independently. Cancellation requires a pre-read, the delete operation on the exact product path, and a post-read showing `cancelled`; otherwise it remains pending or unresolved. ## Rollback or recovery * Correct a media URI or request field only in a new job after user approval; existing jobs cannot be updated. * Retrieve a succeeded job by ID when webhook delivery failed; do not repeat processing. * Preserve failed/cancelled job events and response problem instances. * Do not delete evidence or expose media/transcript content in a support package. ## Stop and escalation conditions Stop when product/scope/job ID is ambiguous, a source or receiver cannot be checked safely, polling expires, a terminal failure lacks actionable evidence, or a succeeded response violates the selected output schema. Escalate rather than guessing backend logs, retry behavior, or a replacement request. The escalation package includes the organization, exact product/path, job ID and `Location`, UTC request/create/update and event times, current state, redacted input/output property names, media origin without secret query data, webhook receiver result, HTTP response class, `ProblemDetails.instance`, polling history, reproduction steps, and recent caller changes. ## Evidence to return to the user Return the exact product/path, organization/job ID, state/events/timestamps, diagnosis and ruled-out causes, safe source and webhook checks, response problem identifiers, requested versus observed output property names, retry/poll budget, redactions, and next action requiring approval. Clearly label resolved, terminal, pending, and unknown outcomes. # Salad AI Gateway Overview Source: https://docs.salad.com/ai-gateway/explanation/overview OpenAI-compatible LLM API powered by SaladCloud distributed GPU infrastructure. *Last Updated: October 19, 2026* > Use the `salad-ai-gateway-request` skill and [AI Gateway request > runbook](/agents/ai-gateway/select-model-and-send-request). Retrieve live model IDs from `/v1/models`, use only the > organization-specific Bearer key, protect prompts and output, and never automatically repeat uncertain billable > work. > [!WARNING] > > Salad AI Gateway is currently in **beta**. Pay-per-token access is self-service. ## What is Salad AI Gateway? Salad AI Gateway is a managed LLM API service that gives you direct access to powerful open-source models through a single, OpenAI-compatible endpoint - with no infrastructure to deploy or manage. It is powered by SaladCloud's distributed GPU network, bringing the same cost-efficiency of self-hosted models with the simplicity of a hosted API. Any tool or library that supports a custom base URL - Aider, OpenCode, OpenClaw, Cline, Cursor, Goose, Vercel AI SDK, and more - works with Salad AI Gateway out of the box. ## API Endpoint ``` https://ai.salad.cloud/v1 ``` ## Available Models The following models are currently available: | Model | Description | | :- | :- | | `qwen3.6-35b-a3b` | Qwen 3.6 35B Mixture of Experts - best for agentic tasks and complex reasoning | | `qwen3.6-27b` | Qwen 3.6 27B dense - general purpose, balancing capability and speed | | `qwen3.5-35b-a3b` | Qwen 3.5 35B Mixture of Experts - suited for agentic tasks and reasoning | | `qwen3.5-9b` | Qwen 3.5 9B dense - fastest model, suited for high-volume simple queries | Additional models will be added as the service moves toward general availability. ## Access Model Access is self-service and billed per token. Each AI Gateway key belongs to one user and one organization, and requests are billed to that organization's credits; a positive balance is required to admit new requests. ## Billing Pay-per-token requests use the [published input and output token rates](/ai-gateway/reference/pricing), with no concurrency limit. Usage draws from the credit balance of the organization associated with your key. Requests already admitted complete and are billed even if credits run out during generation or the key is revoked or regenerated. Follow [Pay-Per-Token Onboarding](/ai-gateway/tutorials/pay-per-token-onboarding) to add credits and create your AI Gateway API key. ## Quick Start The API follows the OpenAI `v1/chat/completions` format. Send requests using your organization-specific AI Gateway API key in the `Authorization` header. This is not the account API key used with `Salad-Api-Key`: ```bash theme={null} export SALAD_AI_GATEWAY_API_KEY="" curl https://ai.salad.cloud/v1/chat/completions \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $SALAD_AI_GATEWAY_API_KEY" \ -d '{ "model": "qwen3.6-35b-a3b", "messages": [ {"role": "user", "content": "Explain distributed GPU computing in one paragraph."} ] }' ``` Replace `` with the key created for the organization you want to bill. ## Use with OpenAI-Compatible Tools Because Salad AI Gateway exposes a standard OpenAI-compatible endpoint, you can use it with any tool that supports a custom base URL. We have integration guides for many popular agentic tools - Cline, Aider, OpenCode, OpenClaw, Kilo Code, Roo Code, Continue, Goose, Hermes Agent, and more. In guides with both backends, follow the **Salad AI Gateway** tab. Self-hosted Container Engine deployments use different endpoints and authentication. For AI Gateway, set your organization-specific AI Gateway key in the tool's API key field (sent as `Authorization: Bearer`) and point the base URL to `https://ai.salad.cloud/v1`. Do not add a `Salad-Api-Key` custom header. > [card] [Cline](/container-engine/tutorials/agentic-tools/use-cline-with-saladcloud) > > VS Code AI coding agent > [card] [Aider](/container-engine/tutorials/agentic-tools/use-aider-with-saladcloud) > > CLI AI pair programmer > [card] [OpenCode](/container-engine/tutorials/agentic-tools/use-opencode-with-saladcloud) > > Terminal coding agent > [card] [OpenClaw](/container-engine/tutorials/agentic-tools/use-openclaw-with-saladcloud) > > Always-on AI assistant > [card] [Kilo Code](/container-engine/tutorials/agentic-tools/use-kilo-code-with-saladcloud) > > VS Code coding agent > [card] [Roo Code](/container-engine/tutorials/agentic-tools/use-roo-code-with-saladcloud) > > VS Code AI coding agent > [card] [Continue](/container-engine/tutorials/agentic-tools/use-continue-with-saladcloud) > > VS Code + JetBrains coding assistant > [card] [Vercel AI SDK](/container-engine/tutorials/agentic-tools/use-vercel-ai-sdk-with-saladcloud) > > TypeScript AI app framework > [card] [Goose](/container-engine/tutorials/agentic-tools/use-goose-with-saladcloud) > > CLI + desktop AI agent > [card] [Hermes Agent](/container-engine/tutorials/agentic-tools/use-hermes-agent-with-saladcloud) > > Self-improving AI agent with MCP **Python (openai SDK):** ```python theme={null} import os from openai import OpenAI client = OpenAI( base_url="https://ai.salad.cloud/v1", api_key=os.environ["SALAD_AI_GATEWAY_API_KEY"], ) response = client.chat.completions.create( model="qwen3.6-35b-a3b", messages=[{"role": "user", "content": "Hello from Salad AI Gateway!"}], ) print(response.choices[0].message.content) ``` **Environment variables (for tools like Aider, etc.):** ```bash theme={null} export OPENAI_BASE_URL=https://ai.salad.cloud/v1 export OPENAI_API_KEY="$SALAD_AI_GATEWAY_API_KEY" ``` These tool-specific variables contain the same AI Gateway key set in Quick Start, not an account API key or an OpenAI API key. ## Why Salad AI Gateway? * **No Infrastructure** - no container groups to deploy, no replicas to manage, no cold starts to worry about * **Always on** - our distributed GPU network ensures high availability and reliability * **OpenAI-compatible** - easy integration with any OpenAI-compatible tool * **SaladCloud Pricing** - 90% cost savings vs traditional providers * **[Data Privacy](https://salad.com/privacy/#4-ai-gateway-data-policy)** - your data is never used for training * **Powered by Sustainable Computing** - utilizing otherwise wasted GPU resources to reduce carbon footprint ## Get Access Pay-per-token access is available through self-service onboarding. [Self-onboard for pay-per-token access](/ai-gateway/tutorials/pay-per-token-onboarding) or [learn more about Salad AI Gateway](https://salad.com/ai-gateway). Already have a key? See [Manage Your AI Gateway API Key](/ai-gateway/how-to-guides/manage-api-key) for rotation and deletion, or [Errors](/ai-gateway/reference/errors) for billing and access failures. # Manage Your AI Gateway API Key Source: https://docs.salad.com/ai-gateway/how-to-guides/manage-api-key Create, copy, regenerate, and delete an organization-specific AI Gateway key, and understand its lifecycle. *Last Updated: September 23, 2026* Use this guide to manage the key for AI Gateway pay-per-token access. For account setup, credits, and a first request, start with [Pay-Per-Token Onboarding](/ai-gateway/tutorials/pay-per-token-onboarding). ## Key Scope and Billing Each key belongs to one user and one organization. You can create one current AI Gateway key per organization you belong to; other members manage their own keys. Usage with your key is billed to that organization's SaladCloud credit balance. Use a separate key for each organization you want to bill. > [!NOTE] > > An AI Gateway key is not your account's **Current API Key**. Send the Gateway key in `Authorization: Bearer`, not in > the `Salad-Api-Key` header. Changing your account API key does not rotate your AI Gateway keys. ## Create a Key 1. Sign in to the [SaladCloud portal](https://portal.salad.com) and open the organization you want to bill. 2. Select **AI Gateway** in the organization's left navigation. 3. Click **Create API Key for _organization name_**. If you already have a key for this organization, copy or regenerate it instead of creating another one. The organization needs a positive credit balance for pay-per-token requests to be admitted. ## Find and Copy a Key 1. Select your username in the upper-right corner of the portal, then select **API Access**. 2. Under **AI Gateway Keys**, find the organization you want to bill. 3. Click the copy icon next to that organization's masked key. This list contains only keys you created, across your organizations. The **Current API Key** above the list is the separate account key. Select **Manage** to return to an organization's **AI Gateway** page, where you can reveal, regenerate, or delete its key. Store the copied value in a secret environment variable named `SALAD_AI_GATEWAY_API_KEY` or your application's secret manager. Never commit it to source control, expose it in browser code, or share it with other users. ## Regenerate a Key Regeneration creates a replacement for your key in the same organization. Use an expiration delay to migrate clients without interrupting new requests during the changeover: 1. Open the organization's **AI Gateway** page, directly or through **Manage** on the **API Access** page. 2. Choose "Change API Key" for the key you want to regenerate. 3. Choose when the previous key should expire, then confirm regeneration. The expiration delay applies to the **previous key**, not the replacement. 4. Copy the replacement key and update every application or secret store that uses the old value. 5. Before the delay expires, verify your applications use the replacement key. A test completion consumes tokens and is billed to the organization. During the overlap, both keys can admit requests, subject to the organization's access and credit balance. After the delay expires, the previous key no longer admits new requests. If you choose immediate expiration, there is no overlap. > [!WARNING] > > If a key has been exposed, expire it immediately or delete it. An expiration delay lets anyone holding the previous > key continue to submit requests until it expires. Regeneration does not cancel requests already admitted. ## Delete a Key 1. Open the organization's **AI Gateway** page. 2. Choose the key's delete action and confirm deletion. 3. Remove the deleted credential from applications and secret stores that used it. Deletion revokes the key for new requests. To resume access, create a new key and update your clients. Deleting a key does not cancel requests already admitted or remove charges for their usage. ## Organization Membership and Deletion * If you leave or are removed from an organization, your AI Gateway key for that organization is deleted. Keys for other organizations are unaffected. * If an organization is deleted, all AI Gateway keys belonging to it are deleted. * If your user account is deleted, all of your AI Gateway keys are deleted. An old key is not restored if you later rejoin an organization. Create a new key after your membership is restored. ## Requests Already in Progress The Gateway checks the key and pay-per-token access conditions when it admits a request, not continuously during generation. Requests already admitted, including streaming responses, are allowed to complete and their token usage is billed to the key's organization even if: * The key is deleted, revoked, or regenerated while the request is running. * The previous key's expiration delay ends while the request is running. * The organization's credits run out while the request is running. Key revocation and credit exhaustion prevent new requests; they do not cancel work already admitted. A client timeout or disconnected stream also does not prove the request was cancelled. Do not automatically resend an uncertain request, because another completion can incur another charge. See [Pricing](/ai-gateway/reference/pricing) for billing and [Errors](/ai-gateway/reference/errors) for rejected requests and suggested actions. # AI Gateway Integrations Source: https://docs.salad.com/ai-gateway/integrations/overview Connect Salad AI Gateway to your favorite coding agents, IDEs, messaging bots, and developer frameworks. *Last Updated: September 22, 2026* > Verify each tool's exact base URL, Bearer-key environment variable, installed version, model ID, and streaming > behavior. Do not assume a self-hosted guide's `Salad-Api-Key` header applies to AI Gateway. Use the > `salad-ai-gateway-troubleshoot` skill when a configured client fails. Salad AI Gateway exposes a standard OpenAI-compatible endpoint, so any tool that supports a custom base URL works with it out of the box. Set the base URL to `https://ai.salad.cloud/v1` and use your [organization-specific AI Gateway API key](/ai-gateway/tutorials/pay-per-token-onboarding) for authentication. > [!NOTE] > > Use `Authorization: Bearer` with the AI Gateway key, not your account's **Current API Key** or a `Salad-Api-Key` > custom header. Where a guide offers both backends, choose its **Salad AI Gateway** tab. The **Self-Hosted on > SaladCloud** tab applies to your own Container Engine deployment and retains its separate authentication setup. ## Coding Agents & IDEs Tools that help you write and edit code. > [card] [Cline](/container-engine/tutorials/agentic-tools/use-cline-with-saladcloud) > > Open-source AI coding agent for VS Code with autonomous file editing and terminal execution. > [card] [Roo Code](/container-engine/tutorials/agentic-tools/use-roo-code-with-saladcloud) > > VS Code extension with specialized modes for coding, architecture, debugging, and testing. > [card] [Kilo Code](/container-engine/tutorials/agentic-tools/use-kilo-code-with-saladcloud) > > VS Code AI coding agent with multi-model support and agentic task execution. > [card] [Continue](/container-engine/tutorials/agentic-tools/use-continue-with-saladcloud) > > Open-source coding assistant for VS Code and JetBrains with inline autocomplete and chat. > [card] [Aider](/container-engine/tutorials/agentic-tools/use-aider-with-saladcloud) > > Terminal-based AI pair programmer that commits changes to git automatically. > [card] [OpenCode](/container-engine/tutorials/agentic-tools/use-opencode-with-saladcloud) > > Connect with provider login and select SaladCloud AI Gateway. No custom provider configuration required. > [card] [Factory (Droid)](/container-engine/tutorials/agentic-tools/use-factory-with-saladcloud) > > Connect the Droid coding agent to AI Gateway with your own API key and a custom model configuration. ## AI Assistants & Agents General-purpose agents and messaging integrations. > [card] [Goose](/container-engine/tutorials/agentic-tools/use-goose-with-saladcloud) > > Open-source AI agent by Block with CLI and desktop app, extensible via MCP. > [card] [Hermes Agent](/container-engine/tutorials/agentic-tools/use-hermes-agent-with-saladcloud) > > Install SaladCloud provider plugin, then use hermes easy setup . > [card] [OpenClaw](/container-engine/tutorials/agentic-tools/use-openclaw-with-saladcloud) > > Personal AI assistant that connects to Telegram, WhatsApp, Slack, and Discord. > [card] [NemoClaw](/container-engine/tutorials/agentic-tools/use-nemoclaw-with-saladcloud) > > Lightweight messaging assistant for Telegram and Discord. ## Developer Frameworks & SDKs Build AI-powered applications and services. > [card] [Vercel AI SDK](/container-engine/tutorials/agentic-tools/use-vercel-ai-sdk-with-saladcloud) > > Use the published SaladCloud provider with AI SDK 7 for text generation and streaming. > [card] [Mastra](/container-engine/tutorials/agentic-tools/use-mastra-with-saladcloud) > > Build an agent using the SaladCloud AI SDK provider directly, without a model-router registry entry. # AI Gateway Errors Source: https://docs.salad.com/ai-gateway/reference/errors Resolve AI Gateway credit and access errors without unsafe retries. *Last Updated: October 19, 2026* Read the HTTP status and error code together when an AI Gateway request fails. ## Pay-Per-Token Access Errors | HTTP status | Error code | Meaning | Suggested action | | - | - | - | - | | `402` | `credits_exhausted` | The organization billed by the key no longer has a positive credit balance. | Add credits through that organization's **Billing & Usage** page, then retry after the balance is positive. Check that your key belongs to the organization you funded. | | `403` | `no_access` | The credential does not have AI Gateway access. | Use the intended organization's AI Gateway key, confirm your organization membership and access, and contact support if access is still denied. Do not retry unchanged. | For credit management, see [Billing](/general/explanation/billing). For creating, replacing, or revoking a key, see [Manage Your AI Gateway API Key](/ai-gateway/how-to-guides/manage-api-key). ## Authentication Checks For missing or invalid credentials, check all of the following without logging the key: * The base URL is `https://ai.salad.cloud/v1`. * The request uses `Authorization: Bearer `. * The value is the organization's **AI Gateway key**, not the account's **Current API Key**. * The key has not been deleted or replaced by a regenerated key whose overlap period has ended. A successful `GET /v1/models` request confirms model discovery, not that your key or credit balance permits a billable completion. ## Admission and In-Flight Requests Key validity and pay-per-token access are checked when a request is admitted. A request rejected at admission for one of the access errors above is not processed as a completion. Once admitted, a request can finish and its tokens are billed even if its key is revoked or regenerated, or the organization's credits run out before it finishes. This also applies to streaming requests. Deleting a key is not a way to cancel an existing completion or avoid its charge. See [Requests Already in Progress](/ai-gateway/how-to-guides/manage-api-key#requests-already-in-progress). ## Retry Safely * For `credits_exhausted` or `no_access`, resolve the billing or access issue before submitting again. * After a timeout, connection failure, server error, or partial stream, the outcome and charge can be uncertain. Do not automatically repeat the request; a new completion can incur another charge. If the issue persists, [contact SaladCloud Support](/support/contact) with the endpoint, model ID, UTC time, HTTP status, error code, and request identifier if provided. Do not include API keys or sensitive prompts and outputs. Agents should follow the [troubleshooting runbook](/agents/ai-gateway/troubleshoot-request). # AI Gateway Models Source: https://docs.salad.com/ai-gateway/reference/models Reference for all models available through Salad AI Gateway, including context windows, capabilities, and recommended use cases. *Last Updated: October 12, 2026* > Model IDs and availability are dynamic. Query `GET https://ai.salad.cloud/v1/models` immediately before selection, > require approval before substituting an absent model, and use the [AI Gateway request > runbook](/agents/ai-gateway/select-model-and-send-request). Do not infer undocumented limits from another provider. > [!WARNING] > > Salad AI Gateway is currently in **beta**. ## Available Models ### qwen3.6-35b-a3b | Property | Value | | :- | :- | | Model ID | `qwen3.6-35b-a3b` | | Model name | Qwen3.6 35B-A3B | | Architecture | Mixture of Experts (MoE) | | Context window | 262,144 tokens | | Input | Text, image | | Output | Text | **Best for**: Agentic tasks, complex multi-step reasoning, code generation, instruction following. This is the recommended model for most agentic and coding use cases. It handles tool calling reliably, supports structured output, and performs well in long agentic sessions. *** ### qwen3.6-27b | Property | Value | | :- | :- | | Model ID | `qwen3.6-27b` | | Model name | Qwen3.6 27B | | Architecture | Dense | | Context window | 195,200 tokens | | Input | Text, image | | Output | Text | **Best for**: General-purpose workloads that need a balance of capability and speed. *** ### qwen3.5-35b-a3b | Property | Value | | :- | :- | | Model ID | `qwen3.5-35b-a3b` | | Model name | Qwen3.5 35B-A3B | | Architecture | Mixture of Experts (MoE) | | Active params | \~3.5B (35B total) | | Context window | 262,144 tokens | | Input | Text, image | | Output | Text | **Best for**: Agentic tasks, complex multi-step reasoning, code generation, instruction following. The Mixture of Experts architecture activates only a subset of parameters per token, providing strong reasoning capability at lower latency than a dense 35B model. It handles tool calling reliably and performs well in long agentic sessions. *** ### qwen3.5-9b | Property | Value | | :- | :- | | Model ID | `qwen3.5-9b` | | Model name | Qwen3.5 9B | | Architecture | Dense | | Context window | 196,608 tokens | | Input | Text, image | | Output | Text | **Best for**: High-volume, simple queries where speed matters most. This is the fastest model in the lineup. *** ## Choosing a Model | Use Case | Recommended Model | | :- | :- | | Agentic coding (Cline, Roo Code) | `qwen3.6-35b-a3b` | | Complex reasoning / planning | `qwen3.6-35b-a3b` | | Cost-efficient agentic tasks | `qwen3.5-35b-a3b` | | General purpose | `qwen3.6-27b` | | High-volume, simple queries | `qwen3.5-9b` | ## API Usage Specify the model ID in the `model` field of your request: ```bash theme={null} curl https://ai.salad.cloud/v1/chat/completions \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $SALAD_AI_GATEWAY_API_KEY" \ -d '{ "model": "qwen3.6-35b-a3b", "messages": [{"role": "user", "content": "Hello"}] }' ``` To list available models programmatically: ```bash theme={null} curl https://ai.salad.cloud/v1/models \ -H "Authorization: Bearer $SALAD_AI_GATEWAY_API_KEY" ``` ## Notes * All models support the `/v1/chat/completions` endpoint with streaming (`"stream": true`). * All models support text and image inputs, text outputs, tool calling, structured outputs, and reasoning. * Input and output tokens share the context window. A request's prompt plus its generated output (`max_tokens`) cannot exceed the model's context window. * Context window limits are enforced server-side. If your input exceeds the limit, the request will return an error. * The model catalog may expand during beta. # AI Gateway Pricing Source: https://docs.salad.com/ai-gateway/reference/pricing AI Gateway pay-per-token rates and organization credit billing. *Last Updated: October 19, 2026* > Treat these published rates as current documentation, not live account balance or historical usage. Confirm the > selected model against `/v1/models`, disclose the cost tradeoff when it affects selection, and never repeat an > uncertain billable completion automatically. See the [AI Gateway request > runbook](/agents/ai-gateway/select-model-and-send-request). > [!WARNING] > > Salad AI Gateway is currently in **beta**. ## Pay-Per-Token Billing Self-service AI Gateway access uses pay-per-token billing. Usage is charged for input and output tokens at the published rates below, with no concurrency limit. Each AI Gateway key belongs to one user and one organization. Usage is billed to the organization associated with the key and draws from that organization's SaladCloud credit balance. The organization must have a **positive credit balance** when a request is admitted. Follow [Pay-Per-Token Onboarding](/ai-gateway/tutorials/pay-per-token-onboarding) to add credits and create an organization-specific AI Gateway API key. Requests already admitted are allowed to complete and their tokens are billed even if credits run out during generation. New requests are rejected with `402 credits_exhausted` once the credit balance is no longer positive. Likewise, revoking or regenerating a key does not cancel or remove charges for requests already admitted. See [key lifecycle behavior](/ai-gateway/how-to-guides/manage-api-key#requests-already-in-progress). See [Errors](/ai-gateway/reference/errors) for suggested actions and safe retry behavior. ## Pay-Per-Token Rates Prices are per million tokens. | Model | Input (\$/M tokens) | Output (\$/M tokens) | | :- | -: | -: | | `qwen3.6-35b-a3b` | \$0.06 | \$0.95 | | `qwen3.6-27b` | \$0.29 | \$1.90 | | `qwen3.5-35b-a3b` | \$0.06 | \$0.90 | | `qwen3.5-9b` | \$0.07 | \$0.23 | Input tokens include your prompt, image inputs, tool definitions, and any conversation history sent with each request. Output tokens are the generated response. [Learn more about Salad AI Gateway](https://salad.com/ai-gateway) # Getting Started with Salad AI Gateway Source: https://docs.salad.com/ai-gateway/tutorials/getting-started Make your first API call to Salad AI Gateway in under 5 minutes. *Last Updated: October 19, 2026* > Treat examples as minimal templates, not live model or account facts. Use the `salad-ai-gateway-request` skill, > confirm the exact model with `/v1/models`, keep `SALAD_AI_GATEWAY_API_KEY` and all prompt/output content secret, and > stop rather than retry an uncertain completion or partial stream. > [!WARNING] > > Salad AI Gateway is currently in **beta**. Pay-per-token access is self-service. ## Prerequisites * A SaladCloud organization with a positive credit balance * An organization-specific AI Gateway API key. Follow [Pay-Per-Token Onboarding](/ai-gateway/tutorials/pay-per-token-onboarding) to create one. ## Base URL All requests go to: ``` https://ai.salad.cloud/v1 ``` ## Authentication Pass your organization-specific AI Gateway API key as a Bearer token in the `Authorization` header. Usage is billed to the organization associated with that key: ``` Authorization: Bearer ``` > [!NOTE] > > Use the key created on your organization's **AI Gateway** page, not the account's **Current API Key**. The > `Salad-Api-Key` header used by other SaladCloud APIs does not authenticate AI Gateway requests. Store your key in the environment before running any example below: ```bash theme={null} export SALAD_AI_GATEWAY_API_KEY="" ``` Keep the key server-side and out of source control. See [Manage Your AI Gateway API Key](/ai-gateway/how-to-guides/manage-api-key) to copy, regenerate, or delete it. ## Step 1: Test with curl The quickest way to verify access is a single curl call: ```bash theme={null} curl https://ai.salad.cloud/v1/chat/completions \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $SALAD_AI_GATEWAY_API_KEY" \ -d '{ "model": "qwen3.6-35b-a3b", "messages": [ {"role": "user", "content": "Say hello in one sentence."} ] }' ``` You should receive a JSON response containing the model's reply. ## Step 2: Use the SaladCloud AI SDK Provider For JavaScript and TypeScript applications built with the Vercel AI SDK, use the official `@saladtechnologies-oss/ai-sdk-provider`. The provider requires Node.js 22 or later and automatically uses the Salad AI Gateway base URL. Install the provider, Vercel AI SDK, and Zod: ```bash theme={null} npm install @saladtechnologies-oss/ai-sdk-provider ai zod ``` The provider reads your key from `SALAD_CLOUD_API_KEY`. If you followed the pay-per-token onboarding guide, map the existing variable before running your application: ```bash theme={null} export SALAD_CLOUD_API_KEY="$SALAD_AI_GATEWAY_API_KEY" ``` Create `index.mjs`: ```javascript index.mjs theme={null} import { generateText } from 'ai' import { saladCloud } from '@saladtechnologies-oss/ai-sdk-provider' const result = await generateText({ model: saladCloud('qwen3.6-35b-a3b'), prompt: 'Say hello in one sentence.', }) console.log(result.text) ``` Run the example: ```bash theme={null} node index.mjs ``` The provider also supports streaming, tool calling, structured output, reasoning options, and image inputs. See the [SaladCloud AI SDK Provider repository](https://github.com/SaladTechnologies/ai-sdk-provider) for configuration and additional examples. ## Step 3: Use the OpenAI Python SDK Salad AI Gateway is fully compatible with the OpenAI Python SDK — just point it at a different base URL: ```bash theme={null} pip install openai ``` ```python theme={null} import os from openai import OpenAI client = OpenAI( base_url="https://ai.salad.cloud/v1", api_key=os.environ["SALAD_AI_GATEWAY_API_KEY"], ) response = client.chat.completions.create( model="qwen3.6-35b-a3b", messages=[{"role": "user", "content": "Explain what Salad AI Gateway is in two sentences."}], ) print(response.choices[0].message.content) ``` ## Step 4: Streaming For real-time output, enable streaming: ```python theme={null} import os from openai import OpenAI client = OpenAI( base_url="https://ai.salad.cloud/v1", api_key=os.environ["SALAD_AI_GATEWAY_API_KEY"], ) stream = client.chat.completions.create( model="qwen3.6-35b-a3b", messages=[{"role": "user", "content": "Write a short poem about distributed computing."}], stream=True, ) for chunk in stream: if chunk.choices[0].delta.content: print(chunk.choices[0].delta.content, end="", flush=True) ``` ## Step 5: Use the OpenAI JavaScript/TypeScript SDK ```bash theme={null} npm install openai ``` ```javascript theme={null} import OpenAI from 'openai' const client = new OpenAI({ baseURL: 'https://ai.salad.cloud/v1', apiKey: process.env.SALAD_AI_GATEWAY_API_KEY, }) const response = await client.chat.completions.create({ model: 'qwen3.6-35b-a3b', messages: [{ role: 'user', content: 'Hello from Salad AI Gateway!' }], }) console.log(response.choices[0].message.content) ``` ## Available Models | Model | Context Window | Best For | | :- | :- | :- | | `qwen3.6-35b-a3b` | 262,144 tokens | Complex reasoning, agentic tasks, coding | | `qwen3.6-27b` | 195,200 tokens | General purpose, balanced speed and capability | | `qwen3.5-35b-a3b` | 262,144 tokens | Cost-efficient agentic tasks | | `qwen3.5-9b` | 196,608 tokens | High-volume, simple queries | See the [Models Reference](/ai-gateway/reference/models) for full details. ## Next Steps * Browse [integration guides](/ai-gateway/integrations/overview) for agentic tools, IDEs, and frameworks * Read the [Models Reference](/ai-gateway/reference/models) for model capabilities and limits * Review [AI Gateway Pricing](/ai-gateway/reference/pricing) for input and output token rates * Check [AI Gateway Errors](/ai-gateway/reference/errors) for credit or access failures # Self-Onboard for Pay-Per-Token AI Gateway Source: https://docs.salad.com/ai-gateway/tutorials/pay-per-token-onboarding Create an organization-specific Salad AI Gateway API key and make your first pay-per-token request. *Last Updated: October 19, 2026* > Account, organization, credit, and key creation are user-facing Portal actions. Never ask the user to paste a key, > expose a copied value, or treat the regular SaladCloud API key as an AI Gateway credential. After onboarding, use > the [AI Gateway request runbook](/agents/ai-gateway/select-model-and-send-request). > [!WARNING] > > Salad AI Gateway is currently in **beta**. Pay-per-token access is self-service. Pay-per-token access is self-service. Each AI Gateway API key belongs to one user and one organization, and usage made with that key is billed to the organization's credit balance. ## Step 1: Create an Account and Organization 1. [Create a SaladCloud account](https://portal.salad.com) or sign in to your existing account. 2. Create an organization in the portal. If you need help, follow the [account setup guide](/general/tutorials/account-setup). 3. Open the organization you want to use with Salad AI Gateway. > [!NOTE] > > Gateway access is configured per user, per organization. If you use AI Gateway with more than one organization, create > a separate key for each organization. ## Step 2: Add Credits to the Organization AI Gateway pay-per-token usage draws from the selected organization's SaladCloud credit balance. In the organization, select **Billing & Usage** from the left navigation and add credits. The organization must have a positive credit balance before it can process AI Gateway requests. Credits are checked when each request is admitted. If credits run out during generation, requests already admitted are allowed to complete and are billed; new requests return `402 credits_exhausted` until the balance is positive. See [Billing](/general/explanation/billing) for instructions on adding credits and configuring auto recharge. ## Step 3: Create an AI Gateway API Key 1. Open the organization you want to bill for AI Gateway usage. 2. In the left navigation, select **AI Gateway**. 3. Click **Create API Key for _organization name_**. ![AI Gateway page with the button to create an API key for the selected organization](https://mintcdn.com/salad/QAO-8c9mRG5pxV9w/ai-gateway/images/create-ai-gateway-api-key.png?fit=max\&auto=format\&n=QAO-8c9mRG5pxV9w\&q=85\&s=482a67da81b0dcb8138e7363c611fb90) The key is associated with your user and the selected organization. Do not share it with other users. ## Step 4: Retrieve and Copy the Key 1. Select your username in the upper-right corner of the portal. 2. Select **API Access**. 3. Under **AI Gateway Keys**, find the organization you selected. 4. Click the copy icon next to the masked key. ![API Access page showing the Current API Key and organization-specific AI Gateway Keys](https://mintcdn.com/salad/QAO-8c9mRG5pxV9w/ai-gateway/images/api-access-ai-gateway-keys.png?fit=max\&auto=format\&n=QAO-8c9mRG5pxV9w\&q=85\&s=3964285d75e80fd1c639245c227f46f0) > [!NOTE] > > The **Current API Key** at the top of the page authenticates other SaladCloud APIs with the `Salad-Api-Key` header. It > does not authenticate AI Gateway requests. Use the organization-specific key listed under **AI Gateway Keys** as a > Bearer token. The API Access page shows only AI Gateway keys that you created. To reveal, regenerate, or delete a key, click **Manage** or return to that organization's **AI Gateway** page. Follow [Manage Your AI Gateway API Key](/ai-gateway/how-to-guides/manage-api-key) for expiration delays, deletion, and what happens when organization membership changes. ## Step 5: Store the Key Securely Store the copied key in an environment variable instead of hardcoding it in your application: ```bash theme={null} export SALAD_AI_GATEWAY_API_KEY="" ``` Do not commit the key to source control or expose it in client-side code. ## Step 6: Make Your First Request Send the AI Gateway key as a Bearer token to the OpenAI-compatible endpoint: ```bash theme={null} curl https://ai.salad.cloud/v1/chat/completions \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $SALAD_AI_GATEWAY_API_KEY" \ -d '{ "model": "qwen3.6-35b-a3b", "messages": [ {"role": "user", "content": "Say hello in one sentence."} ] }' ``` You should receive a JSON response containing the model's reply. Input and output tokens are billed to the organization at the [published pay-per-token rates](/ai-gateway/reference/pricing). ## Next Steps * Follow the [Getting Started guide](/ai-gateway/tutorials/getting-started) for Python, JavaScript, and streaming examples. * Review the [Models reference](/ai-gateway/reference/models) for model IDs and capabilities. * Browse [AI Gateway integrations](/ai-gateway/integrations/overview) for coding agents, IDEs, and frameworks. * Check [AI Gateway Errors](/ai-gateway/reference/errors) for credit or access failures. # SaladCloud CLI Overview Source: https://docs.salad.com/cli/explanation/overview Install the saladcloud command-line tool, log in, and manage container groups, job queues, transcription, and AI Gateway from a terminal, a script, a CI pipeline, or an AI agent. *Last Updated: November 12, 2026* > Run `saladcloud -o json ` instead of calling the API over raw HTTP. A failure is one JSON line on stderr > whose `hint` is the fix, and `saladcloud --help` is the reference. Setup belongs to the user: when a hint > says to run `saladcloud login`, ask the user to run it in their own terminal, and never ask for a key in the chat. > Read [Use the SaladCloud CLI with AI Agents](/cli/how-to-guides/use-with-ai-agents) before operating on an account. > [!WARNING] > > The SaladCloud CLI is in **beta**. Commands, flags, messages, exit codes, and JSON output may still change. Every > change is listed in the [changelog](https://github.com/SaladTechnologies/salad-cloud-cli/blob/main/CHANGELOG.md), and > bug reports are welcome on [GitHub](https://github.com/SaladTechnologies/salad-cloud-cli/issues/new/choose). These examples target **v0.1.0**. Check `saladcloud version` and the installed command's `--help`; the repository's `main` branch can include features that are not in the latest release yet. ## What is the SaladCloud CLI? The SaladCloud CLI is an open-source command-line tool that wraps the [SaladCloud API](/reference/api-usage). It lets you do from a terminal what you would otherwise do in the [Portal](https://portal.salad.com) or with hand-written API requests: deploy and update container groups, follow their logs, open a shell on a running instance, submit jobs to a queue, transcribe a recording, or check your AI Gateway key. The CLI behaves the same whether a person, a shell script, a CI pipeline, or an AI coding agent runs it: * **Every command works without prompts.** Anything the CLI asks for at a terminal can also be given as a flag or an environment variable. * **Every command exits with a documented code**, so a script can tell "not found" from "authentication failed" without parsing text. * **Resource and action results support `--output json`.** Logs stream JSON lines; SSH sessions, shell completion, and help retain their native output. In JSON mode an error is a single JSON object on stderr, with an `error.hint` that suggests a fix when one is available. The source code and releases are on [GitHub](https://github.com/SaladTechnologies/salad-cloud-cli), under the MIT license. ## What You Can Do with It | Area | Commands | What they cover | | :- | :- | :- | | Setup and account | `login`, `logout`, `use`, `whoami`, `doctor`, `config`, `orgs`, `quotas` | Save and switch your API key, organization, and project; diagnose setup problems; read your quotas | | GPUs and capacity | `gpus`, `availability` | List GPU classes with their price per priority tier; estimate how many nodes could run a replica right now | | Container groups | `container-groups` (alias `cg`) | Create, list, inspect, update, scale, start, stop, and delete container groups; restart, recreate, or reallocate instances | | Logs | `logs`, `container-groups logs` | Query or follow application logs and system events for an organization, a project, or one container group | | Remote access | `container-groups ssh`, `container-groups cp`, `container-groups sftp`, `ssh-key` | Open a shell on a running instance and copy files to or from it | | Job queues | `queues`, `queues jobs` | Create job queues, and submit, list, and cancel jobs | | Inference and transcription | `inference`, `inference jobs`, `inference transcribe`, `inference transcription-lite` | List managed inference endpoints, queue jobs on them, and transcribe a file or URL in one step | | AI Gateway | `ai-gateway` | Save and test an AI Gateway key, and list the models the gateway serves | | Webhooks | `webhook-secret` | Print or rotate the secret that signs your organization's webhook deliveries | | Coding agents | `agent init`, `changelog` | Tell a coding agent how to use the CLI, and let it catch up on what changed between releases | A few things are still done in the Portal: creating your account, organizations, and projects; billing; creating API keys and AI Gateway keys; and registering your SSH public key. ## Before You Start You need a SaladCloud account, an organization, and a billing method with credits. Without credits you cannot create or start container groups, or use any other SaladCloud service. [Account Setup](/general/tutorials/account-setup) walks through all three. Every organization starts with a project named `default`. ## Install ```bash macOS and Linux theme={null} curl -fsSL https://raw.githubusercontent.com/SaladTechnologies/salad-cloud-cli/main/install.sh | sh ``` ```powershell Windows (PowerShell) theme={null} irm https://raw.githubusercontent.com/SaladTechnologies/salad-cloud-cli/main/install.ps1 | iex ``` The install script downloads the newest release for your machine, verifies it against the release's checksums, and installs the `saladcloud` binary: * On macOS and Linux, to `~/.local/bin`. The script tells you if that folder is not on your `PATH`. * On Windows, to `%LOCALAPPDATA%\Programs\saladcloud`, which the script adds to your user `PATH`. If `saladcloud` is not found after installation on macOS or Linux, add the default install folder to your current bash or zsh session, and put the same line in your shell's startup file: ```bash theme={null} export PATH="$HOME/.local/bin:$PATH" ``` Prebuilt binaries cover Linux (amd64 and arm64), macOS (Apple silicon and Intel), and Windows (amd64, which also runs on Windows 11 on ARM under emulation). Confirm the install. This prints the version and commit, which you will want in any bug report: ```bash theme={null} saladcloud version ``` To update to a newer release later, run the install command again. > [accordion] Pin a version or change the install folder > > Both install scripts read the same environment variables. `SALAD_CLI_VERSION` pins a release, and > `SALAD_CLI_INSTALL_DIR` chooses the folder. > > ```bash macOS and Linux theme={null} > curl -fsSL https://raw.githubusercontent.com/SaladTechnologies/salad-cloud-cli/main/install.sh | SALAD_CLI_VERSION=v0.1.0 sh > ``` > > ```powershell Windows (PowerShell) theme={null} > $env:SALAD_CLI_VERSION = 'v0.1.0' > irm https://raw.githubusercontent.com/SaladTechnologies/salad-cloud-cli/main/install.ps1 | iex > ``` > > Pinning a version is a good idea in CI while the CLI is in beta. > [accordion] Download a release manually > > The archives and `checksums.txt` are attached to each > [release](https://github.com/SaladTechnologies/salad-cloud-cli/releases). Every archive carries a build provenance > attestation, which you can check with the GitHub CLI: > > ```bash theme={null} > gh attestation verify ./saladcloud_v0.1.0_linux_amd64.tar.gz --repo SaladTechnologies/salad-cloud-cli > ``` > > Replace the filename with the archive you downloaded for your platform. This requires a GitHub CLI version that > provides `gh attestation verify`. > [accordion] Install with Go > > With Go 1.26 or later, on any platform Go supports: > > ```bash theme={null} > go install github.com/saladtechnologies/salad-cloud-cli/cmd/saladcloud@latest > ``` ## Log In ```bash theme={null} saladcloud login ``` `login` asks for three things and checks each against the API before saving anything: 1. **Your API key.** The input is hidden. Pressing Enter at the prompt opens the Portal's [API key page](https://portal.salad.com/api-key) in your browser. The key is your user's key, and it works for every organization you are a member of. 2. **Your organization.** If you belong to several, `login` shows a numbered list. 3. **Your project.** `default` is offered unless you saved a different one before. Organizations and projects are always named by their **URL names**, the segments in `https://portal.salad.com/organizations//projects/`, not the display names the Portal shows. `saladcloud orgs list` shows both names for each of your organizations. The key is saved in a config file in your user profile, and the CLI never prints it in full: tables and JSON output show only its last four characters. Run `saladcloud config path` to locate the file. It stores credentials as plain text, not in an encrypted keychain; keep it out of repositories, shared artifacts, and chat. `saladcloud logout` removes the saved SaladCloud API key, but does not revoke it or clear a key supplied through `SALAD_API_KEY`. The AI Gateway key has its own `saladcloud ai-gateway logout` command. Three commands are useful right after logging in: ```bash theme={null} # Show the key (masked), organization, and project in effect, and where each value came from saladcloud whoami # Switch to another organization and project saladcloud use my-org/my-project # Check the config file, API access, key, organization, and project, with a fix for anything that fails saladcloud doctor ``` > [!TIP] > > Scripts and CI pipelines skip `login` and set `SALAD_API_KEY`, `SALAD_ORGANIZATION`, and `SALAD_PROJECT` instead. See > [Usage and Automation](/cli/how-to-guides/usage-and-automation#authenticate-without-logging-in). Two features need one more step in the Portal: * SSH need an SSH public key registered to your account. Run `saladcloud ssh-key setup`, which finds or generates a local key and prints it with the link to register it. * **`saladcloud ai-gateway test`** needs an AI Gateway key, which is separate from your SaladCloud API key. Create one as described in [Manage Your AI Gateway API Key](/ai-gateway/how-to-guides/manage-api-key), then run `saladcloud ai-gateway login`. ## Deploy Your First Container Group These commands deploy a small public image that logs a line every 5 seconds, read its logs, and delete it. They work the same in bash, zsh, and PowerShell. ```bash theme={null} # List GPU classes with prices saladcloud gpus list # Deploy a container group: a busybox image that logs a line every 5 seconds saladcloud container-groups create my-first-group --image docker.io/library/busybox:1.36 --cpu 1 --memory 1024 --priority batch --wait --timeout 15m -- sh -c 'while true; do echo hello from SaladCloud; sleep 5; done' # Check its status, instance counts and, if it failed, the reason saladcloud container-groups get my-first-group # Follow its logs (Ctrl-C to stop) saladcloud container-groups logs my-first-group -f # Delete it saladcloud container-groups delete my-first-group ``` > [!NOTE] > > A container group is billed while it runs, so delete or stop the ones you are done with. `delete` acts immediately, > with no confirmation prompt. A deleted group's name is never released, so give each new group a new name. If the wait > fails or times out, the group may still exist: inspect it and stop or delete it when you are done. ## How Commands Are Structured The grammar is the same across the whole CLI, so once you know one command you can guess the rest: * **A resource noun always takes a verb:** `saladcloud gpus list`, `saladcloud orgs get my-org`. * **The thing a command acts on is its one positional argument, and its parents are flags:** `saladcloud container-groups instances restart -c my-app` restarts one instance of the group `my-app`. * **`cg` is short for `container-groups`:** `saladcloud cg list` lists your container groups. * **Common flags control output and scope:** `-o table|json|yaml` chooses the output format where supported, and `--debug` prints each API request on stderr. `--org` and `--project` override saved context only on commands that use that scope. Organization-scoped commands such as `gpus` and `inference` reject `--project`; `ai-gateway` commands reject both. Check the command's `--help` before adding scope flags. Every command has `--help` with its full flags and examples. A mistyped command or flag gets a suggestion for the nearest match, and a command line in the wrong shape gets the corrected command as a hint. ## Shell Completion Enable Tab autocompletion for CLI commands, flags, and resource names. Add the command below to your shell startup file to enable it in every new terminal session. ```bash bash (~/.bashrc) theme={null} source <(saladcloud completion bash) ``` ```bash zsh (~/.zshrc) theme={null} source <(saladcloud completion zsh) ``` ```bash fish (~/.config/fish/config.fish) theme={null} saladcloud completion fish | source ``` ```powershell PowerShell ($PROFILE) theme={null} saladcloud completion powershell | Out-String | Invoke-Expression ``` ## Get Help and Report Problems * `saladcloud doctor` diagnoses setup and connectivity problems, and prints a fix for each check that does not pass. * `--debug` on any command prints one line per API request on stderr. `--debug=body` adds headers and bodies, with credentials redacted. * `saladcloud changelog` prints the changelog built into the binary. * For a crash, a wrong exit code, or output that contradicts `--help`, [open an issue](https://github.com/SaladTechnologies/salad-cloud-cli/issues/new/choose) with the output of `saladcloud version`, the exact command, and the error. Never paste an API key. * For account, billing, or workload problems, as opposed to CLI bugs, [contact support](/support). ## Uninstall ```bash macOS and Linux theme={null} curl -fsSL https://raw.githubusercontent.com/SaladTechnologies/salad-cloud-cli/main/uninstall.sh | sh ``` ```powershell Windows (PowerShell) theme={null} irm https://raw.githubusercontent.com/SaladTechnologies/salad-cloud-cli/main/uninstall.ps1 | iex ``` The uninstall script removes the `saladcloud` binary and, on Windows, its folder from your user `PATH`. Your config file, which holds your saved API keys, is kept so that a reinstall picks up where you left off. Set `SALAD_CLI_PURGE=1` to remove it too. If you installed into a custom folder, set the same `SALAD_CLI_INSTALL_DIR` when uninstalling. An installation made with Go or a manual download needs its binary removed from that installation's location instead. If you added a `saladcloud completion` line to a shell startup file, remove it yourself. ## Next Steps > [card] [Usage and Automation](/cli/how-to-guides/usage-and-automation) > > Deploy, update, inspect, and debug container groups, then run the same commands unattended in scripts and CI. > [card] [Use with AI Agents](/cli/how-to-guides/use-with-ai-agents) > > Set up Claude Code, Codex, Cursor, or another coding agent to operate SaladCloud through the CLI. > [card] [CLI Guide on GitHub](https://github.com/SaladTechnologies/salad-cloud-cli/blob/main/docs/guide.md) > > The full guide: every create flag, update semantics, logs, job queues, exit codes, and the JSON contract. > [card] [Command Reference](https://github.com/SaladTechnologies/salad-cloud-cli/blob/main/docs/commands.md) > > Every command at a glance, with its aliases. # Everyday Usage and Automation with the SaladCloud CLI Source: https://docs.salad.com/cli/how-to-guides/usage-and-automation Deploy, update, inspect, and debug container groups with the saladcloud CLI, then run the same commands unattended in scripts and CI using environment variables, JSON output, and exit codes. *Last Updated: November 12, 2026* > Use `-o json` on every command and branch on the exit code, not on message text. Read the `warning:` and `note:` > lines on stderr after any write. `container-groups delete`, `stop`, scaling down, and instance restarts need the > user's explicit go-ahead. See [Use the SaladCloud CLI with AI Agents](/cli/how-to-guides/use-with-ai-agents). This guide covers the commands you will use most with the SaladCloud CLI, and then how to run them unattended in a shell script or a CI pipeline. It assumes you have [installed the CLI and logged in](/cli/explanation/overview). The examples use placeholder names: `my-app` for a container group, `ghcr.io/me/app` for an image, and `my-org` for an organization. Container group commands are written out as `saladcloud container-groups`; `saladcloud cg` is the same command. Replace image names and media URLs with resources you can access, and create any named input files before running a command. The shell scripts and `jq` examples below use bash and require `jq`. Deployment, queued work, transcription, and AI Gateway completions can incur charges; stop or delete temporary groups after testing. > [!WARNING] > > The CLI is in **beta**, so commands, flags, exit codes, and JSON output may still change. In automation, pin the CLI > version and read the [changelog](https://github.com/SaladTechnologies/salad-cloud-cli/blob/main/CHANGELOG.md) before > you upgrade. ## Everyday Usage ### Check Prices and Capacity Before You Deploy ```bash theme={null} # GPU classes and their price per priority tier saladcloud gpus list # How many nodes could run one replica with these requirements right now saladcloud availability --gpu "RTX 4090 (24 GB)" --cpu 8 --memory 16384 # Your organization's container group quotas saladcloud quotas get ``` `availability` takes the requirements of one replica: `--gpu` (a GPU class name or ID, repeated for several classes), `--cpu`, `--memory` in MB, `--storage` in GB, and `--country`. Each query is expensive for the platform, so run it once before a deployment rather than in a loop. The counts are estimates, and a row of all zeros can mean the availability service is overloaded rather than that no nodes exist; the CLI prints a warning when that may be the case. ### Deploy a Container Group `container-groups create` builds a container group from flags, from a definition file, or from a copy of an existing group. **From flags.** This is the quickest way to deploy an image: ```bash theme={null} saladcloud container-groups create my-app --image ghcr.io/me/app:v1 --gpu "RTX 3060 (12 GB)" --cpu 4 --memory 8192 --replicas 3 --port 8080 -e MODE=prod --wait ``` * Fields you do not set get defaults: 1 vCPU, 1024 MB of memory, 1 replica, a restart policy of `always`, and the group starts as soon as it is created. * `--port` exposes one container port through the [Container Gateway](/container-engine/explanation/infrastructure-platform/networking). Requests to the group's URL must then carry a SaladCloud API key in the `Salad-Api-Key` header; add `--no-auth` to make the URL public. * `--wait` blocks until the group is `running` and exits non-zero if it fails, stops, or does not get there before `--timeout` (10 minutes by default). * Words after `--` replace the image's `ENTRYPOINT` and `CMD` together, for example `-- python app.py --port 8080`. **From a definition file.** A file can carry everything the API accepts, including the settings that have no flag, such as [health probes](/container-engine/explanation/infrastructure-platform/health-probes) and registry credentials for a private image. The file is JSON or YAML with the API's field names: ```yaml web.yaml theme={null} name: my-web container: image: ghcr.io/me/web:v1 resources: cpu: 2 memory: 4096 replicas: 1 restart_policy: always networking: protocol: http port: 8080 auth: true readiness_probe: http: path: /health port: 8080 scheme: http headers: - name: Accept value: application/json initial_delay_seconds: 0 period_seconds: 5 timeout_seconds: 2 success_threshold: 1 failure_threshold: 3 ``` ```bash theme={null} # Create the group as the file describes it saladcloud container-groups create -f web.yaml --wait # Use the file as a base and override parts of it: flags always win over the file saladcloud container-groups create my-web-two -f web.yaml --replicas 2 -e DEBUG=1 ``` The CLI rejects a field it does not recognize and names the path, with a suggestion when it looks like a misspelling, so a typo in a file never deploys silently. **From an existing group.** `--from` copies a group in the same organization, which is useful for trying a new image next to the running version: ```bash theme={null} saladcloud container-groups create my-app-v2 --from my-app --image ghcr.io/me/app:v2 ``` Registry credentials are not copied, because the API never returns them. A copy of a group that uses a private image needs them again, in a `-f` file under `container.registry_authentication`. > [!NOTE] > > A deleted container group's name is never released. Creating a group with a name that was ever used in the project > fails with `name_conflict`, so give each new group a new name. ### Inspect Container Groups and Instances ```bash theme={null} # Every container group in the project, with running instances against replicas saladcloud container-groups list # One group: status, instance counts, and the platform's reason if it failed or stopped saladcloud container-groups get my-app # The group's instances, with each one's state, image download progress, and readiness saladcloud container-groups instances list -c my-app ``` Add `-w` to `list`, `get`, or `instances list` to redraw the table every few seconds until you press Ctrl-C. A group reads `running` as soon as any instance's container runs, whether or not it is passing its readiness probe yet. `instances list` shows the `READY` state of each instance. ### Update, Scale, Start, and Stop ```bash theme={null} # Roll out a new image saladcloud container-groups update my-app --image ghcr.io/me/app:v2 # Change resources saladcloud container-groups update my-app --cpu 4 --memory 8192 --gpu "RTX 4090 (24 GB)" # Set one environment variable; the group's other variables are kept saladcloud container-groups update my-app -e LOG_LEVEL=debug # Change the replica count saladcloud container-groups scale my-app --replicas 5 # Stop the group, and start it again later saladcloud container-groups stop my-app saladcloud container-groups start my-app --wait ``` `update` and `scale` wait for the change to settle before they return, then compare the result with what you asked for. If the API changed or ignored part of your request, they print a `warning:` or `note:` line on stderr. If the platform rejects the change, for example because the registry does not serve the new image tag, the command exits with code 6 and the platform's reason, and the group keeps running what it had. In v0.1.0, **settled does not mean rolled out or ready**: the group's configuration can be accepted while instances still run its previous version or are starting. Inspect `container-groups instances list -c my-app` and test your application before sending traffic to it. `--wait` on create or start waits for the group to be `running`, not for every replica to pass its readiness probe. Do not use an unreleased flag from the repository's `main` branch unless your installed CLI's `--help` lists it. Three behaviors are worth knowing before you update a group that is serving traffic: * **A change to the image, command, environment variables, probes, or gateway settings restarts every instance.** Each instance downloads the new image again, and old and new versions never run side by side. To avoid downtime, deploy the new version as a second group with `create --from`, check it, and switch your clients over. See [Deployment Strategies](/container-engine/how-to-guides/deployment-strategies). * **A new private image needs its registry credentials again.** Pass them in a `-f` file together with `--image`. * **Setting the replica count puts [scheduled scaling](/container-engine/how-to-guides/autoscaling/time-of-day-scaling) on hold.** `scale --replicas --keep-schedule` sets the count and switches the schedule back on. To change a setting that has no flag, save a minimal patch containing only that setting. For example, save this as `patch.json` to restore the image's own command: ```json patch.json theme={null} { "container": { "command": [] } } ``` ```bash theme={null} saladcloud container-groups update my-app -f patch.json ``` Patch files use the API's update schema. Omitted settings are left alone, arrays are replaced, and a patch file's `container.environment_variables` replaces the entire set; use `-e` to preserve other environment variables. Only use `null` where the [update schema](/reference/saladcloud-api/container-groups/update-container-group) permits clearing a field. > [!WARNING] > > In v0.1.0, `container-groups get my-app --writable` can drop an HTTP probe's `headers` when that list is empty. Do not > apply that export unchanged. Prefer a minimal patch; if you include a probe, supply its required fields and headers > according to the update schema. Exports also include `replicas`; omit it unless you intend to set the replica count. > The empty-list fix is listed in the CLI's > [changelog](https://github.com/SaladTechnologies/salad-cloud-cli/blob/main/CHANGELOG.md). ### Read Logs and System Events ```bash theme={null} # The last hour of one container group's logs saladcloud container-groups logs my-app --since 1h # Follow new entries until Ctrl-C saladcloud container-groups logs my-app -f # Only errors, across every container group in a project saladcloud logs --project production --severity error # Only system events: allocation, image download, start, probes, and exits saladcloud container-groups logs my-app --since 1h --query 'resource.type != "container"' ``` Without `--since`, a query covers the last 15 minutes. It prints the newest 1,000 entries in the range by default; `--limit` changes that. `--filter` matches a substring, and `--query` takes a raw [log query](/container-engine/reference/log-queries). `saladcloud logs` with no flags searches the whole organization. Only an explicit `--project` or `-c ` narrows it; your saved default project does not. Every log query counts against your organization's and your account's [daily log query limits](/container-engine/explanation/container-groups/container-logs#daily-log-query-limits). `-f` runs at least one query every 5 seconds by default, and more when the container logs a lot, so leave it running only while you watch, or set a longer `--poll-interval`. ### Open a Shell or Copy Files SSH access needs a public key registered to your account. Do this once: ```bash theme={null} saladcloud ssh-key setup ``` The command finds or generates a local key and prints it with the Portal page where you register it. Then: ```bash theme={null} # Open a shell on a running instance saladcloud container-groups ssh my-app # Run one command saladcloud container-groups ssh my-app -- nvidia-smi # Copy a file up, and a directory's contents back down saladcloud container-groups cp ./input.json my-app:/data/input.json saladcloud container-groups cp -r my-app:/data/output/. ./output ``` Without `--instance `, these commands use the group's first running instance and say which one on stderr. See [SSH and Terminal Access](/container-engine/explanation/container-groups/ssh-and-terminal) for what the image needs. > [!NOTE] > > A one-shot `ssh -- ` exits with code 1 even when the command succeeded, because the SaladCloud relay > does not pass exit codes back. In a script, have the remote command print a line you can check for. `cp` exit codes > are reliable. ### Debug a Container That Will Not Start Start with the system events, which show each instance being allocated, downloading the image, starting, and exiting with its exit code: ```bash theme={null} saladcloud container-groups logs my-app --since 1h --query 'resource.type != "container"' ``` If the container exits as soon as it starts, keep it up without its entrypoint and run the entrypoint by hand: ```bash theme={null} saladcloud container-groups update my-app -- sleep 2147483647 saladcloud container-groups ssh my-app ``` `sleep 2147483647` is used because `sleep infinity` fails in BusyBox-based images. When you are done, put the image's own command back by sending a patch file that contains `{"container": {"command": []}}`: ```bash theme={null} saladcloud container-groups update my-app -f patch.json ``` The [Troubleshooting](/container-engine/how-to-guides/troubleshooting) guide covers the common causes. ### Job Queues, Transcription, and AI Gateway The CLI also covers the other SaladCloud services. Each has `--help` with the full set of flags. ```bash theme={null} # Job queues: create a queue, connect a new group to it, and submit a job saladcloud queues create my-queue saladcloud container-groups create my-worker --image ghcr.io/me/worker:v1 --queue my-queue --queue-port 8080 --queue-path /job saladcloud queues jobs create --queue my-queue --input '{"prompt": "hello"}' --wait # Transcription: upload a local file, wait, and print the transcript saladcloud inference transcribe ./meeting.mp3 # Transcription Lite, with subtitles for a file that is already on the web saladcloud inference transcription-lite https://example.com/talk.mp4 --srt # AI Gateway: save a key, list the models, and send one test completion saladcloud ai-gateway login saladcloud ai-gateway models list saladcloud ai-gateway test --prompt "say hello" ``` * A queue connection is set when a group is created and cannot be changed later. The image must run the [job queue worker](/container-engine/how-to-guides/job-processing/queue-worker) next to your application. Give the group a readiness probe in a `-f` file as well, so that the worker takes jobs only once your server is listening. * `inference transcribe` uploads a local file to [S4](/storage/explanation/overview) and deletes the upload once the transcript is back. Transcription is billed by audio length; see [Transcription](/transcription/explanation/overview). A failed or timed-out job can leave the upload in S4; read the diagnostic for its path and clean it up once no job needs it. `--no-wait` and `--keep-upload` also retain the file. Do not share signed media URLs. * `ai-gateway login` and `ai-gateway test` each send one billed request to check the key. The [AI Gateway](/ai-gateway/explanation/overview) uses its own key, not your SaladCloud API key. ## Automation Everything above works unattended. A script or pipeline needs three things from the CLI: credentials that do not come from a prompt, output it can parse, and a reliable signal of success or failure. ### Authenticate Without Logging In Set these environment variables instead of running `saladcloud login`: | Variable | What it sets | | :- | :- | | `SALAD_API_KEY` | Your SaladCloud API key | | `SALAD_ORGANIZATION` | The organization's URL name | | `SALAD_PROJECT` | The project's URL name | | `SALAD_AI_GATEWAY_API_KEY` | The AI Gateway key, only for the `ai-gateway` commands | | `SALAD_CLI_NO_PROMPT` | Set to any value so that the CLI never prompts, even if it has a terminal | | `SALAD_CLI_CONFIG_DIR` | The folder that holds the config file, to isolate a job from saved logins | An environment variable wins over the value saved in the config file, and a flag (`--org`, `--project`) wins over both. Scope flags are accepted only where applicable: `inference` uses `--org`, not `--project`, and `ai-gateway` accepts neither. AI Gateway billing follows its key's organization. A saved project is ignored when you select a different organization; set the project explicitly for that organization. * **Always set `SALAD_PROJECT`.** When nothing sets a project, the CLI uses `default` and prints a warning on stderr. In an organization with several projects, a script that relies on that fallback can act on the wrong one. * **The CLI does not prompt when `CI` is set**, which GitHub Actions, GitLab CI, and most other CI systems do for you. Elsewhere, set `SALAD_CLI_NO_PROMPT=1` if your runner gives commands a terminal. * **Store the key as a secret.** It grants access to everything your user can reach, in every organization you belong to. Consider a dedicated member account for automation; the API key section of [Build with AI Agents](/general/tutorials/build-with-ai-agents) explains why and how. `saladcloud whoami` shows which value is in effect for each setting and where it came from, without printing the key. ### Parse JSON Output Add `-o json` to any command: ```bash theme={null} # The name and status of every container group in the project saladcloud container-groups list -o json | jq -r '.items[] | "\(.name)\t\(.current_state.status)"' # How many instances of a group are running saladcloud container-groups get my-app -o json | jq '.current_state.instance_status_counts.running_count' # The hostname of a group's Container Gateway URL saladcloud container-groups get my-app -o json | jq -r '.networking.dns' ``` What a script can rely on: * **One JSON document for resource and action results.** A list is `{"items": [...]}`. `logs` prints one JSON object per line as entries arrive. SSH and SFTP sessions retain remote output; `ssh --config`, shell completion, and help print text instead of JSON. * **Every key is always present.** A list or map the API left out is empty (`[]`, `{}`), and `null` means the value is unknown or not set. * **The exit code determines success.** Waiting writes (`create --wait`, `update`, `scale`) withhold their result until the wait succeeds. Other commands can print output before failing: `doctor` prints its check results even when a check fails, and a log stream or SSH session can fail after producing output. * **stderr carries `warning:` and `note:` lines**, and the error document if the command fails. Keep the two streams apart: do not pipe `2>&1` into a JSON parser. * **Keys are snake_case**, with two exceptions on a container group that the API spells with hyphens: `scaling-actions` and `scheduled-scaling-enabled`. In `jq`, write them as `.["scaling-actions"]`. ### Handle Exit Codes and Errors | Exit code | Meaning | | :- | :- | | 0 | Success | | 1 | General error: an API server error, a wait that timed out, a group or job that failed, or Ctrl-C | | 2 | Usage error: the command line cannot be parsed, such as an unknown flag or a missing argument | | 3 | Authentication failed, or no API key was found | | 4 | Not found | | 5 | Rate limited, after the CLI's own retries | | 6 | Invalid input: a value breaks a platform rule, a file cannot be read, or a change was rejected | | 7 | Network error: no response from the API | | 10 | Not available: the AI Gateway declined the request for billing reasons | `container-groups ssh`, `cp`, and `sftp` are the exception: they exit with the code of the underlying `ssh` or `sftp` process. With `-o json`, a failed command prints one JSON object as the last line of stderr: ```json theme={null} { "error": { "exit_code": 4, "kind": "not_found", "message": "...", "hint": "...", "http_status": 404 } } ``` `message` states the problem and `hint` states the fix; `hint` is `null` when there is none. `kind` comes from a fixed set, such as `auth`, `not_found`, `invalid_input`, `wait_timeout`, and `group_failed`, so a script can branch on it. The full list is in the [CLI guide](https://github.com/SaladTechnologies/salad-cloud-cli/blob/main/docs/guide.md#error-kinds). This snippet reads a group's status and handles the two outcomes a deploy script usually cares about: ```bash theme={null} if out=$(saladcloud container-groups get my-app -o json 2>err.log); then code=0 else code=$? fi case $code in 0) echo "my-app is $(echo "$out" | jq -r '.current_state.status')" ;; 4) echo "my-app does not exist yet" ;; *) tail -n 1 err.log | jq -r '.error | "\(.kind): \(.message)\nhint: \(.hint)"' >&2 exit "$code" ;; esac ``` > [!NOTE] > > Check the exit code, not the output. A command with no resource to return, such as `delete`, prints a document with > `"ok": true`, but `ok` is never `false`: a failure is always a non-zero exit code with the error document on stderr. ### Example: A Deploy Script This script rolls out a new image. It creates the group from a definition file the first time it runs, and updates the image on every run after that. Save the `web.yaml` definition above beside `deploy.sh` and run the script from that directory. Adapt the port and readiness probe to your application, and pass a complete image reference that has already been pushed to its registry. ```bash deploy.sh theme={null} #!/usr/bin/env bash set -uo pipefail GROUP="my-app" IMAGE="${1:?usage: deploy.sh }" saladcloud container-groups get "$GROUP" -o json >/dev/null code=$? case $code in 0) # The group exists: roll out the new image. update waits for the change to settle # and exits 6 if the platform rejects the image. saladcloud container-groups update "$GROUP" --image "$IMAGE" --timeout 5m -o json ;; 4) # The group does not exist: create it from the definition file, with this image. saladcloud container-groups create "$GROUP" -f web.yaml --image "$IMAGE" --wait --timeout 15m -o json ;; *) echo "could not read $GROUP; run 'saladcloud doctor' to check the setup" >&2 exit "$code" ;; esac ``` The script exits with the exit code of the `update` or `create` command, because that command is the last one it runs. For example, run `bash deploy.sh ghcr.io/my-org/my-app:v2` with your own image reference. A successful update verifies the accepted configuration, not application readiness; check the instances and application afterward. If the image is in a private registry, add a `-f` file with `container.registry_authentication` to the `update` command as well. ### Example: GitHub Actions This manually triggered workflow installs a pinned CLI and updates an **existing** group. Store the API key as a repository secret named `SALAD_API_KEY`, replace the organization, project, and group names, and supply an image that has already been built and pushed. It does not build an image or create a missing group. Private images also need registry credentials supplied securely to the update command. ```yaml .github/workflows/deploy.yml theme={null} name: Deploy to SaladCloud on: workflow_dispatch: inputs: image: description: Full image reference already pushed to its registry required: true type: string permissions: contents: read jobs: deploy: runs-on: ubuntu-latest env: SALAD_API_KEY: ${{ secrets.SALAD_API_KEY }} SALAD_ORGANIZATION: my-org SALAD_PROJECT: production IMAGE: ${{ inputs.image }} steps: - name: Install the SaladCloud CLI env: SALAD_CLI_VERSION: v0.1.0 run: | curl -fsSL https://raw.githubusercontent.com/SaladTechnologies/salad-cloud-cli/v0.1.0/install.sh | sh echo "$HOME/.local/bin" >> "$GITHUB_PATH" - name: Check credentials and scope run: saladcloud doctor - name: Roll out the new image run: saladcloud container-groups update my-app --image "$IMAGE" --timeout 5m ``` * GitHub Actions sets `CI`, so the CLI never prompts. * `saladcloud doctor` fails the job early, with a hint, if the key, organization, or project is wrong. A missing AI Gateway key or SSH key does not fail it. * The `update` step fails the job if the platform rejects the new image, for example because the tag was never pushed. Success does not establish that every replica runs the new version or that the application is ready for traffic. ### What Surprises Scripts * **`delete` is immediate and unconfirmed.** There is no prompt and no dry run, so guard destructive steps in your own code. * **Names are single-use.** A pipeline that creates a group per run needs a unique name each time, for example with the commit SHA as a suffix. Names are 2 to 63 characters: lowercase letters, digits, and hyphens, starting with a letter. * **A wait that times out does not undo anything.** The group keeps deploying on SaladCloud. Check it with `container-groups get` and `instances list`; do not blindly repeat a create or other write. A timed-out job submission or AI Gateway completion may also have succeeded and incurred charges. Reconcile the existing resource or job before retrying, and never automatically repeat an uncertain billed completion. * **`-w` is for people.** `--watch` redraws a table and cannot be combined with `-o json`. In a script, use `--wait`, or poll `get -o json` yourself. * **`update --no-wait` skips verification.** It returns before the change settles, so nothing checks that the API applied what you asked for. ## Further Reading * The [CLI guide](https://github.com/SaladTechnologies/salad-cloud-cli/blob/main/docs/guide.md) on GitHub documents every create flag, update and merge-patch behavior, scheduled scaling, and the complete JSON and exit code contracts. * The [notes](https://github.com/SaladTechnologies/salad-cloud-cli/blob/main/docs/notes.md) list CLI and platform behavior that tends to surprise people. * [Use the SaladCloud CLI with AI Agents](/cli/how-to-guides/use-with-ai-agents) covers running the CLI from a coding agent. # Use the SaladCloud CLI with AI Agents Source: https://docs.salad.com/cli/how-to-guides/use-with-ai-agents Set up Claude Code, Codex, Cursor, or another coding agent to deploy and operate SaladCloud through the saladcloud CLI: agent init, credentials that stay out of the chat, JSON output, exit codes, and guardrails. *Last Updated: November 12, 2026* > If you are an agent reading this page: run `saladcloud -o json ` instead of raw HTTP, and use > `saladcloud --help` as the reference. A failure is one JSON line on stderr; act on its `hint`. Setup > belongs to the user: when a hint says to run `saladcloud login`, `saladcloud ai-gateway login`, or > `saladcloud ssh-key setup`, ask the user to run it in their own terminal, and never ask for a key in the chat. Pass > `--org`, and `--project` where a command takes it, instead of running `use` or `config set`. If a name is not found, > ask the user which one; never pick from a list. Read the `warning:` and `note:` lines on stderr after every write. > `container-groups delete` is immediate and unconfirmed, so confirm with the user first. Then follow the [Agent > Operations Overview](/agents/overview) for authorization, retry, and verification rules. A coding agent that can run shell commands can deploy and operate SaladCloud for you through the [SaladCloud CLI](/cli/explanation/overview). This guide shows how to set that up so that the agent knows how to use the CLI, never handles your API key in the conversation, and asks before it does anything destructive or billable. It builds on two other parts of the documentation: * [Build with AI Agents](/general/tutorials/build-with-ai-agents) covers the SaladCloud skills, the documentation MCP server, and what an API key lets an agent do. Read its API key section before you give any agent access. * [Agent Operations](/agents/overview) holds the runbooks an agent follows: which sources to trust, which actions need your go-ahead, and how to verify a change. > [!WARNING] > > The CLI is in **beta**, so commands, flags, exit codes, and JSON output may still change. An agent can read what > changed with `saladcloud changelog`. ## Why Give an Agent the CLI An agent can call the SaladCloud API directly, but the CLI removes most of the ways that goes wrong: * **One command per task, with built-in documentation.** `saladcloud --help` lists the flags and examples for the installed version, so the agent does not have to rely on what it remembers. * **Errors say how to fix them.** With `-o json`, a failure is one JSON object on stderr whose `hint` field is the next step. * **Exit codes separate the cases an agent must treat differently:** bad input, a missing resource, an authentication problem, a rate limit, a network failure. * **Writes check themselves.** `create`, `update`, and `scale` compare what the API did with what was asked for and print a `warning:` or `note:` line when they differ. * **The API key stays out of the conversation.** The agent runs commands that read a saved key; no command prints it. Resource output is not automatically safe to share: logs, container environment variables, job input/output, and transcripts can contain secrets or private data. Redact them before including them in a conversation or bug report. ## Step 1: Install the CLI and Log In Yourself Setup is your job, not the agent's. [Install the CLI](/cli/explanation/overview#install), then log in from your own terminal: ```bash theme={null} saladcloud login ``` `login` saves your API key, organization, and project in a config file in your user profile. From then on, any `saladcloud` command the agent runs on that machine uses the saved key, and you never paste the key into a chat, a prompt, or a file in the repository. If the agent should also open SSH sessions or copy files, or use the AI Gateway, do those setup steps yourself too: ```bash theme={null} # Find or generate a local SSH key and print it with the Portal page where you register it saladcloud ssh-key setup # Save an AI Gateway key (sends one billed request to check it) saladcloud ai-gateway login ``` For an agent that runs somewhere without your login, such as a cloud sandbox or a CI job, provide `SALAD_API_KEY`, `SALAD_ORGANIZATION`, and `SALAD_PROJECT` as secret environment variables instead. See [Authenticate Without Logging In](/cli/how-to-guides/usage-and-automation#authenticate-without-logging-in). > [!WARNING] > > Keeping the key out of the chat is not the same as limiting what the agent can do. The key grants access to every > organization, project, and container group your user can reach, and an agent with a shell on your machine acts with > that access. The saved config contains the key in plain text, so an agent with filesystem access may still read it. To > limit access, give the agent a dedicated member account's key and set your organization's > [quotas](/container-engine/reference/quotas) deliberately, as described in [Build with AI > Agents](/general/tutorials/build-with-ai-agents). ## Step 2: Add the SaladCloud Section to Your Project Coding agents can read project instruction files, such as `CLAUDE.md` for Claude Code or `AGENTS.md` for tools that support it. Other tools may use different filenames. `agent init` writes a short SaladCloud section into the selected file. Run it in your project's root folder: ```bash theme={null} saladcloud agent init ``` The section tells the agent: * How workloads run on SaladCloud: as container groups on interruptible nodes, with ephemeral local disk and one port reachable through the Container Gateway. * To use `saladcloud -o json ` rather than raw HTTP, to act on an error's `hint`, and what each exit code means. * That setup belongs to you. When a command says to run `saladcloud login`, the agent asks you to run it in your own terminal, and it never asks for a key in the chat. * To pass `--org` and `--project` on each command rather than change your saved settings, and to ask you when a name is not found rather than pick one from a list. * To read the warnings after a write, and to confirm with you before `container-groups delete`. * To test ports, probes, and authentication locally before deploying, and how to debug a container that fails at startup. * To install the SaladCloud skills before any non-trivial work. The command never calls the API and needs no credentials, and the section contains no account information, so the file is safe to commit. Which file it writes: | Situation | File written | | :- | :- | | You pass `--file ` | That file | | The command is run by Claude Code (it sets `CLAUDECODE`) | `CLAUDE.md` | | The folder has a `CLAUDE.md` and no `AGENTS.md` | `CLAUDE.md` | | Anything else | `AGENTS.md` | If you use more than one agent in the same project, run the command once for each file: ```bash theme={null} saladcloud agent init --file AGENTS.md saladcloud agent init --file CLAUDE.md ``` Other options: ```bash theme={null} # Preview the section without writing anything saladcloud agent init --print # Write into another project saladcloud agent init --dir ../my-other-project ``` The section sits between `` and `` markers. Running the command again replaces the section in place and leaves the rest of the file alone, so run it again after you upgrade the CLI to pick up the current text. Check which instruction files your agent actually loads. For a tool that uses a different file, pass its path with `--file`; a generated file only helps when the agent reads it. ## Step 3: Install the SaladCloud Skills The section that `agent init` writes carries only facts that stay true between releases. Detailed, task-specific guidance lives in the SaladCloud skills, which the section tells the agent to install. Installing them yourself lets you choose which skills and which agents: ```bash theme={null} npx skills add https://docs.salad.com ``` [Build with AI Agents](/general/tutorials/build-with-ai-agents#install-the-saladcloud-skills) lists the skills and shows how to add the documentation MCP server. The skills and the [Agent Operations](/agents/overview) runbooks describe each task in terms of API operations. Their rules about what to read first, when to stop and ask, and how to verify a change apply in the same way when the agent carries out those operations with CLI commands. ## Step 4: Make Sure the CLI Never Waits for Input A few setup commands, such as `login`, prompt when they are run at a terminal. Some agent tools run commands under a pseudo-terminal, where a prompt would wait for an answer that never comes. Set `SALAD_CLI_NO_PROMPT` in the agent's environment so that the CLI never prompts and instead fails with a hint that says what to do: ```bash theme={null} export SALAD_CLI_NO_PROMPT=1 ``` Where you set it depends on the agent. In Claude Code, for example, add it to the project's settings file: ```json .claude/settings.json theme={null} { "env": { "SALAD_CLI_NO_PROMPT": "1" } } ``` ## Step 5: Tell the Agent Which Organization and Project to Use Give the agent the organization and project by their URL names, either in your prompt or in the project instruction file. The agent then passes them on each command: ```bash theme={null} saladcloud container-groups list --org my-org --project staging -o json ``` This keeps the agent from changing the organization and project saved on your machine, and makes each command's target visible when you review what the agent ran. If an agent works on one project only, you can instead set `SALAD_ORGANIZATION` and `SALAD_PROJECT` in its environment. Use scope flags only where the command's help supports them. `inference` is organization-scoped and rejects `--project`. `ai-gateway` rejects both flags and bills the organization associated with its separate Gateway key. > [!NOTE] > > When nothing sets a project, the CLI uses the project named `default` and prints a warning. In an organization with > several projects, always name the project so that the agent does not act on `default` by accident. ## Decide What the Agent May Do Without Asking Most agent tools let you allow some commands and require approval for others. A reasonable split for the SaladCloud CLI: | Policy | Commands | | :- | :- | | Allow | Read-only commands: `whoami`, `doctor`, `version`, `changelog`, `logs`, `container-groups logs`, `quotas get`, `ai-gateway models list`, and the `list` and `get` verbs of `orgs`, `gpus`, `container-groups`, `container-groups instances`, `queues`, `queues jobs`, `inference`, and `inference jobs` | | Ask first: starts or adds cost | `container-groups create`, `container-groups start`, `container-groups scale` to a higher count, `queues jobs create`, `inference jobs create`, `inference transcribe`, `inference transcription-lite`, `ai-gateway test` | | Ask first: interrupts or removes work | `container-groups delete`, `container-groups stop`, `container-groups scale` to a lower count, `container-groups update`, `container-groups instances restart`, `recreate`, and `reallocate`, `queues delete`, `queues jobs cancel`, `inference jobs cancel` | | Ask first: reaches into a container | `container-groups ssh`, `container-groups cp`, `container-groups sftp` | | Do it yourself | `login`, `logout`, `use`, `config set`, `ai-gateway login`, `ssh-key setup`, `webhook-secret get`, `webhook-secret rotate` | Three commands deserve particular care: * **`container-groups delete` is immediate and unconfirmed.** The CLI has no prompt and no dry run, and a deleted group's name can never be used again in that project. * **`container-groups update` restarts every instance** when it changes the image, command, environment variables, probes, or gateway settings. * **`availability` is read-only but expensive for the platform.** An agent should run it once before a deployment, not in a loop. ## Try It With the setup done, start your agent in the project and give it a task that names the organization, the project, and where it must stop. For example: ```text theme={null} Using the saladcloud CLI in organization my-org, project default: deploy docker.io/library/busybox:1.36 as a container group named agent-demo-1 with 1 vCPU, 1024 MB of memory, and batch priority, running a loop that prints a line every 5 seconds. Wait until it is running, show me its last few log lines, and then ask me before you delete it. ``` An agent that has read the SaladCloud section runs commands like these: ```bash theme={null} # Confirm what the CLI will use, without printing the key saladcloud whoami -o json # Deploy and wait until the group is running saladcloud container-groups create agent-demo-1 --org my-org --project default --image docker.io/library/busybox:1.36 --cpu 1 --memory 1024 --priority batch --wait -o json -- sh -c 'while true; do echo hello from SaladCloud; sleep 5; done' # Read the logs saladcloud container-groups logs agent-demo-1 --org my-org --project default --since 5m -o json # Only after you say yes saladcloud container-groups delete agent-demo-1 --org my-org --project default -o json ``` A container group is billed while it runs, so make sure the task ends with the group deleted or stopped. ## What the Agent Sees Knowing what the CLI gives the agent helps you read a session and write better instructions. **Results.** With `-o json`, resource and action commands print a JSON document on stdout, and a list is `{"items": [...]}`. Logs stream JSON lines; SSH/SFTP sessions, shell completion, and help keep their native output. A waiting write such as `create --wait` prints its result only after the wait succeeds, but `doctor` can print results and still fail. Always check the exit code. In v0.1.0, a successful `update` means the configuration settled, not that every instance runs the new version or passes its readiness probe. **Errors.** A failed command prints one JSON object as the last line of stderr and exits with a non-zero code. This is what the agent gets when no API key is available: ```json theme={null} { "error": { "exit_code": 3, "kind": "auth", "message": "no API key set", "hint": "run saladcloud login in a terminal, or set SALAD_API_KEY", "http_status": null } } ``` An agent that follows the SaladCloud section does not try to fix this itself. It stops and asks you to run `saladcloud login` in your own terminal. **Exit codes.** `1` is a general error, `2` a usage error, `3` an authentication failure, `4` not found, `5` rate limited, `6` invalid input, `7` a network error, and `10` an AI Gateway billing refusal. The [exit code table](/cli/how-to-guides/usage-and-automation#handle-exit-codes-and-errors) has the details. **Warnings and notes.** After a write, the CLI reports on stderr anything the API changed or ignored, as `warning:` and `note:` lines. These never contain a secret: an environment variable's value is described as `(set)` or `(changed)`, not printed. **Timeouts and uncertain results.** A timeout or interrupted wait does not cancel work already accepted by SaladCloud. Inspect the named group or returned job ID before retrying. Do not automatically repeat a job submission or Gateway completion whose outcome is uncertain; it can create duplicate work or another charge. > [!NOTE] > > A one-shot `saladcloud container-groups ssh -- ` exits with code 1 even when the command succeeded, > because the SaladCloud relay does not pass exit codes back. The SaladCloud section tells the agent about this; if you > write your own instructions, mention it so that the agent checks the command's output instead. ## Keep the Agent Up to Date The CLI changes between releases, and an agent may have learned an older version. Two commands close the gap without network access: ```bash theme={null} # What changed since a version or a date saladcloud changelog --since 0.1.0 saladcloud changelog --since 2026-11-01 # The flags and examples of the installed version saladcloud container-groups create --help ``` After you upgrade the CLI, run `saladcloud agent init` again in each project to refresh the SaladCloud section. ## Report Problems If the CLI misbehaves during an agent session, for example a crash, a wrong exit code, or output that contradicts `--help`, the SaladCloud section tells the agent to say so and offer to draft a bug report. Reports go to the CLI's [issue tracker](https://github.com/SaladTechnologies/salad-cloud-cli/issues/new/choose), with the output of `saladcloud version`, the exact command, and the error line from stderr. Check that the report contains no credentials before you submit it. For gaps in this documentation or in the skills, use the documentation MCP server's feedback tool or the [support page](/support). # YOLOv8 Source: https://docs.salad.com/container-engine/explanation/ai-machine-learning/computer-vision-overview *Last Updated: October 10, 2024* In this guide, we will go through deploying YOLOv8 applications using SaladCloud . ## **What is Yolo?** YOLO, which stands for "You Only Look Once," is a revolutionary technology in the field of computer vision, specifically in object detection. It is renowned for its exceptional speed and accuracy. Unlike traditional object detection methods that process an image in multiple steps, YOLO does it in a single pass. This unique approach enables YOLO to identify and classify various objects in an image or video frame quickly. ## **What's new in YOLOv8?** YOLOv8 stands out in the realm of computer vision for several compelling reasons, making it a top choice for your next project: **High Accuracy Metrics:** YOLOv8 demonstrates exceptional accuracy, as evidenced by its performance on benchmarks like COCO and Roboflow 100. For instance, the YOLOv8m model achieves a notable 50.2% mean Average Precision (mAP) on COCO. **Developer-Friendly Features:** The model is packed with features that significantly ease the development process. This includes an intuitive Command Line Interface (CLI) and a well-structured Python package, streamlining tasks that were previously more fragmented. **Strong Community Support:** With a large and growing community around YOLO, especially YOLOv8, users benefit from extensive support and resources. This community presence is invaluable for obtaining guidance and sharing best practices. **Superior Performance in Diverse Scenarios:** When tested against Roboflow 100, which evaluates performance across various domain-specific tasks, YOLOv8 shows a substantial improvement over its predecessor, YOLOv5. **Simplified Model Training and Usage:** YOLOv8's design philosophy prioritizes ease of use. Unlike other models where tasks are dispersed across multiple Python files, YOLOv8 consolidates these processes, making model training and execution more straightforward. **Rich Resource Availability:** Despite being relatively new, YOLOv8 is supported by an array of online guides and tutorials, making it accessible for both beginners and experienced practitioners in computer vision. In summary, YOLOv8 is not only technically advanced but also user-centric, offering a blend of high accuracy, ease of use, and robust community support, making it an excellent choice for diverse computer vision applications. Now let's deploy YOLOv8 solution on Salad # Image Generation On SaladCloud Source: https://docs.salad.com/container-engine/explanation/ai-machine-learning/image-generation-overview How to deploy an image generation service on SaladCloud *Last Updated: January 8, 2026* SaladCloud is the perfect platform for deploying image generation services. We power some of the most popular image generation sites on the internet, like [Civitai](https://blog.salad.com/civitai-salad/) and [Blend](https://blog.salad.com/blend-salad/). We've [done the math](https://blog.salad.com/stable-diffusion-v1-5-benchmark/) and found that SaladCloud is the [most cost-effective](https://blog.salad.com/stable-diffusion-xl-sdxl-benchmark/) way to deploy image generation services at scale. ## High Level Regardless of your choice of stable diffusion inference server, models, or extensions, the basic process is as follows: 1. Get a docker image that runs your inference server 2. Copy any models and extensions you want into the docker image 3. Enable some way to access your container group, either through the container gateway, or a job queue. 4. Push the new image up to a container registry 5. Deploy the image as a SaladCloud container group ## Validated Docker Images Here are some popular stable diffusion inference servers that we’ve verified work on Salad. > **Note that you will be interacting with these as an API, and not through their browser user interface.** 1. ComfyUI with ComfyUI API 1. Guide: [ComfyUI Deployment](/container-engine/how-to-guides/ai-machine-learning/deploy-stable-diffusion-comfy) 2. Git Repo: [https://github.com/SaladTechnologies/comfyui-api](https://github.com/SaladTechnologies/comfyui-api) 3. Docker Image: `ghcr.io/saladtechnologies/comfyui-api:comfy0.7.0-api1.16.1-torch2.8.0-cuda12.8-runtime` 4. Model Directory: `/opt/ComfyUI/models` 5. Custom Node Directory: `/opt/ComfyUI/custom_nodes/` ## Container Gateway or Job Queue? When deploying your stable diffusion inference server, you have two options for how to access it: 1. **Container Gateway**: This is the easiest way to access your container group. 1. It can be enabled during container group creation, and maps a public https URL to a specific IPv6 port in your container. 2. You can optionally enable auth, which then requires your SaladCloud API Token to access the container group. 3. Only requires your server to listen on IPv6, no additional binary. 4. SaladCloud's Container Gateway uses least-connection load balancing, so you can scale your container group up or down without needing to change the URL. 5. Completed image generations are returned to the client in the response. 6. However, it is **not suitable for long-running tasks**, as the container gateway will time out after 100 seconds, a hard limit imposed by Cloudflare on idle connections. For most image generation workloads, this is not a problem, as generations typically take under 30s. 7. **Does Not Retry Failed Requests**: If a request fails, the client must retry the request. 8. Excess load will result in failed requests, as the container gateway will not queue requests. 2. **Job Queue**: This is a more resilient way to access your container group. 1. You can submit jobs to a queue, and the container group will process them in order. 2. You must add a binary to your container image that connects the job queue to your inference server. 3. High utilization of the container group will result in longer queue times, but no failed requests. 4. **Retries Failed Requests**: If a request fails, the job queue will retry the request 3 times. 5. **Long-Running Tasks**: The job queue is suitable for long-running tasks, as it does not have a timeout. 6. **Fully asynchronous**: Completed jobs are not returned to the client, but instead must be fetched from the job queue, or received by a webhook. There are several factors you should consider when choosing between the two options: 1. **How predictable is load?** Scaling services with many gigabytes of models can not be done instantly, so if you expect sudden spikes in traffic, you may want to use a job queue. On the other hand, if you have very predictable load, the container gateway is easier to use, and you can simply scale your container group up or down as needed with about an hour of lead-time. 2. **How long do you expect your tasks to take?** Most image generation tasks take just a few seconds on a powerful GPU, but if you have a particularly complex multi-modal workflow, and are using older, less expensive GPUs, you may end up with generation times approaching the cloudflare timeout limit of 100s. 3. **What is the cost structure for your client application?** If you are using a serverless architecture, you should check to see if you are billed for CPU time, or clock time for your function execution. If you are billed for clock time, you will likely want to use the job queue, as you will not be billed for time spent waiting in the queue. If you are billed for CPU time, there will be little difference between the two options. ## Hardware Requirements The hardware requirements for your stable diffusion inference server will depend on the type of model you are running, and to some extent your choice of inference server. * For models based on Stable Diffusion 1.5, you can get by with as little as 8GB of VRAM, and at least 8GB of system RAM. If you are using multiple LoRAs, ControlNets, etc, you may need more VRAM and system RAM. The only way to be certain is to measure real-world performance. * For models based on Stable Diffusion XL, you will need at least 12GB of VRAM, and 24GB if you intend to use the refiner. You will need at least 24GB of system RAM. * For models based on Flux1 (fp8 or nf4), you will want 16-24GB of VRAM and 24GB of system RAM. * For models based on Stable Diffusion 3.5, you will want 16GB of VRAM and 24GB of system RAM. ## Warming up your server In most situations, the first request to an inference server will be significantly slower than subsequent requests. This is because the server must load the model into VRAM, and establish its internal kv cache. For this reason, it is often desirable to send a dummy request to the server before sending real requests. For Salad, this can be done conveniently via the Startup Probe in the container group configuration. You set the startup probe as a `curl` command that submits an inference request to the server. This results in the server being warmed up before it is added to the load balancer, and can result in a significant performance improvement. # LLM Inference on SaladCloud Source: https://docs.salad.com/container-engine/explanation/ai-machine-learning/llm-overview How to deploy a LLM service on SaladCloud *Last Updated: April 2, 2026* > [!TIP] > > **Don't want to manage infrastructure?** [Salad AI Gateway](/ai-gateway/explanation/overview) gives you direct access > to powerful open-source models through a single OpenAI-compatible endpoint - no container groups, no replicas, no cold > starts. It's the fastest way to start using LLMs on SaladCloud. # Key Considerations To run LLM on SaladCloud, several key decisions need to be made first: **Model:** There are many LLM models available, open-source or proprietary, in various sizes, precisions and formats. The LLM inference typically requires a significant amount of VRAM, not just for the model parameters, but also for the KV-Cache during inference, which is heavily influenced by the batch size and context length. Models like 7B, 8B and 9B, as well as quantized 13B and 34B, can run smoothly on a GPU with 24GB of VRAM on SaladCloud, while larger models are not recommended. **Inference Server:** Several inference servers are available for running LLM models, including vLLM, TGI, Ollama, TensorRT-LLM, RayLLM, LMDeploy and llama.cpp. These servers differ in various aspects, including supported models, VRAM usage and efficiency, performance, throughput and additional features; and you should choose one that best meets your needs. Most of these servers provide container images that can be run directly on SaladCloud without modification. However, you can also create a custom wrapper image based on official images to add features like an I/O worker or model preloading. Alternatively, you can build your own inference server tailored to specific requirements. **Service Access:** If you need to provide real-time and on-demand chat services, deploying a container group with a container gateway is the easiest approach. However, if the requirement is to build a batch processing system where millions of prompts are processed without the need for immediate responses, a container group integrated with a job queue offers a more resilient and cost-effective solution. # VRAM Usage LLM inference consists of two stages: prefill and decode. In the prefill stage, the model processes the input prompt, computing their embeddings. In the decode stage, the model generates one token at a time conditioning on the prompt and all previously generated tokens. VRAM usage during LLM inference is primarily driven by the model parameters and the KV-Cache. The KV-Cache stores the key/value embeddings of the input prompt and all previously generated tokens. These embeddings are computed once and retained in memory for reuse during the decode stage of inference, which can significantly speed up the process. As the context length (encompassing both the input prompt and generated text) and batch size (the number of input prompts processed simultaneously) increase, the VRAM consumption of the KV-Cache can grow significantly. For example, with [LLaMA 3.1 8B Instruct](https://huggingface.co/meta-llama/Meta-Llama-3.1-8B-Instruct) in 16-bit precision, the model parameters alone require approximately 16 GB of VRAM. The KV-Cache, for a batch size of 1 and a context length of 4096, uses about 2 GB of VRAM. Therefore, a GPU with 24 GB of VRAM can handle batched inference with around: * A batch size of 16 and a context length of 1024 * A batch size of 8 and a context length of 2048 * A batch size of 4 and a context length of 4096 * A batch size of 1 and a context length of 16384 Processing too many requests simultaneously with excessively long context lengths can cause a node to run out of VRAM, forcing the inference process to use RAM instead. This shift can significantly degrade performance or result in errors. Most inference servers provide options to manage the VRAM usage, including **MAX_INPUT_TOKENS** (the maximum prompt length that users can send), **MAX_TOTAL_TOKENS** (the maximum context length including both input prompt and generated text) and **MAX_BATCH_TOTAL_TOKENS** (the maximum context length multiplied by the maximum batch size). Given the sensitivity of LLM to VRAM, **these parameters must be carefully planned, tested and configured to meet service requirements and prevent VRAM exhaustion during inference.** # Performance and Throughput There are two key performance indicators for measuring the performance of LLM inference on a node: **Time to First Token (TTFT):** the speed of prefill, as nothing can be generated before the embeddings of input prompt is computed. This determines the waiting time for users to see the first generated token. **Time Per Output Token (TPOT):** the decoding speed, the number of generated tokens per unit time after prefill. This affects the overall processing time to provide the entire generated text. Typically, the prefill stage is brief because the prompt is processed in parallel. However, the decode stage takes much longer since tokens are generated one at a time. For the same context length, the longer the generated text, the greater the total processing time. Here is the test data for Llama 3.1 8B Instruct using Hugging Face's TGI, from a PC equipped with an RTX 3090 running Windows WSL: * Processing Time = TPOT x Number of Generated Tokens * Throughput = 1 / TPOT * Total Time = TTFT + Processing Time | Context Length: 16384, Batch Size: 1 | Prefill: TTFT | Decode: TPOT | Decode: Processing Time | Decode: Throughput | Total Time | | :- | :- | :- | :- | :- | :- | | Input Prompt: 1024, Generated Text: 15360 | 245.98 ms | 22.33 ms | 342955 ms | 44.78 tokens/sec | 343201 ms | | Input Prompt: 4096, Generated Text: 12288 | 934.13 ms | 22.66 ms | 278377 ms | 44.14 tokens/sec | 279312 ms | | Input Prompt: 8192, Generated Text: 8192 | 1943.71 ms | 23.06 ms | 188904 ms | 43.36 tokens/sec | 190848 ms | Longer context lengths not only increase waiting time and negatively impact user experience, but may also lead to the server response timeout errors at the load balancer in front of the inference servers, which has a maximum timeout limit of 100 seconds. Enabling token streaming on the servers allows tokens to be returned one by one, rather than waiting for the entire response to be generated. This feature shows the generation progress in real-time, significantly enhancing the user experience, and helping to avoid the timeout errors. When more VRAM is available, batched inference can significantly increase throughput by effectively leveraging GPU cache and parallel processing, while only slightly increasing the processing time. Here is the test data from the same PC: | Context Length: 4096 (2048+2048) | Prefill: TTFT | Decode: TPOT | Decode: Processing Time | Decode: Throughput | Total Time | | :- | :- | :- | :- | :- | :- | | Batch Size 1 | 459.07 ms | 21.15 ms | 43288 ms | 47.29 tokens/sec | 43746 ms | | Batch Size 2 | 882.91 ms | 22.35 ms | 45756 ms | 89.47 tokens/sec | 46639 ms | | Batch Size 3 | 1326.06 ms | 23.06 ms | 47553 ms | 129.14 tokens/sec | 48880 ms | | Batch Size 4 | 1731.33 ms | 23.96 ms | 49046 ms | 166.94 tokens/sec | 50778 ms | Compared to batched inference, concurrent inference using multiprocessing or multithreading on a single GPU might limit optimal GPU cache utilization and significantly impact performance, and is generally not recommended. This occurs because each inference process operates independently, reducing the efficiency of GPU resource usage. Additionally, multiprocessing consumes more VRAM, as each process requires its own CUDA context and loads a separate instance of the model into GPU VRAM for inference. Many inference servers have a local queue to buffer requests and also support the continuous or dynamic batching. This means that, upon completing a request within a batch, the server can automatically add a new request from the queue to the batch and continue the inference process. These configurations can be managed using parameters such as **MAX_CONCURRENT_REQUESTS** (the number of requests handled simultaneously, or the queue length) and **MAX_BATCH_SIZE** (the number of requests grouped together for a batched inference). **These parameters must be carefully planned, tested and configured to increase throughput, enhance user experiences and avoid system errors.** Typically, MAX_CONCURRENT_REQUESTS should be larger than MAX_BATCH_SIZE to effectively buffer the burst traffic, but if set too high, it can cause more requests to accumulate in the local queue of the inference servers, potentially increasing waiting time of users and leading to timeout errors at the load balancer due to prolonged delays in responding to these requests. Requests exceeding the MAX_CONCURRENT_REQUESTS limit (or the local queue length) will be rejected by the servers as a backpressure mechanism. **Client applications interacting with the inference servers should incorporate traffic control and retry logic to enhance resilience.** # Container Gateway or Job Queue? ## Container Gateway Deploying a container group with a container gateway (load balancer) is the simplest approach for providing real-time and on-demand services on SaladCloud. The inference server on each instance should listen on **an IPv6 port**, and the container gateway can map a public URL to this IPv6 port. Optionally, you can enable authentication to access the URL using an API token. To support LLM inference efficiently, the container gateway can be configured to use the Least Connections algorithm and forward concurrent requests to the inference servers in a container group. The server response timeout setting controls how long the container gateway will wait for a response from an instance after sending a request, with a maximum limit of 100 seconds. This timeout affects the maximum length of generated text (for non-streaming) and the number of requests that can queue locally on inference servers. For more information on load balancing options and how to adjust these settings to fit your needs, please refer to [this guide](/container-engine/explanation/gateway/load-balancer-options). **To use this solution effectively, system requirements and capabilities should be clearly defined and planned to properly configure the inference servers.** Deploying the Readiness Probes is also essential to ensure that requests are only forwarded to containers when they are ready. Additionally, the client applications should implement retries and traffic control mechanisms to further enhance system resilience. Currently, all container instances, regardless of their locations, are centrally exposed by the load balancer in the U.S. While this setup is optimal for instances running in America, it may introduce additional latency for instances in other regions. However, this is generally acceptable given that LLM inference normally takes much longer (tens of seconds) than this. If applications are latency-sensitive and require local access, consider using open-source tools or services like ngrok, and implementing your own load balancer in the relevant regions. ## Job Queue A container group integrated with a job queue offers a more resilient and cost-effective solution for batch processing systems where immediate responses are not required. You can submit millions of jobs to a job queue, which could be Salad JQ or AWS SQS. Instances with an I/O worker and the inference server, will then pull and process the jobs, subsequently uploading the generated texts to predefined locations, such as cloud storage or a webhook. The job queue features a large buffer for queuing requests and includes built-in retry logic. If an instance does not complete a job within a specified time, the job becomes available to other instances for processing. Each instance pulls new jobs only after finishing the existing ones, eliminating the need for mechanisms like backpressure, retries, and traffic control in both the inference servers and client applications. **To implement this solution, you need to build a wrapper image that adds an I/O worker to the inference server.** This worker will be responsible for pulling jobs, calling the inference server, uploading the generated texts and finally returning job results or status to the job queue. ## Build Your Own Queue Several customers have successfully implemented a Redis-based, flexible and platform-independent queue for LLM applications on SaladCloud, demonstrating the following advantages: * Supports both asynchronous and synchronous calls, with results provided in streaming or non-streaming modes. * Enables regional deployment to ensure local access and minimize latency. * More resilient to burst traffic, node failures, and the variability in AI inference times, while allowing easy customization for specific applications. Please refer to [this guide](/container-engine/how-to-guides/job-processing/build-redis-queue) for more details. # Local Deployment To SaladCloud Before deploying an image of these inference servers on SaladCloud, we recommend testing it in a local environment first. Troubleshooting and fine-tuning parameters in the cloud can be time-consuming and complex. For local deployment and testing, focus on the following objectives: * Ensure everything is functioning as expected. * Monitor resource usage, including CPU, RAM, GPU, and VRAM, to inform resource allocation on SaladCloud. * Test system behaviors with different parameters and finalize the configuration settings. An ideal testing environment is a Windows PC with an NVIDIA GPU, WSL2 and Docker Desktop installed. If you don't have access to this setup, you can perform a similar test on SaladCloud using the interactive shell (refer to Scenario 3) before proceeding with a full deployment. Let's use LLaMA 3.1 8B Instruct and Hugging Face's TGI inference server as examples to guide the deployment and testing process for different scenarios. Once the local testing is complete, we can easily translate the local deployment settings to the configurations on SaladCloud. ## Scenario 1: Use environment variables to supply the working parameters to the TGI server. ``` # Define the environment variables in the host (WSL2). # The token is needed for authorized users to download private models or those that require agreement to terms of use on Hugging Face. # The volume is to map a host folder to the container, allowing the model to be stored persistently and preventing the need to download it every time the container is run. ubuntu@server:~$ token=hf_XXXXXXXXXXXXXXXXXXXXXXXX ubuntu@server:~$ volume=/home/ubuntu/.cache/huggingface ubuntu@server:~$ model=meta-llama/Meta-Llama-3.1-8B-Instruct # Run the latest TGI image. # Pass environment variables to the container. # Map port 8080 on the host to the port 80 in the container. # The '--shm-size' option is not required if using only one GPU. ubuntu@server:~$ docker run -it --rm --gpus all -p 8080:80 -v $volume:/data \ -e HF_TOKEN=$token \ -e HF_HUB_ENABLE_HF_TRANSFER=0 \ -e MODEL_ID=$model \ -e HOSTNAME=0.0.0.0 \ -e PORT=80 \ -e MAX_TOTAL_TOKENS=4096 \ -e MAX_INPUT_TOKENS=2048 \ -e MAX_CONCURRENT_REQUESTS=8 \ -e MAX_BATCH_SIZE=4 \ ghcr.io/huggingface/text-generation-inference:latest # Test the health check from the host. ubuntu@server:~$ curl -i http://127.0.0.1:8080/health HTTP/1.1 200 OK vary: origin, access-control-request-method, access-control-request-headers access-control-allow-origin: * content-length: 0 date: Tue, 03 Sep 2024 02:30:38 GMT # Test the inference from the host. ubuntu@server:~$ curl http://127.0.0.1:8080/v1/chat/completions -X POST -d '{ "model": "meta-llama/Meta-Llama-3.1-8B-Instruct", "messages": [ { "role": "system", "content": "You are a good guy!" }, { "role": "user", "content": "How to learn AI and Machine Learning?" } ], "stream": false, "max_tokens": 512 }' -H 'Content-Type: application/json' # Test the inference (token streaming)from the host. ubuntu@server:~$ curl http://127.0.0.1:8080/v1/chat/completions -X POST -d '{ "model": "meta-llama/Meta-Llama-3.1-8B-Instruct", "messages": [ { "role": "system", "content": "You are a good guy!" }, { "role": "user", "content": "How to learn AI and Machine Learning?" } ], "stream": true, "max_tokens": 512 }' -H 'Content-Type: application/json' # Enter the container and do some check. ubuntu@server:~$ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES b9d7aeb218a8 ghcr.io/huggingface/text-generation-inference:latest "/tgi-entrypoint.sh" 4 minutes ago Up 4 minutes 0.0.0.0:8080->80/tcp infallible_dewdney ubuntu@server:~$ docker exec -it b9d /bin/bash root@b9d7aeb218a8:/usr/src# root@b9d7aeb218a8:/usr/src# curl -i http://localhost:80/health HTTP/1.1 200 OK vary: origin, access-control-request-method, access-control-request-headers access-control-allow-origin: * content-length: 0 date: Tue, 03 Sep 2024 02:35:39 GMT # To use the container gateway on SaladCloud, the server must be configured to listen on an IPv6 port. # Change the HOSTNAME from '0.0.0.0' to '::' for using IPv6 ubuntu@server:~$ docker run -it --rm --gpus all -p 8080:80 -v $volume:/data \ -e HF_TOKEN=$token \ -e HF_HUB_ENABLE_HF_TRANSFER=0 \ -e MODEL_ID=$model \ -e HOSTNAME=:: \ -e PORT=80 \ -e MAX_TOTAL_TOKENS=4096 \ -e MAX_INPUT_TOKENS=2048 \ -e MAX_CONCURRENT_REQUESTS=8 \ -e MAX_BATCH_SIZE=4 \ ghcr.io/huggingface/text-generation-inference:latest # Enter the container and test the inference and the health check. # Both '[::1]' and 'localhost' can be used to access the local IPv6 port. root@a4ecfb06bab4:/usr/src# curl -i http://[::1]:80/health HTTP/1.1 200 OK vary: origin, access-control-request-method, access-control-request-headers access-control-allow-origin: * content-length: 0 date: Tue, 03 Sep 2024 03:03:57 GMT root@a4ecfb06bab4:/usr/src# curl -i http://localhost:80/health HTTP/1.1 200 OK vary: origin, access-control-request-method, access-control-request-headers access-control-allow-origin: * content-length: 0 date: Tue, 03 Sep 2024 03:04:40 GMT root@a4ecfb06bab4:/usr/src# curl http://[::1]:80/v1/chat/completions -X POST -d '{ "model": "meta-llama/Meta-Llama-3.1-8B-Instruct", "messages": [ { "role": "system", "content": "You are a good guy!" }, { "role": "user", "content": "How to learn AI and Machine Learning?" } ], "stream": true, "max_tokens": 512 }' -H 'Content-Type: application/json' ``` Here are the corresponding configurations on SaladCloud: ``` # Image Source ghcr.io/huggingface/text-generation-inference:latest # Replica Count 3+ for test and 5+ for production # Resource # Based the local test, 4 vCPUs and 12 GB of RAM are sufficient, and the GPU must have 24 GB of VRAM. # You can choose multiple GPU types simultaneously. 4 vCPUs, 12GB Memory GPU with 24GB of VRAM, RTX 3090/3090Ti/4090 # Environment Variables HF_TOKEN ******************** HF_HUB_ENABLE_HF_TRANSFER 0 MODEL_ID meta-llama/Meta-Llama-3.1-8B-Instruct HOSTNAME :: PORT 80 MAX_TOTAL_TOKENS 4096 MAX_INPUT_TOKENS 2048 MAX_CONCURRENT_REQUESTS 8 MAX_BATCH_SIZE 4 # Container Gateway # The port must match the IPv6 port used by the server. Enabled, Port 80 # Readiness Probe # The probe is essential to ensure that requests are only forwarded to containers when they are ready. # Both '[::1]' and 'localhost' can be used to access the local IPv6 port. Enabled Protocol: exec Command: python Argument1: -c Argument2: import requests,sys;sys.exit(0 if requests.get('http://localhost:80/health').status_code == 200 else -1) Initial Delay Seconds: 300 Period Seconds: 10 Timeout Seconds: 5 Success Threshold: 1 Failure Threshold: 3 ``` ![](https://mintcdn.com/salad/pEBrSzH4UQRtJw00/container-engine/images/llm-general1.jpg?fit=max\&auto=format\&n=pEBrSzH4UQRtJw00\&q=85\&s=502b3d6a9e8e693dcf070539344566e7) You don't need to add double or single quotes in the Argument 2 of Command for Readiness on SaladCloud Portal: ![](https://mintcdn.com/salad/pEBrSzH4UQRtJw00/container-engine/images/llm-general2.jpg?fit=max\&auto=format\&n=pEBrSzH4UQRtJw00\&q=85\&s=0f42cf3134f4bd9482264f5655306812) After the instances are running and have passed the readiness probes, we can perform some test using the generated access domain name: ``` # Test the health check curl -i https://pomelo-turnip-ztmw72fai31is8bp.salad.cloud/health # Test the inference curl https://pomelo-turnip-ztmw72fai31is8bp.salad.cloud/v1/chat/completions -X POST -d '{ "model": "meta-llama/Meta-Llama-3.1-8B-Instruct", "messages": [ { "role": "system", "content": "You are a good guy!" }, { "role": "user", "content": "How to learn AI and Machine Learning?" } ], "stream": false, "max_tokens": 512 }' -H 'Content-Type: application/json' # Test the inference(token streaming) curl https://pomelo-turnip-ztmw72fai31is8bp.salad.cloud/v1/chat/completions -X POST -d '{ "model": "meta-llama/Meta-Llama-3.1-8B-Instruct", "messages": [ { "role": "system", "content": "You are a good guy!" }, { "role": "user", "content": "How to learn AI and Machine Learning?" } ], "stream": true, "max_tokens": 512 }' -H 'Content-Type: application/json' ``` ## Scenario 2: Override both the ENTRYPOINT and CMD in the image to start the TGI server. Sometimes, we can configure the TGI server to start with additional parameters using specific values without needing to pass many environment variables. SaladCloud offers the option to override the ENTRYPOINT and CMD in the image, which easily accommodates this requirement. ``` # Override both the ENTRYPOINT and CMD in the image. # Start the TGI server with additional parameters using specific values and environment variables. # The environment variables MAX_TOTAL_TOKENS and MAX_INPUT_TOKENS can be removed, because these parameters are explicitly provided when starting the TGI server. ubuntu@server:~$ docker run -it --rm --gpus all -p 8080:80 -v $volume:/data \ -e HF_TOKEN=$token \ -e HF_HUB_ENABLE_HF_TRANSFER=0 \ -e MODEL_ID=$model \ -e HOSTNAME=:: \ -e PORT=80 \ -e MAX_TOTAL_TOKENS=4096 \ -e MAX_INPUT_TOKENS=2048 \ -e MAX_CONCURRENT_REQUESTS=8 \ -e MAX_BATCH_SIZE=4 \ --entrypoint 'sh' \ ghcr.io/huggingface/text-generation-inference:latest -c 'text-generation-launcher --model-id $MODEL_ID --max-total-tokens 4096 --max-input-tokens 2048' ``` Here is the corresponding configuration to override both the ENTRYPOINT and CMD in the image on SaladCloud: ``` # Command Command: sh Argument1: -c Argument2: text-generation-launcher --model-id $MODEL_ID --max-total-tokens 4096 --max-input-tokens 2048 # The other configurations remain the same as in Scenario 1. ``` You don't need to add double or single quotes in the Argument 2 of Command on SaladCloud Portal, but you do need to add them when running the ‘docker run' command locally: ![](https://mintcdn.com/salad/pEBrSzH4UQRtJw00/container-engine/images/llm-general3.jpg?fit=max\&auto=format\&n=pEBrSzH4UQRtJw00\&q=85\&s=c30120cf73dd4e3a212562214176a434) ## Scenario 3: Run the TGI server interactively. SaladCloud Portal provides an interactive terminal for each instance in SCE deployments, allowing you to interact directly with each instance to troubleshoot issues or reconfigure your application after deployment. If you don't have access to a local test environment with a GPU, you can use the interactive terminal on SaladCloud to test your image, check its resource usage, fine-tune and finalize server settings. Keep in mind that this is just a complement and cannot fully replace your local R\&D environments for daily tasks, as SaladCloud nodes are interruptible and may experience cold starts and occasional downtime. ``` # Override both the ENTRYPOINT and CMD in the image. # Make the container sleep while running. ubuntu@server:~$ docker run -it --rm --gpus all -p 8080:80 -v $volume:/data \ -e HF_TOKEN=$token \ -e HF_HUB_ENABLE_HF_TRANSFER=0 \ -e MODEL_ID=$model \ -e HOSTNAME=:: \ -e PORT=80 \ -e MAX_TOTAL_TOKENS=4096 \ -e MAX_INPUT_TOKENS=2048 \ -e MAX_CONCURRENT_REQUESTS=8 \ -e MAX_BATCH_SIZE=4 \ --entrypoint 'sh' \ ghcr.io/huggingface/text-generation-inference:latest -c "sleep infinity" # Enter the container and start the TGI server manually. root@5693c4212042:/usr/src# text-generation-launcher root@5693c4212042:/usr/src# text-generation-launcher --model-id $MODEL_ID --max-input-tokens 2048 --max-total-tokens 4096 # Enter the container with another terminal and run the TGI benchmark. root@5693c4212042:/usr/src# text-generation-benchmark --tokenizer-name $MODEL_ID root@5693c4212042:/usr/src# text-generation-benchmark --tokenizer-name $MODEL_ID --batch-size 1 --sequence-length 2048 --decode-length 2048 --runs 1 ``` Here is the corresponding configuration to override both the ENTRYPOINT and CMD in the image on SaladCloud: ``` # Command Command: sh Argument1: -c Argument2: sleep infinity # The other configurations remain the same as in Scenario 1. ``` You don't need to add double or single quotes in the Argument 2 of Command on SaladCloud Portal, but you do need to add them when running the ‘docker run' command locally: ![](https://mintcdn.com/salad/pEBrSzH4UQRtJw00/container-engine/images/llm-general4.jpg?fit=max\&auto=format\&n=pEBrSzH4UQRtJw00\&q=85\&s=87df0fe57f832aa0a898034250d6785f) Once the instances are running (sleeping), you can use the interactive terminal to manually run tasks, perform various tests, and troubleshoot issues: ![](https://mintcdn.com/salad/pEBrSzH4UQRtJw00/container-engine/images/llm-general5.jpg?fit=max\&auto=format\&n=pEBrSzH4UQRtJw00\&q=85\&s=2ca4bf7798c10a7a007f8e516b569728) ![](https://mintcdn.com/salad/pEBrSzH4UQRtJw00/container-engine/images/llm-general6.jpg?fit=max\&auto=format\&n=pEBrSzH4UQRtJw00\&q=85\&s=f3db0ac0967284b71acacc6417eeb843) # Recommendation for Production The official images of these inference servers may not be sufficient for production. You can enhance your application by building a custom wrapper image with the following features: * Install the necessary softwares and tools, such as monitoring, troubleshooting and logging. * Add an I/O worker to the inference server for pulling jobs, uploading generated texts and returning job results, especially if you're building a batch processing system. * Pre-load the model parameters into the image to reduce costs, as there's no charge when nodes are downloading your images. * Implement initial and real-time performance checks to ensure that nodes remain in an optimal state for application execution, as the performance of SaladCloud nodes may fluctuate over time due to their shared nature. If a node's performance falls below a predefined threshold, the code should exit with a status of 1, triggering a reallocation. These functions can also be achieved by deploying Startup Probes and Liveness Probes. LLM inference is both VRAM-intensive and time-consuming and user experience is crucial for real-time services. Inference time can also vary significantly depending on the length of the generated text and the performance of the node. **To successfully run LLM using the container gateway on SaladCloud, the system requirements, capabilities and parameters must be clearly defined, planned, tested and deployed.** Here are some examples: ![](https://mintcdn.com/salad/pEBrSzH4UQRtJw00/container-engine/images/llm-general7.jpg?fit=max\&auto=format\&n=pEBrSzH4UQRtJw00\&q=85\&s=c246a0905d14af277903765d88cd66db) Context length and batch size can significantly impact system performance, throughput, and cost-effectiveness. To utilize resources efficiently, several container groups can be deployed for different scenarios, such as short and long conversations. Parameters such as Max Total Tokens, Maximum Concurrent Requests and Batch Size are crucial and affect every aspect of the system.These parameters need to be thoroughly tested and deployed based on the specific system requirements. Requests exceeding the limit on the inference servers will be rejected as a backpressure mechanism. To use the load balancer efficiently, client applications should implement traffic control and retry logic to enhance resilience. This includes resending requests to the load balancer for occasional errors and stopping the acceptance of new requests from users early during congestion, rather than allowing them to be dropped within the system. The system capacities need to be carefully calculated and provisioned, or adjusted as needed, to adequately support the system requirements. Since instances require time to download images and start up, we recommend adjusting the container group to the expected capacity 30 minutes before peak traffic. ![](https://mintcdn.com/salad/pEBrSzH4UQRtJw00/container-engine/images/llm-general8.jpg?fit=max\&auto=format\&n=pEBrSzH4UQRtJw00\&q=85\&s=f2b4aba8b3eca56d87375dc87f25f1a1) # Salad Container Engine Billing Source: https://docs.salad.com/container-engine/explanation/billing-pricing/billing Understand how Salad Container Engine billing works, including per-second usage tracking, priority pricing, and cost examples. *Last Updated: November 2, 2026* > [!TIP] > > Looking for current prices? See [salad.com/pricing](https://salad.com/pricing), or check the price shown in the > SaladCloud Portal when you create a container group. For information on options for purchasing SaladCloud credits visit our [SaladCloud billing documentation](/general/explanation/billing). Salad Container Engine (SCE) is billed based on the time container group instances are running on one of our machines. No charges are incurred while your container group is allocating or downloading. The price per hour is based on the hardware resources and [priority level](/container-engine/explanation/billing-pricing/priority-pricing#priority-levels) you select. Prices are available on our [pricing page](https://salad.com/pricing) and listed in the SaladCloud Portal when creating a container group. Usage is tracked per second. When you [change the priority](/container-engine/explanation/billing-pricing/priority-pricing#changing-priority) of a running container group, the new priority's rate applies from that point on. ![](https://mintcdn.com/salad/4KO858akQWmRXuML/container-engine/images/deployment-map.png?fit=max\&auto=format\&n=4KO858akQWmRXuML\&q=85\&s=04e3d3853f227e1f2bc0439f75fb3447) > [!TIP] > > **Never Pay for Cold Boot Time Again** > > You only pay for the time that the hardware is available to be used by your application, you will never pay for Cold > Boot time. ## How Billing Rates are Calculated When creating a Container Group in SCE, you select the required hardware that will be dedicated to your application when it runs on SaladCloud. For GPU container groups, there are no additional charges for RAM and vCPU. ### Example 1 - CPU only Container Group You create a Container Group with 1 vCPU, 2 GB RAM, no GPU, and 10 replicas Per Instance Cost = 1 vCPU x \$0.005 per vCPU + 2 GB x \$0.001 per GB = \$0.007/hr **Total Cost** = \$0.007/hr (per Instance) x 10 replicas = \$0.07/hr ### Example 2 - GPU Container Group You create a Container Group with 4 vCPU, 6 GB RAM, RTX 5060 (8 GB) GPU at "Low" priority, and 5 replicas. GPU rates include vCPUs and RAM. Per Instance Cost = 1 RTX 5060 (8 GB) at "Low" Priority x \$0.082 = \$0.082/hr **Total Cost** = \$0.082/hr (per Instance) x 5 replicas = \$0.41/hr # Priority Pricing Source: https://docs.salad.com/container-engine/explanation/billing-pricing/priority-pricing *Last Updated: October 13, 2026* ## SaladCloud Infrastructure SaladCloud is a distributed network with nodes located worldwide, ranging from esports arenas to personal computers. This global network allows us to offer computing resources at exceptionally low prices and gives us the ability to grow the network by hundreds of nodes a day when needed. It is important to understand that as a result, the nodes powering our network can disconnect at any time, stopping container instances running on the node. When this happens we automatically reallocate these instances to a new node as quickly as possible. Although some nodes may remain connected for days at a time, maintaining constant uptime requires multiple replicas for redundancy. ## Priority Levels Priority levels let you balance interruptions and cost savings according to your needs. Container Groups run at one of four priority levels on our network: "High", "Medium", "Low", or "Lowest" (formally "Batch"). Lower priority levels have reduced costs. Higher priority container groups can preempt lower priority ones if a higher-paying job becomes available. Pick the lowest priority level that meets your interruption tolerance when you deploy. If instances at a lower priority level are being interrupted too frequently for your needs, you can raise the priority of a running container group at any time. See [Changing Priority](#changing-priority). After adding a GPU to your container group, you can choose between priority levels. At the highest priority level, your container group instances will not be interrupted *by other workloads*. However, high priority instances **will** still be reallocated if your container exits, you request a reallocation, or the node powering the instance disconnects. Container groups without a GPU always run at the "Lowest" priority level, and can be interrupted by any container group requesting a GPU. ## Changing Priority You can change the priority level of an existing container group in the Portal by editing the container group, or with the [Update Container Group API](/reference/saladcloud-api/container-groups/update-container-group). * **Changes apply to running instances immediately.** Nothing restarts or redeploys. The new priority level determines both whether your instances can be preempted by higher priority container groups and the hourly rate billed from that point on. * **Raising priority** is allowed at any time on a running container group. * **Lowering priority** on a running container group is only allowed once the container group has been running at its current priority level for 1 hour. The hour counts from the container group's last start or its last priority change, whichever is later, and a priority change in either direction restarts it. This applies while the container group is deploying or running. * **Rejected changes.** If you attempt to lower the priority before the hour has passed, the request is rejected and the container group keeps its current priority level. The API returns HTTP `400` with the problem type `container_group_update_exception` and the message: "The priority of a running container group can only be lowered after it has been running at this priority for 60 minutes. Stop the container group to change its priority immediately." The Portal shows the same error. * **Stopped container groups** can change priority freely, and stopping clears the 1-hour timer. To move a running container group to a lower priority level right away, stop the container group, change the priority, and start it again. The new priority level applies when the container group starts. * **Container groups without a GPU** always run at the "Lowest" priority level. A priority value set on them is ignored. > [!TIP] > > Choose the lowest priority level that meets your interruption tolerance when you deploy. Raise priority whenever you > need nodes faster. To lower priority right away, stop the container group, change the priority, and start it again. # Container Groups Source: https://docs.salad.com/container-engine/explanation/container-groups/container-groups *Last Updated: October 15, 2024* Container Groups are fundamental to the deployment process within the SaladCloud Environment (SCE). They consist of a container image, hardware requirements, and a replica count, playing a crucial role in deploying your application on the SaladCloud network. As the owner of the Container Group, you have the responsibility to manage it, while SCE takes care of running the group and maintaining the desired replica count. ## Container Group Components * **[Container Registry and Image](/container-engine/explanation/infrastructure-platform/container-registries)**: Specify the container image you want to run in the Container Group. Use public or private images from most container registries. * **Resource Requirements**: * **Replica Count**: Replicas are the desired number of instances for your container group deployment. We recommend that you deploy with 3+ replicas during testing, and 5+ replicas in production to ensure the uptime of your deployment. * **Why multiple replicas?**: For enhanced reliability and smoother operation, we strongly recommend deploying with a minimum of 3 replicas. This ensures your applications remain resilient and maintain performance, even when a node becomes temporarily unavailable. Scaling beyond a single node not only increases fault tolerance but also optimizes resource allocation and load balancing across our distributed cloud infrastructure. Start with 3 or more replicas to unlock the full potential of our platform and experience seamless scaling and improved uptime for your containers. * **Number of vCPUs (1-16)**: \*Define the desired number of virtual CPUs for your container. * **Memory (RAM) (1-60GB)**: Specify the amount of RAM required for your container. * **GPU Class**: Define the type of GPU to be used. Each container instance will have 1 GPU attached. If you select multiple GPU classes, the system will assign the first available GPU class to new container instances. ![](https://mintcdn.com/salad/ko38nW-LNf6N2Y1I/container-engine/images/portal-select-hardware.png?fit=max\&auto=format\&n=ko38nW-LNf6N2Y1I\&q=85\&s=84e9756027f3692b9444ef53dc1d4e5d) ## Additional Configuration * **[Environment Variables](/container-engine/how-to-guides/environment-variables)**: Define environment variables to customize your container's environment. You can do this via the key-value editor, or via the bulk editor. ![](https://mintcdn.com/salad/ko38nW-LNf6N2Y1I/container-engine/images/portal-environment-variables-key-value-edit.png?fit=max\&auto=format\&n=ko38nW-LNf6N2Y1I\&q=85\&s=106d8d158c940dfe95de7a0009fe230b) ![](https://mintcdn.com/salad/ko38nW-LNf6N2Y1I/container-engine/images/portal-environment-variables-bulk-edit.png?fit=max\&auto=format\&n=ko38nW-LNf6N2Y1I\&q=85\&s=3f8d33fbd3cb22829edc5f3212755718) * **[Command](/container-engine/how-to-guides/specifying-a-command)**: Specify the command to run when the container starts. This command will override the default command and entrypoint specified in the container image. ## Monitoring and Observability * **[Startup Probe](/container-engine/explanation/infrastructure-platform/startup-probes)**: Set up a startup probe to check if the container has started as expected. Recommended for all applications using the Container Gateway. * **[Liveness Probe](/container-engine/explanation/infrastructure-platform/liveness-probes)**: Configure a liveness probe to check if the container is healthy. Recommended for all applications using the Container Gateway. * **[Readiness Probe](/container-engine/explanation/infrastructure-platform/readiness-probes)**: Set up a readiness probe to check if the container is ready to accept traffic. Recommended for all applications using the Container Gateway. * **[Container Gateway](/container-engine/explanation/infrastructure-platform/networking)**: Choose between authentication or no authentication for external requests and port number for enabling networking inside of container. * **[External Logging Service](/container-engine/explanation/infrastructure-platform/external-logging)**: Optionally configure an external logging service for container logs. Recommended for production deployments. * **[CPU and RAM Utilization](/container-engine/explanation/container-groups/resource-utilization)**: View the CPU and RAM each running instance is using, relative to the vCPU and RAM you requested. Reported automatically, with no instrumentation required. ![](https://mintcdn.com/salad/ko38nW-LNf6N2Y1I/container-engine/images/portal-monitoring-config.png?fit=max\&auto=format\&n=ko38nW-LNf6N2Y1I\&q=85\&s=cea0b0cd5c96083d2a137caa5ea043ec) ## Auto-Start Feature The container deployment screen offers an auto-start feature. By default, this feature is enabled, and it automatically starts the container group when the image is pulled. If you disable this feature, you will need to manually start the container group after it is done pulling the image. ## Container Group Actions Container Group actions allow you to create, manage, and modify your container deployments effectively. To access the container group actions you first need to deploy a container. * **Create** : Create a new Container Group. When created, it is not yet running on nodes. * **Start** : Initiate a deployment of the Container Group on the SaladCloud network. * **Stop**: Stop the current deployment, terminating all active Container Instances. Stopped Container Groups can be started again, but the deployment will be of new container group instances, not the same ones that were stopped. * **Duplicate**: Create a copy of an existing Container Group, allowing for easy replication of settings and configurations. * **Edit**: Update the display name, replica count, image source, resource requirements, and other configuration settings of a Container Group once it has been created. * **Delete**: Delete a Container Group and all associated information. This action is irreversible. ![](https://mintcdn.com/salad/yZinoDalrD_wLP9i/container-engine/images/portal-container-group-actions.png?fit=max\&auto=format\&n=yZinoDalrD_wLP9i\&q=85\&s=eadb5b090577b0088017880ae89f1a58) # Container Logs Source: https://docs.salad.com/container-engine/explanation/container-groups/container-logs *Last Updated: November 12, 2026* ## How to Log From Your Container When running a container on SaladCloud, you can log to the standard output and standard error streams. These logs are collected and stored by SaladCloud, and exported to any configured [external logging source](/container-engine/explanation/infrastructure-platform/external-logging). [Learn more about logging best practices.](/container-engine/how-to-guides/external-logging/best-practices) ## Basic Logging ### How to View Container Logs In the Portal Once your container is up and running on a SaladCloud node, you can view the logs from your container on the "Container Logs" tab of a Container Group. To access this feature in the portal, navigate to your Container Group details page, and click on the 'Container Logs' tab. ![](https://mintcdn.com/salad/CzUR5YJ7qRb7L5z3/container-engine/images/portal-container-logs.png?fit=max\&auto=format\&n=CzUR5YJ7qRb7L5z3\&q=85\&s=301a2b36a02a078cf5260d7d6dc39093) You can also navigate to this page from the Action menu of an instance. This option will take you to the Container Logs tab with the Machine ID value pre-filled. ![](https://mintcdn.com/salad/UiepyIUZKZjvv7fL/container-engine/images/portal-container-instance-actions-view-logs.png?fit=max\&auto=format\&n=UiepyIUZKZjvv7fL\&q=85\&s=363db9105a1eadf1102cd3b90fedc4a2) The Container Logs feature has a simple interface meant to provide you with enough visibility for basic troubleshooting of your applications running on SaladCloud. For more robust logging functionality, we recommend configuring the [External Logging Service option](/container-engine/explanation/infrastructure-platform/external-logging) in your container group. The Container Logs feature allows you to query your container logs with these options: * search for specific log messages with case-insensitive string filtering * filter for logs from a specific Machine ID. If left blank, logs from all Machine IDs in the Container Group will be returned. * filter for logs in a specified time period. Choose one of the predefined options, or use the custom start date and end date option When your query returns results you will see them in a scrollable table view. Each result includes: * Log Message * Machine ID (The unique ID of the node running the container that created the log message.) * Log Create Time Should your query yield no results, the table view will display "No data to display" For more sophisticated querying, you can use the Log Explorer or the Public API [Query Log Entries endpoint](/reference/saladcloud-api/logs/query-log-entries). Clicking the Log Explorer button will take you to the Log Explorer page in the SaladCloud Portal with the current query pre-populated. **Availability and Limitations** * A maximum of 500 logs can be returned per query. Utilize specific query filters and time ranges to get the logs you are looking for. * Logs are retained and accessible for up to 90 days. * Each query counts against your [daily log query limits](#daily-log-query-limits). * If you encounter this error message, try narrowing your query's time range * ![](https://mintcdn.com/salad/pEBrSzH4UQRtJw00/container-engine/images/portal-container-logs-error-getting-logs.png?fit=max\&auto=format\&n=pEBrSzH4UQRtJw00\&q=85\&s=64f92c88084899a9453ae0ff7bca5542) ## Advanced Logging For more advanced on-platform logging capabilities, you can make use of the [Query Log Entries endpoint](/reference/saladcloud-api/logs/query-log-entries) in the API. This endpoint is scoped at the organization level, rather than the container group level, allowing you to view logs from any number of container groups and projects. This endpoint supports a more flexible query language as well, allowing you to make much more sophisticated filters across many fields, and supporting filters on structured logs emitted by your application. [See the full query reference](/container-engine/reference/log-queries). You can query logs by making a POST request to the query logs endpoint like this: ```shell theme={null} curl --request POST \ --url https://api.salad.com/api/public/organizations/$organization_name/log-entries \ --header 'Content-Type: application/json' \ --header "Salad-Api-Key: $salad_api_key" \ --data '{ "end_time": "2025-11-07T05:31:56Z", "page_size": 1, "query": "", "sort_order": "desc", "start_time": "2025-11-07T05:31:56Z" }' ``` and receive a response like: ```json theme={null} { "items": [ { "json_log": {}, "parent_span_id": "", "receive_time": "2025-11-07T05:31:56Z", "resource": { "labels": {}, "type": "" }, "severity": "debug", "span_Id": "", "time": "2025-11-07T05:31:56Z", "trace_Id": "" } ], "organization_name": "acme-corp", "page_max_time": "2025-11-07T05:31:56Z", "page_min_time": "2025-11-07T05:31:56Z" } ``` Each log event takes the following structure. ```json theme={null} { "time": "string iso8601", "receive_time": "string iso8601", "resource": { "type": "string enum", "labels": { // key-value pairs (string to string) specific to `type` } }, "severity": "string enum", "severity_number": "integer", "trace_id": "string", // optional "span_id": "string", // optional "parent_span_id": "string", //optional // only one of `text_log` or `json_log` "text_log": "string", "json_log": { // key-value pairs (string to any valid JSON type) specific to log entry } } ``` * Note that this will contain **EITHER** `text_log` **OR** `json_log`, but not both. If you emit logs that are valid json, they will end up in the `json_log` field. Otherwise, the full log line will be in the `text_log` field. * The `time` field indicates the system time on the node where the log was emitted. * the `receive_time` field indicates the time when Axiom (what we use under the hood for log storage) received the log entry. * Any of these fields can be used in the query language. [Here](https://docs.salad.com/container-engine/reference/log-queries#examples) are some examples of queries you can make. These queries can be passed as the `query` parameter in the body of the request to the API. ## Daily Log Query Limits SaladCloud limits how many log queries you can run each day. There are two limits, one per organization and one per account, and both apply to every query. Every log query counts, whether it comes from the Portal, the API, or the [SaladCloud CLI](/cli/explanation/overview). The limits reset at 00:00 UTC. They only limit reading logs through SaladCloud: your containers keep running and logging as normal. ### When You Reach a Limit Log queries return `429 Too Many Requests` until 00:00 UTC, and the Portal shows a "Daily log query limit reached" banner. You can: * Wait for the reset. * [Use fewer queries](#use-fewer-queries). * Stream your logs to your own logging service with [external logging](/container-engine/explanation/infrastructure-platform/external-logging). Logs go straight to your provider as they're written, with no SaladCloud query limit. This is the best option if you need logs continuously or in high volume. * [Contact support](/support) if you need a higher limit. ### Use Fewer Queries * **Get more from each query.** Query Log Entries searches your whole organization, so one query can cover several container groups or instances. Combine them with `or` instead of running a separate query for each one, and set `page_size` to 100, the maximum, so you need fewer pages. * **Don't query in a tight loop.** Polling once a minute uses 1,440 queries a day. Polling every 5 minutes uses 288. * **When you poll, ask only for what's new.** Set `start_time` to the time of the last entry you already have, or a few minutes back. Re-reading the last day or week on every poll is slower and returns entries you already have. * **Check instance status without logs.** To see whether instances are running or ready, use [List Container Group Instances](/reference/saladcloud-api/container-groups/list-container-group-instances). It isn't a log query. * **Log only what you need.** Less output makes log queries faster and means fewer pages to read. ### Watch Out For Automatic Polling These keep running queries until you stop them, and use up the limit fastest: * **Portal auto-refresh** runs the query every 10 seconds. Turn it off or close the tab when you aren't watching. * **`logs -f` in the CLI** runs at least one query every 5 seconds by default, and more for a container that logs a lot. Stop it when you're done, or set a longer `--poll-interval`. * **Scripts and AI agents** that poll logs in a loop. Poll every few minutes at most, or use external logging instead. # The Deployment Lifecycle Source: https://docs.salad.com/container-engine/explanation/container-groups/deployment-lifecycle *Last Updated: October 7, 2026* The status of container groups and individual instances changes over the lifecycle of a deployment. This page clarifies the associated terminology and statuses. **Container Groups:** Container groups are groups of one or more instances of your container image. These are similar to a Kubernetes ReplicaSet. * **Preparing:** A Preparing (or pending) deployment is undergoing initial processing that needs to occur before the deployment can be started. The required processing depends on if the container image has been previously stored and whether or not it is from a private registry. Depending on the size of the container image, this preparation can take some time. The stages are: * **Pulling** the image from the repository. * **Compressing** the image for faster transmission. * **Storing** the result for distribution. A new container group starts in `pending` while SaladCloud pulls its container image. For a large image, or when the platform is busy, this can take a long time, and no system events are logged for the group yet. Once the image is pulled the group moves to `deploying` and SaladCloud looks for machines to run it on; from then on the system events show each instance being allocated, downloading and starting. Be patient while a group is `pending`; if it stays there for a very long time, contact SaladCloud support. * **Stopped:** The container group is prepared, but is either not yet running or has been stopped. Note that presently, individual instances can still be running even after the container group is stopped while the stop message propagates through the network. * **Deploying:** The deployment has been started, but no instances are currently running. * **Running:** The container has been started and at least one instance is running. * **Failed:** A container group can only fail if there was a problem in the Preparing process, either: * **Failed** to pull if we were not able to pull the image from the repository. This could indicate an issue with the provided image name, or a transient issue with the registry. Check the provided image and try again. * **Failed to authenticate** if we could not authenticate to the registry. Check and correct the authentication details and try again. * **Failed to store or compress** indicate a rare problem preparing at the state. **Instances:** Instances are an assignment of your container to a SaladCloud node. Instances have separate status from the container group they are a part of. While deploying on SaladCloud is usually quick, it can occasionally take 20 minutes or more to get your containers up and running. **You are only charged for an instance once it reaches Running state.** * **Allocating:** Instances are allocating when we are looking for a node to assign your deployment. If all instances show allocating for an extended time it indicates that either that instances are failing to create or that there are not currently nodes available with the requested properties. * **Downloading:** Downloading indicates that a node has been assigned to your workload and is downloading the container image. * **Creating:** The assigned node is preparing your deployment and starting the container image. If an instance is stuck creating you can **reallocate** your workload to another node. * **Running:** Running indicates the container has been started. Depending on your container, additional time may be needed before it is ready for Container Gateway (inbound networking) requests, e.g. to run startup scripts or download models. Health Probes can be configured to account for this. Note that [Billing](/container-engine/explanation/billing-pricing/billing) is usage-based on usage and only starts once a container is running. Running containers can be reallocated, recreated, or restarted. * **Stopping:** Indicates that a stop signal has been sent to your container instance. It can take up to several minutes for your container to stop while the signal propagates through the network. **Replicas:** Replicas are the desired number of instances for your container group. While running, you can edit the desired replica count for your deployment. * For enhanced reliability and smoother operation, we strongly recommend deploying with a minimum of 2 replicas. This ensures your applications remain resilient and maintain performance, even if a node becomes temporarily unavailable. Scaling beyond a single node not only increases fault tolerance but also optimizes resource allocation and load balancing across our distributed cloud infrastructure. Start with 2 or more replicas to unlock the full potential of our platform and experience seamless scaling and improved uptime for your containers. # Commonly asked questions ### My instance is stuck at 99 percent creating, help! Downloading and Creating instance statuses are estimated based on average download and setup times. If your instance is taking longer than expected to get set up, it will appear to hang at 99% creating. In this case, it is likely downloading or unpacking more slowly than expected. If the node continues to underperform, it will automatically be reallocated - there's nothing you need to do in this case but wait. You may attempt a manual reallocation, but note that this will cause the process to start over from the allocating step. ### My container group is running, but my instances are not. Am I being charged? No. You are only charged for instances that are in a **running** state. If you had a container group that reached a running state, then you reallocate the instances, the container group would still show as running, even though no instances are running at the moment. In that case, you would not be charged until an instance began running again. # Disk Space Source: https://docs.salad.com/container-engine/explanation/container-groups/disk-space *Last Updated: October 19, 2026* # How Disk Space is Calculated When you deploy a workload to the SaladCloud Network, nodes are filtered on the criteria that you specify. If you do not specify disk space requirements, nodes are provided which meet a minimum free space allotment. This is calculated based on the size of the downloaded container, plus some extra buffer to account for operations like extracting the container, installing dependencies, and caching results. # Requesting additional Disk Space on nodes If you expect to need significantly more free space on your nodes than your container itself requires, configure it by selecting a Disk Space option when configuring your container group in the Portal or in the API by passing `"storage_amount"` on the resources object. The API value is in bytes and must be a whole number of gigabytes, from 1 GB (`1073741824`) to 250 GB (`268435456000`). Disk space is ephemeral. It's kept when an instance restarts, but an instance that is reallocated or recreated starts with an empty disk, so store results you need to keep outside the container. ![](https://mintcdn.com/salad/ko38nW-LNf6N2Y1I/container-engine/images/portal-select-disk-space.png?fit=max\&auto=format\&n=ko38nW-LNf6N2Y1I\&q=85\&s=31801e1c40530b3ae0d10ee912c07802) > 📘 Need more space? > > SaladCloud's disk space requirements for nodes are minimum thresholds; nodes may provide significantly more free space > than the minimum. However, if you expect to regularly need more than highest disk space option provided, reach out to > your account manager or email [cloud@salad.com](mailto:cloud@salad.com) to request nodes with additional space. We can > take a look at how many nodes are available with high levels of free space to help guide you to the right balance of > space requirements and node counts. # CPU and RAM Utilization Source: https://docs.salad.com/container-engine/explanation/container-groups/resource-utilization Understand the CPU and RAM utilization SaladCloud reports for each container group instance, how often it updates, and why a percentage can legitimately exceed 100%. *Last Updated: September 21, 2026* SaladCloud reports CPU and RAM utilization for every running container group instance. The values appear in the SaladCloud Portal and in the [SaladCloud API](/reference/saladcloud-api/container-groups/list-container-group-instances), so you can see whether a workload is actually using the hardware you requested without adding any instrumentation to your container. ## Where to find it In the Portal, open your container group and look at the **Utilization** column of the instance table. Each running instance shows a line for CPU and a line for RAM: ``` CPU 28.2% RAM 41.7% ``` Opening an individual instance from that table shows the same two figures, with the absolute memory figure alongside the percentage — for example `RAM 41.7% (2.5 GB)`. Utilization is only displayed for instances in the **running** state. An instance that is allocating, downloading, or starting has no container to measure yet, so no value is shown. From the API, `GET /organizations/{organization_name}/projects/{project_name}/containers/{container_group_name}/instances` returns the same data on each instance: | Field | Description | | - | - | | `cpu_percent` | CPU used during the last sampling interval, as a percentage of your requested vCPUs | | `cpu_usage` | CPU time consumed during the last sampling interval, in seconds | | `cpu_usage_total` | Cumulative CPU time consumed since the instance started, in seconds | | `memory_usage_mb` | Current memory in use, in MB | | `memory_usage_percent` | Current memory in use, as a percentage of your requested RAM | > [!NOTE] > > These fields are omitted for instances that are not running, and for instances that have not yet produced a first > measurement. Treat them as optional in your client code rather than assuming they are always present. ## What the percentages are measured against Both percentages are relative to **what you requested for the container group**, not to the node's total hardware: * `cpu_percent` is measured against the **number of vCPUs** you configured. * `memory_usage_percent` is measured against the **memory (RAM)** you configured. So a container group configured with 4 vCPUs that reports `CPU 50%` is consuming the equivalent of 2 full cores. This is deliberately not a percentage of the node: SaladCloud nodes vary widely in size, and a percentage of node hardware would mean something different on every machine. A percentage of your own allocation means the same thing everywhere, and it is the number that tells you whether you are paying for resources you do not use. ## How often the values update Each node samples its running containers **once every 60 seconds** and reports the result up to the platform. Allowing for propagation, expect a value in the Portal or API to be up to roughly two minutes behind real time. A few consequences follow from the sampling model: * **CPU is an average, not an instantaneous reading.** `cpu_percent` is derived from the CPU time consumed between two consecutive samples, divided by the elapsed wall-clock time and your vCPU count. A workload that is idle for 50 seconds and then saturates 4 cores for 10 seconds reports roughly the same number as one running steadily at a low level. Short spikes are flattened. * **RAM is an instantaneous reading.** `memory_usage_mb` and `memory_usage_percent` are the values at the moment of the sample, so a brief allocation spike between samples is not captured at all. * **The first CPU reading takes about a minute.** Because CPU utilization is a delta between two samples, a newly started instance has nothing to compare against until its second sample. Expect `CPU 0%` for roughly the first minute after an instance starts. * **A restart or recreate resets the CPU baseline.** When a container is restarted or recreated, its cumulative CPU counter starts over, so that interval is reported as `0%` and normal readings resume on the next sample. Memory reporting is unaffected. * **Values below 0.1% display as `<0.1`.** Anything in that range means the same thing — idle — and rounding it to `0.0` would read as a broken metric. > [!TIP] > > If you need finer resolution than one minute, or need per-process or per-GPU detail, instrument the container itself. > See [Implementing Performance Monitoring](/container-engine/tutorials/performance/performance-monitoring) for a > `psutil` and `nvidia-smi` based approach, and [Hardware Utilization > Autoscaling](/container-engine/how-to-guides/autoscaling/hardware-metrics-scaling) for using those metrics to drive > replica counts. ## Why utilization can exceed 100% ### GPU workloads On GPU container groups, SaladCloud does not strictly enforce the vCPU and RAM you request, so utilization above 100% is possible — a workload that requested 2 vCPUs but can keep 8 cores busy reports `CPU 400%`. Do not rely on this. How much a container is allowed to exceed its request varies by node, so an application that routinely runs over will work on some nodes and fail unexpectedly on others. If you see utilization above 100%, raise the requested vCPUs or RAM to cover what your application actually uses. On a GPU container group this does not change your bill. ### CPU-only workloads On container groups without a GPU, the limits are enforced. CPU is capped at your requested core count, so `cpu_percent` stays at or below 100%. Memory is capped at exactly your allocation, and a container that exceeds it is out-of-memory killed rather than allowed to run over — which appears as an `Instance Exited:137 (Likely Out of System Memory)` [system event](/container-engine/explanation/container-groups/system-events). If you see that, increase the RAM allocated to the container group. ## Using utilization to right-size a deployment > [!WARNING] > > Utilization is a one-minute average from a single instance. Before changing your configuration, look across several > instances and several samples — one instance reading low may simply have been between jobs when it was sampled. Low CPU on a GPU workload is often fine — a GPU-bound pipeline, or an instance idle waiting for work — so check it against your own request volume before reducing anything. Low RAM on a CPU-only workload is worth acting on: you are billed for the allocation whether you use it or not, and a smaller request also widens the pool of nodes your workload can be scheduled on. A CPU-only workload sitting near 100% RAM is the opposite signal, and is at risk of exit code 137. For automating this rather than doing it by hand, see [Hardware Utilization Autoscaling](/container-engine/how-to-guides/autoscaling/hardware-metrics-scaling). # SSH & Terminal Access Source: https://docs.salad.com/container-engine/explanation/container-groups/ssh-and-terminal *Last Updated: October 19, 2026* SaladCloud provides two ways to access a shell inside your running container instances: a web-based terminal directly in the Portal, and SSH access for connecting from your local machine or other SSH clients. ## SSH Access Use SSH to open a shell on a running container instance after adding your public key in the SaladCloud Portal. ### 1. Create or Obtain an SSH Key If you already have an SSH key pair, you can skip this step. To check for existing keys: ```bash theme={null} ls -la ~/.ssh/ ``` Look for files named `id_ed25519.pub` or `id_rsa.pub`. SaladCloud accepts Ed25519 (`ssh-ed25519`) and RSA (`ssh-rsa`) keys only, so an ECDSA key such as `id_ecdsa.pub` won't work. To create a new SSH key: ```bash theme={null} ssh-keygen -t ed25519 -C "you@example.com" ``` This creates `~/.ssh/id_ed25519` (private key) and `~/.ssh/id_ed25519.pub` (public key). Your public key will look similar to this: ``` ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHKz8vGk9XpFmEqTcvN7LMfPxWkR5yJQ2nBdW1cLmK4p you@example.com ``` ### 2. Copy Your Public Key ```bash theme={null} cat ~/.ssh/id_ed25519.pub ``` ### 3. Add the Key in the Portal There are two ways to access the SSH key settings: * Click your username in the upper-right corner and select **SSH Keys**, or * Click **SSH Keys** in the left sidebar menu Paste your public key into the field and save it. > [!NOTE] > > Each user holds one SSH public key, and saving a new key replaces the existing one. If you connect from more than one > machine, use the same key pair on each. A public key can belong to only one user, so teammates each need their own key > pair. Saving a key that another user has already registered fails with "SSH key already registered". ![](https://mintcdn.com/salad/NZr5UzWB2OULDSAI/container-engine/images/ssh-access-1.png?fit=max\&auto=format\&n=NZr5UzWB2OULDSAI\&q=85\&s=4ace6127fd5bb134f44a9863c42bfb8f) ### 4. Connect to a Container Instance 1. Open your container group in the Portal and click on a running instance. 2. You will see an SSH command displayed in a text box above the terminal. Command will look something like this: ```bash theme={null} ssh root@ -p ``` 3. Copy the command and paste it into your terminal. 4. The Portal also displays the key fingerprint for verification, so you can confirm you're connecting with the correct key. SSH automatically tries default key files from `~/.ssh/` (such as `id_ed25519` and `id_rsa`), so the command shown in the Portal works without modification for most users. If your key has a custom name or is stored in a non-standard location, add the `-i` flag to specify your key name and location: ```bash theme={null} ssh -i ~/.ssh/my_custom_key root@ -p ``` The SSH command appears once the instance is scheduled on a node, which can take a little longer than the instance reaching the Running state. ### Connecting as Another User The user in the SSH command must exist in your container image. `root` always works. To connect as another user, create it in your image (for example, with `useradd` in your Dockerfile) and replace `root` in the command. Sessions start in `/bin/sh`, so your image must include it. ### Running One-Off Commands You can run a single command without opening an interactive session: ```bash theme={null} ssh root@ -p -- nvidia-smi ``` The connection always reports exit code `1` for one-off commands, even when the command succeeds, and the command's errors are mixed into its standard output. Check the output instead of the exit code, especially in scripts. ### Copying Files SFTP is supported, so `sftp` and modern `scp` (which uses SFTP by default in OpenSSH 9 and later) can copy files to and from an instance: ```bash theme={null} scp -P ./input.txt root@:/data/ scp -P root@:/data/output.txt ./ ``` Files you copy into an instance are stored on its ephemeral disk and are lost when the instance is reallocated or recreated. ## Terminal Access The web-based terminal provides quick access directly from your browser without any SSH setup. 1. Open the [SaladCloud Portal](https://portal.salad.com) and navigate to your container group. 2. Click on a running instance. 3. Click on the **Terminal** tab to open an interactive shell. The terminal opens `/bin/sh` as `root`. If it doesn't connect, see [Troubleshooting](/container-engine/how-to-guides/troubleshooting#my-container-group-is-running-but-i-cant-access-it-with-the-web-terminal). # System Events Source: https://docs.salad.com/container-engine/explanation/container-groups/system-events *Last Updated: June 25, 2026* System Events include useful Container Group and Instance events for overall understanding and troubleshooting of your deployment on SaladCloud. You can access System Events for your container group through the System Events tab in the SaladCloud Portal page for your container group. ![System Events tab in the Portal](https://mintcdn.com/salad/V4S3_t1JxH3zhOLs/container-engine/images/portal-system-events.png?fit=max\&auto=format\&n=V4S3_t1JxH3zhOLs\&q=85\&s=dd1746043918226f5d63416466d1c2da) ### Container Group System Events * `Container Group Started` * `Container Group Stopped` * `Container Group Desired Replica Count Updated from XX to XX` * `Container Group Updated (Version X)` : The container group was updated to the version indicated. ### Instance Status System Events These events describe phases of the [deployment lifecycle](/container-engine/explanation/container-groups/deployment-lifecycle) on SaladCloud. * `Instance Allocated` * `Instance Creating` * `Instance Downloading` * `Instance Starting` * `Instance Running` * `Instance Restarted` * `Instance Recreated` * `Instance Reallocated by User` * `Instance Reallocated by Platform`: We automatically reallocated an instance that is not meeting internal checks for time-to-start or networking. * `Instance Interrupted (Priority)`: The instances was interrupted by a higher priority workload. Consider increasing the [priority](/container-engine/explanation/billing-pricing/priority-pricing#priority-levels) of your workload. * `Instance Interrupted (Node Offline)`: The node running the instance has gone offline. This is expected to occur with our [infrastructure](/container-engine/explanation/billing-pricing/priority-pricing#saladcloud-infrastructure). * `Instance Interrupted (Requested Disk Space Exceeded)`: Your workload exceeded the requested disk space. Request more or reduce disk usage. ### Instance Exit System Events These System Events record exits and the exit code provided by your container. * `Instance Exited:XXX (Error)`: Other exit events with the error code provided by your container. * `Instance Exited:137 (Likely Out of System Memory)`: A 137 exit code often, but not always, indicates the container exceeded it's allotted memory. If this could be the case, try increasing the RAM allocated. * `Instance Exited:0 (Exited Successfully)` ### Health Probe System Events If you have setup [health probes](/container-engine/explanation/infrastructure-platform/health-probes) for your container group, these System Events record state changes of those probes. * `Instance Interrupted (Liveness Probe Failure)` * `Instance Interrupted (Startup Probe Failure)` * `Instance Startup Probe Passed` * `Instance Not Ready (Readiness Probe Failure)` * `Instance Ready (Readiness Probe Passed)` # SCE Architectural Overview Source: https://docs.salad.com/container-engine/explanation/core-concepts/architectural-overview The world's largest distributed GPU cloud at the most competitive prices *Last Updated: July 13, 2026* ## What is SaladCloud Container Engine (SCE)? SaladCloud Container Engine (SCE) is a decentralized global GPU cloud that operates as a two-sided marketplace connecting PC owners (called "chefs") to businesses with compute-intensive workloads. Our chefs sell time on their gaming PCs when they aren't in use—an average of 22 hours per day—while businesses deploy containerized workloads to access affordable GPU compute power. ### Global Distribution at Scale ![](https://mintcdn.com/salad/B_utM-6XUMV1Xhv8/container-engine/images/users_by_state_province_normalized_2025-04-20_to_2025-05-20.png?fit=max\&auto=format\&n=B_utM-6XUMV1Xhv8\&q=85\&s=5ba734f46dbd58dbaa51e372d1ffdbc4) SCE comprises tens of thousands of Salad nodes distributed across the global Internet, with chefs operating from 156 countries in a sampled 30 day period. These machines are spread across more than 1,300 states and provinces worldwide, with distribution roughly following population density patterns. **Hardware Diversity:** * SaladCloud offers selected NVIDIA and AMD GPU classes. Retrieve the current inventory with the [List GPU Classes API](/reference/saladcloud-api/organizations/list-gpu-classes). * Nodes have varying GPU, CPU, and memory configurations. * GPU availability varies by class, region, priority, and the nodes currently participating in the network. Check the [GPU Availability API](/reference/saladcloud-api/organizations/get-gpu-availability) before large deployments. * Up to 250 GB of ephemeral storage available while instances are running **Network Characteristics:** * Many nodes are located in residential networks with asymmetric bandwidth * Upload speeds are typically lower than download speeds * Connections are predominantly over residential internet, often shared with other household devices ## How SCE Works Under the Hood ### Chef Infrastructure Chefs download and install a Windows desktop application that allows them to configure their sharing preferences, including: * Whether to share GPU or CPU resources * Bandwidth sharing preferences * Types of workloads they're willing to accept The application installs Salad Enterprise Linux (SEL) in Windows Subsystem for Linux 2 (WSL2), which: * Manages container workload lifecycles * Coordinates with the SaladCloud backend * Provides security features including intrusion detection * Automatically requests work when the chef is away and the machine is idle ### Workload Deployment Process ![](https://mintcdn.com/salad/oE6Ic7VdFlh4rKXK/container-engine/images/sce_ao3.png?fit=max\&auto=format\&n=oE6Ic7VdFlh4rKXK\&q=85\&s=000fede98aa1d5618de6423d9e123571) When you deploy a container group, the following process occurs: 1. **Image Distribution:** Your container image is pulled from your registry to our internal cache (only once to minimize egress fees) 2. **Node Allocation:** Compatible machines are selected based on your hardware requirements 3. **Image Deployment:** The cached image is distributed to allocated nodes 4. **Startup:** Containers start running your application Startup times vary from minutes to longer periods depending on image size and network conditions, with some nodes starting earlier than others. ## Container Group Architecture A SCE application (container group) consists of multiple replicas (instances) running the same container image, with each instance deployed on a separate Salad node. **Important Distinctions:** * SCE instances are **not virtual machines or physical machines** with attached volumes * Both the image and runtime data are removed when applications stop * **Docker-in-Docker is not permitted** * Instances must have continuously running processes (web servers, job queue workers, etc.) ## Preparing Container Images ### Dockerfile Best Practices ![](https://mintcdn.com/salad/oE6Ic7VdFlh4rKXK/container-engine/images/sce_ao1.png?fit=max\&auto=format\&n=oE6Ic7VdFlh4rKXK\&q=85\&s=ee32b142a27333036c61bc6f8cbc7c56) Create a Dockerfile that: * Selects a base image with GPU support * Adds necessary dependencies * Copies your code and data * Defines the default command to run * Uses environment variables for configuration **Example workflow:** ```Code theme={null} # Build and test locally docker image build -t docker.io/saladtechnologies/misc:test -f Dockerfile . docker run --rm -it --gpus all docker.io/saladtechnologies/misc:test # Push to registry docker push docker.io/saladtechnologies/misc:test ``` **Supported container image size:** Up to 35 GB (compressed) ### Environment Variables Use environment variables to pass information to your applications: * Customization settings (listening ports, request limits) * External service access (cloud storage, databases, APIs) * Configuration parameters ## Deployment Options ![](https://mintcdn.com/salad/oE6Ic7VdFlh4rKXK/container-engine/images/sce_ao2.png?fit=max\&auto=format\&n=oE6Ic7VdFlh4rKXK\&q=85\&s=20390e6cf5ebe48fb7604ae293dd239d) ### Portal vs API Deployment Two deployment methods are available: * **SaladCloud Portal:** Web-based interface for easy deployment * **API:** Programmatic deployment with advanced features **Advanced API Features:** * Deploy in specific countries * Deploy and use Job Queues * More flexible configuration options ## Accessing Your Applications ### Real-Time Access Patterns **Container Gateway (HTTP Load Balancer):** * Best for tasks of approximately equal size * Ideal for processing times under 100 seconds * Free and extremely easy to set up * Perfect for stable, predictable, relatively quick workloads **When Container Gateway Works Well:** * Tasks complete in well under 100 seconds * Fairly predictable and stable demand * Consistent task sizes (e.g., always 512x512 pixel images) ![](https://mintcdn.com/salad/oE6Ic7VdFlh4rKXK/container-engine/images/sce_ao4.png?fit=max\&auto=format\&n=oE6Ic7VdFlh4rKXK\&q=85\&s=c17e838c7875f03fc997938a364fae71) ### Job Queue Patterns **When to Use Job Queues:** * Variable request sizes (1024x1024 images take 4x longer than 512x512) * Tasks exceeding 100-second limit * Long-running workloads (AI video generation, molecular simulations, model fine-tuning) * Multi-model pipelines with different architectures **Available Options:** * **Salad Job Queue:** On-platform solution (API-only currently) * **External Job Queues:** AWS SQS, Redis, and other popular solutions * **Salad Kelpie:** Specialized for very long-running tasks and data synchronization with AWS S3-compatible storage **Trade-offs:** * Job queues introduce asynchronous patterns * Require polling, webhooks, or other completion mechanisms * More complex than direct HTTP responses ![](https://mintcdn.com/salad/oE6Ic7VdFlh4rKXK/container-engine/images/sce_ao5.png?fit=max\&auto=format\&n=oE6Ic7VdFlh4rKXK\&q=85\&s=1e3af6339c239ebc832bd13a95ca997b) ## Handling Distributed Cloud Challenges ### Hardware Heterogeneity ![](https://mintcdn.com/salad/pEBrSzH4UQRtJw00/container-engine/images/node-variability.png?fit=max\&auto=format\&n=pEBrSzH4UQRtJw00\&q=85\&s=69f97a9798c8b116aa191ed0b7be6e62) **Challenge:** Significant variability in hardware configurations * Custom-built PCs, gaming rigs, former crypto miners * Different CPUs, RAM speeds, storage types * Network connections from WiFi to 10 Gigabit Ethernet **Solutions:** * Understand your performance bottlenecks * Handle error cases unlikely in data centers * Monitor system metrics (e.g., GPU temperature over time) * Implement graceful degradation strategies ### Network Variability **Challenge:** Heterogeneous networking conditions * Point-in-time bandwidth measurements * Residential internet with shared connections * Variable latency and throughput **Solutions:** * Monitor bandwidth availability over time within your application * Respond to network conditions in real-time * Set appropriate minimum requirements for your workloads ### Data Transfer Optimization **Challenge:** All nodes are out-of-region for major cloud providers **Solutions:** * Use egress-free storage (CloudFlare R2, etc.) * Minimize data transfer costs * Cache container images automatically (handled by SCE) ## Managing Interruptions ### Understanding Interruptions **Key Characteristics:** * Machines can be interrupted without warning at unpredictable times * Similar to spot instances but no minimum uptime guarantees * No advance notification events (unlike AWS spot instances) * Various causes: power issues, network problems, users wanting to game **Recent Performance Metrics:** * Greater than 99% success rate on requests within one attempt * Even higher success rates with single retry * Particularly reliable for shorter tasks like image generation ### Automatic Recovery **SCE Handles:** * Automatic reprovisioning of interrupted nodes * Maintaining desired replica counts * No charges during container image download periods * Background replacement of failed instances **Your Application Handles:** * Implementing retry logic for failed requests * Graceful handling of 500-series errors * Client-side request management ## Long-Running Tasks ### Data Persistence Strategy **Challenge:** Local storage is ephemeral—completely erased when containers exit or nodes are interrupted **Solutions for Short Tasks:** * Model outputs returned promptly to users * Minimal local storage requirements **Solutions for Long Tasks:** * Regular checkpoint saving to cloud storage * Resume from checkpoints after interruptions * Use tools with built-in checkpoint support (molecular simulation, model fine-tuning frameworks) * Handle data transfer asynchronously to avoid blocking GPU tasks ![](https://mintcdn.com/salad/oE6Ic7VdFlh4rKXK/container-engine/images/sce_ao7.png?fit=max\&auto=format\&n=oE6Ic7VdFlh4rKXK\&q=85\&s=40e0022f65823c9aad19b38565fc1042) ### Optimization Techniques **Bandwidth Optimization:** * Select nodes with better upload bandwidth by performing a bandwidth test on start * Use multithreaded downloading/uploading tools (s3parcp) **Data Management:** * Separate cloud storage folders for each job * Include input files, state files, and output files * Jobs contain only data references, not actual data ![](https://mintcdn.com/salad/oE6Ic7VdFlh4rKXK/container-engine/images/sce_ao6.png?fit=max\&auto=format\&n=oE6Ic7VdFlh4rKXK\&q=85\&s=329248b311bf6b26de9b1bb3de87221b) ## Security and Compliance ### Security Measures **Data Protection:** * Container images and configurations encrypted at rest and in transit * Images only decrypted at runtime * Environment variables decrypted and passed at runtime (not stored locally) * Private registry credentials discarded immediately after image caching **Network Security:** * Inbound connections disabled by default * Secure connections via WireGuard when enabled * Runtime security monitoring with Falco intrusion detection * Immediate workload shutdown and chef banning for security violations **Platform Security:** * SOC 2 compliant * No known leaks or compromised workloads to date * Demonstrated adherence to security, availability, processing integrity, confidentiality, and privacy standards ### Compliance Considerations **Appropriate Workloads:** * Most AI inference and GPU-intensive computations * Molecular dynamics simulations * Model fine-tuning and training * Batch processing tasks **Inappropriate Workloads:** * HIPAA-regulated workloads * Single-instance applications requiring high availability guarantees * UI-based applications requiring consistent user sessions * Database applications requiring persistent storage ## Use Cases and Optimization ### Ideal Scenarios **Large-Scale Operations:** * AI inference involving tens to thousands of GPUs * GPU-intensive computations requiring massive parallelization * Cost-sensitive workloads where price performance is critical **Model Support:** * SDXL/Flux image generation models * Whisper Large speech recognition * LLM 7B/8B/9B and quantized 13B/34B models * Molecular dynamics simulations * Text to Speech (TTS) models ### Performance Optimization **Replica Strategy:** * Increase replica counts to enhance reliability and throughput * Additional replicas may reduce waiting times without extra costs, as only running replicas incur charges * Balance system capacity and reliability requirements **Hardware Selection:** * Older GPUs may offer better price-performance ratios * Consider trade-offs between speed and cost * Evaluate user experience requirements vs. cost controls **Autoscaling:** There are two simple autoscaling strategies to match your compute capacity to workload demand: 1. Queue-based autoscaling: Automatically scale up/down based on the number of jobs in the queue. This can be handled automatically by the Salad Job Queue or Kelpie. 2. Custom Autoscaling: Implement your own autoscaling logic using the [SCE API](/reference/saladcloud-api/container-groups/update-container-group#body-replicas) to update the number of replicas based on real-time metrics you collect from your application. ### Cost Optimization **Storage Strategy:** * Use egress-free cloud storage * Implement efficient data transfer patterns * Leverage SCE's image caching to minimize registry costs ## Getting Started ### Documentation and Resources **Essential Resources:** * [SaladCloud Documentation](/) * [Interactive API reference](/reference) * [Detailed how-to guides for popular use cases](/container-engine/explanation/core-concepts/overview) * [SaladCloud Blog](https://blog.salad.com): * Performance benchmarks across different GPU types * Optimal hardware configuration guides * Price-performance analysis * Real-world case studies and best practices ### Best Practices Summary **Architecture Patterns:** * Design for distributed, dynamic environments * Implement robust error handling and retry logic * Use external storage for data persistence * Plan for variable startup times and node reallocations **Development Workflow:** 1. Build and test containers locally with GPU support 2. Optimize for heterogeneous hardware environments 3. Implement appropriate access patterns (gateway vs. queue) 4. Design for interruptions and automatic recovery 5. Test at scale with multiple replicas **Monitoring and Observability:** * Implement application-level performance monitoring * Track success rates and retry patterns * Monitor resource utilization across nodes * Set up alerts for critical application metrics * While SaladCloud offers basic log and terminal access, consider integrating with external logging and monitoring solutions for advanced observability. We like Axiom. SCE provides unprecedented scale and cost-effectiveness for GPU-intensive workloads while requiring thoughtful architecture to handle the unique characteristics of a decentralized, consumer-hardware-based cloud platform. # Containers vs VPS Source: https://docs.salad.com/container-engine/explanation/core-concepts/container-vs-vps Understanding the differences between containers and virtual private servers (VPS). SaladCloud is a **managed container service**, which means that we use containers to run your workloads. Containers and Virtual Private Servers or Virtual Machines (VPS or VM) are both popular methods for deploying applications, but they have some key differences. ### Containers Containers are a lightweight form of virtualization that allows multiple applications to run on the same operating system kernel. They share the host OS and isolate applications at the process level. This makes containers very efficient in terms of resource usage, as they do not require a full OS for each application. Containers are typically faster to start and stop compared to VMs, making them ideal for scalable and dynamic environments. In general, containers are more portable and easier to manage than VPS, as they can be easily moved between different environments and orchestrated using popular open source tools. They are most often not intended to be interacted with via a terminal, but rather to run a specific application or service. Unlike a VPS which may have dependencies installed on it at runtime, containers are typically built with all necessary dependencies included at the time of creation. This makes containers more consistent and predictable in terms of behavior across different environments. ### Virtual Private Servers (VPS) VPS, on the other hand, are a type of virtual machine that runs its own operating system on top of a hypervisor. Each VPS is allocated a fixed amount of resources (CPU, RAM, storage) and operates independently of other VPS instances on the same host. This provides a higher level of isolation and security, as each VPS has its own OS and file system. However, this also means that VPS can be more resource-intensive and slower to start compared to containers. VPS are often used during development or for applications that require a full OS environment. They are typically managed via SSH or a web-based control panel. VPS can be more complex to manage, as they require regular updates and maintenance of the underlying OS. ### Summary In summary, containers are a lightweight and efficient way to run applications, while VPS provide a higher level of isolation and security. The choice between the two will depend on the specific requirements of your application and the environment in which it will be deployed. For most modern applications, especially those that need to operate at scale, containers are often the preferred choice due to their efficiency and portability. # Salad Container Engine FAQs Source: https://docs.salad.com/container-engine/explanation/core-concepts/faqs *Last Updated: October 13, 2026* This document is a must-read before getting started with SaladCloud. Here, we detail what SaladCloud is, the nature of our network, how SaladCloud works, unique traits of our distributed network, the choice of consumer GPUs over data center GPUs and other frequently asked questions. ## General Info ### What is SaladCloud? SaladCloud is the world’s largest distributed cloud network with 1000s of consumer GPUs at the lowest cost. Our cloud is powered by unused latent compute shared by individuals & businesses around the world. ### What is Salad Container Engine (SCE)? Workloads are deployed to SaladCloud via docker containers. SCE is a massively scalable orchestration engine, purpose-built to simplify this container development. Containerize your model and inference server, choose the hardware and we take care of the rest. ### How big is the SaladCloud Compute Network? Over 2 Million+ GPU owners in 190+ countries are part of the SaladCloud ecosystem. 450,000+ GPUs having contributed significant compute and everyday, 11,000+ GPUs are active on the network. ### What kind of GPUs does SaladCloud have? SaladCloud offers selected NVIDIA and AMD GPU classes. Use the [List GPU Classes API](/reference/saladcloud-api/organizations/list-gpu-classes) to retrieve the current classes and IDs available to your organization. NVIDIA compute images generally use CUDA, while AMD compute images generally use ROCm and HIP. An application or image is not automatically compatible with both vendors. See [AMD GPUs and ROCm](/container-engine/reference/amd-gpus) for image-selection and validation guidance. ### How does SaladCloud work? GPUs on SaladCloud are similar to spot instances. On one side, we have GPU owners who contribute their resources to SaladCloud when not in use. Some providers share GPUs for 20-22 hours a day. Others share GPUs for 1-2 hours per day. Users running workloads on SaladCloud select the GPU types and quantity they need. SaladCloud handles all the orchestration in the backend and ensures you will have uninterrupted GPU time as per requirements. ### Why do owners share GPUs with Salad? Owners earn rewards (in the form of Salad balance) for sharing their compute. Many compute providers earn $100 - $200 per month on SaladCloud as a reward that they exchange for games, gift cards and more. ### What are some unique traits of SaladCloud compared to other clouds? * Since SaladCloud is a compute-share network, our GPUs have longer cold start times than usual, and are subject to interruption. * The network includes selected NVIDIA and AMD GPU classes. Use the [List GPU Classes API](/reference/saladcloud-api/organizations/list-gpu-classes) for the current inventory, and match your container image to the selected GPU vendor and architecture. * GPU VRAM varies by class. The highest vRAM on the network is 32 GB. * Workloads requiring extremely low latency times are not a fit for our network. ### What are SaladCloud Endpoints/APIs? SaladCloud has one API offering today - a full-featured [Transcription API](/transcription/explanation/overview). We will be adding more APIs to our suite in the coming months. ### What is the right SaladCloud product for my workload? SaladCloud has three product lines: * [Salad Container Engine (SCE)](/container-engine/tutorials/quickstart): a managed container engine built for deploying GPU-intensive containers at a massive scale. * [Salad Gateway Service (SGS)](/gateway-service/explanation/overview): a proxy service that routes requests from VPN operators or other customers who need distributed residential IP infrastructure to SaladCloud nodes. * [Salad Transcription API](/transcription/explanation/overview): the lowest-priced transcription service in the market with unparalleled accuracy. ### Is SaladCloud a good fit for GPU reselling platforms? If your platform depends on reselling dedicated bare-metal GPUs or VPC-style hardware, SaladCloud is usually not the right fit. Salad Container Engine is a managed, container-based service rather than raw hardware access. If your platform supports a similar container-based integration model and you want to resell SaladCloud compute to your customers, contact us at [cloud@salad.com](mailto:cloud@salad.com). ### How does the billing work? * SaladCloud operates on a prepaid credits billing model and charges for resource usage at the org level. You can view your current bill and configure recharge settings within your org on the Billing & Usage page. * You are billed per second only for container instances in the “running” state. Instances in other states, such as “downloading” and “allocating” are not billed. * Bandwidth is not metered, and there are no "stale charges" related to storage for containers that are not running. * [Learn More About Billing](/container-engine/explanation/billing-pricing/billing) ### RTX 5090 GPUs on SaladCloud? We have RTX 5090 GPUs on SaladCloud! There are some things you should know before deploying: * **MINIMUM CUDA VERSION: 12.8** - If your application does not use CUDA 12.8 or later, it will not run on the RTX 5090. * **CUDA 12.8 is not currently compatible with older GPUs** (Apr 24, 2025)- If you are using a docker image that is compatible with the RTX 5090, it will not work on older GPUs. You will need to maintain separate docker images for the RTX 5090 and older GPUs. * [More Info](/container-engine/tutorials/machine-learning/pytorch-rtx5090) ## Security and Compliance ### How does security work on Salad? Every day, 100s of businesses run production workloads on SaladCloud securely. We have several layers of security to keep your containers safe, encrypting them in transit, and at rest. Containers run in an isolated environment on our nodes - keeping your data isolated and also ensuring you have the same compute environment regardless of the machine you’re running on. Learn more about [Security](https://salad.com/security) ### What if a host tries to access my container? Our constant host intrusion detection tests look for operations like folder access, opening a shell, etc. If a host machine tries to access the linux environment, we automatically implode the environment and blacklist the machine. We’re also bringing Falco into our runtime for a more robust set of checks. This diagram explains the SaladCloud architecture to protect workloads from malicious software and suppliers from malicious workloads. ![](https://mintcdn.com/salad/oE6Ic7VdFlh4rKXK/container-engine/images/starting-salad1.png?fit=max\&auto=format\&n=oE6Ic7VdFlh4rKXK\&q=85\&s=403ea8aaa5a2efd3e6045bb03ddc6542) ### What about compliance on Salad? We are SOC 2 Type 1 compliant. You can read more about our compliance [here](https://blog.salad.com/salad-soc-2-certification/). ## Performance ### How does latency work on Salad? Since our GPUs are globally distributed, and often accessed via residential internet connections, latency can be higher on SaladCloud than on datacenter-based clouds. The best use cases for SaladCloud's network are ones that DO NOT have extremely low latency requirements. Many companies run production workloads on SaladCloud with acceptable latency times. One of SaladCloud's largest users is an AI image generation tool that serves millions of users. Our team can work with you on the right architecture to ensure your latency requirements are met. ### How can I be sure a GPU is performant? We use a proprietary trust rating system to index node performance, forecast availability, and select the optimal hardware configuration for deployment. We also run proprietary tests on every GPU to determine their fit for our network. For more on performant GPU infrastructure configuration, view our [Build High-Performance Applications](/container-engine/tutorials/performance/high-performance-apps) tutorial and our [Performance Monitoring](/container-engine/tutorials/performance/performance-monitoring) tutorial. ### Are consumer-grade GPUs good for AI workloads? Yes. Many consumer GPUs on our network offer comparable or even better performance for AI workloads. You can read all our [benchmarks here](https://blog.salad.com/). ## Deployment Info ### How do I troubleshoot issues on Salad? We have a detailed troubleshooting guide [here](/container-engine/how-to-guides/troubleshooting). If you have any issues not covered in the guide, please contact support. ### What should I be aware of before deploying a workload to Salad? * Cold start time is high on SaladCloud. Give it a few minutes to let your containers up and running. * Instances will be interrupted with no warning. Architect your application accordingly, such as retrying failed requests, and running multiple replicas to provide coverage during automatic fail-overs. * Network performance will [vary from node to node](/container-engine/explanation/core-concepts/overview#performance-variability), due the distributed, residential nature of the network. * For Mac developers, be sure to build your containers for amd64, not arm64. If you're looking to implement networking on your instances within a container group by leveraging [SaladCloud's container gateway](/container-engine/explanation/infrastructure-platform/networking), you'll need to [configure IPv6](/container-engine/how-to-guides/gateway/enabling-ipv6) within your container image. ### What happens if a GPU goes offline? Salad Container Engine automatically reallocates your workload to another GPU (same type and class) when a resource goes offline. ### Do you have a checklist to track before deploying a workload to Salad? This checklist is for SCE. For checklists for APIs and SGS, check the relevant docs page. * Test your docker container in a local environment * Make sure you select enough vCPU, RAM, and vRAM for your application * Setup container gateway or a job queue * If you are using the container gateway, [make sure your container is setup for IPv6](/container-engine/how-to-guides/gateway/enabling-ipv6). * Make sure you’re not running an empty container (i.e. Ubuntu) without setting the command to “sleep infinity”. * Run your workload with at least 3 replicas to account for latency. ### What is the expected uptime on SaladCloud? * SaladCloud nodes operate similarly to "spot" instances on other clouds. While individual nodes on SaladCloud have a reliability of 90%-95% (meaning, in a container group of 100 nodes, you will usually have 90+ running nodes at any given time), the combined reliability of the system is higher, thanks to redundancy and higher no. of nodes. * Similar to "spot" instances, SaladCloud using a [Priority Pricing](/container-engine/explanation/billing-pricing/priority-pricing) model, where you can choose the priority of your container group based on your workload requirements. Higher priority workloads may interrupt lower priority workloads. * Here is a real example over 24 hours for a production AI image generation workload with 100 requested nodes. As we would expect, it’s fairly uncommon for all 100 to be running at the same time, but 100% of the time, we have at least 82 live nodes. For this customer, 82 simultaneous nodes offered plenty of throughput to keep up with their own internal SLOs, and provided a 0-downtime experience. ![](https://mintcdn.com/salad/oE6Ic7VdFlh4rKXK/container-engine/images/starting-salad2.png?fit=max\&auto=format\&n=oE6Ic7VdFlh4rKXK\&q=85\&s=3d901588e59769a6b19c1942f30235da) ### Can I change the priority of a running container group? Yes. Priority changes apply to running instances immediately, without restarting or redeploying them. You can raise the priority of a running container group at any time. You can lower the priority of a running container group only after it has been running at its current priority for 1 hour. A request made sooner is rejected and the container group keeps its current priority. To lower it right away, stop the container group, change the priority, and start it again. See [Changing Priority](/container-engine/explanation/billing-pricing/priority-pricing#changing-priority). ### How do I use SSH with Salad? SaladCloud supports both SSH access and a web-based terminal for connecting to running containers. To use SSH, add your public key in the Portal under **SSH Keys**, then click on a running instance to get the SSH command. See [SSH & Terminal Access](/container-engine/explanation/container-groups/ssh-and-terminal) for detailed instructions. ### I need a unique URL for each node. How do I do that? The best way to accomplish this is to create container groups with the Container Gateway enabled and with 1 replica each, because each container group with the Container Gateway enabled receives a static, unique URL. For large numbers of container groups, we recommend managing these container groups programmatically through the API. # Salad Container Engine Overview: How SaladCloud Works Source: https://docs.salad.com/container-engine/explanation/core-concepts/overview How Salad Container Engine runs your containers on a distributed network of consumer GPUs, and what to plan for: interruptions, cold starts, updates, networking, and storage. *Last Updated: October 19, 2026* **Salad Container Engine (SCE)** runs your container image on a distributed network of consumer GPUs. You choose the image, the hardware, and how many replicas to run, and SCE finds nodes, starts your containers, and replaces instances when nodes come and go. There are no virtual machines or clusters to manage. Because it's a distributed network of thousands of machines, many of them individually owned PCs, SaladCloud can offer a wide range of GPUs at a much lower cost than a traditional data center. It also means a few things work differently. Applications built with the points below in mind run well on SaladCloud, and they're also more robust anywhere else. ## How SaladCloud Is Different ### Instances Can Be Interrupted SaladCloud works to keep your instances running with high uptime. Still, we don't have physical control of the machines, so a node can go offline, and instances at a lower [priority](/container-engine/explanation/billing-pricing/priority-pricing) can be replaced by higher-priority work. When that happens, SaladCloud automatically starts a replacement instance on another node. Any cloud can lose a machine, so robust applications handle it anyway. On SaladCloud it's worth planning for from the start: * Run at least 2 replicas, so another instance keeps serving while one is replaced. * Retry failed requests in your clients. * Save progress from long jobs regularly. See [Long-Running Tasks](/container-engine/explanation/job-processing/long-running-tasks). ### Storage Is Temporary Each instance gets its own [disk space](/container-engine/explanation/container-groups/disk-space), up to 250 GB. It's kept while the instance runs and restarts, but a replacement instance on another node starts with an empty disk. Keep anything you need to keep, such as results, checkpoints, or model weights you download at startup, in external storage like Amazon S3, Google Cloud Storage, or Azure Blob Storage. Because nodes are spread around the world, a provider that doesn't charge egress fees, such as Cloudflare R2, can save a lot. ### Cold Starts Take Longer Each node downloads your container image before it starts. Many nodes are on residential internet connections, which are usually slower than a data center's. Plenty of nodes have fast connections, and SaladCloud caches images to speed up downloads, but large images still take a while to arrive, especially on a new node. Images are limited to 35 GB (compressed). You aren't billed while an instance is downloading its image. Billing starts when the container starts running, so a slow download costs time, not money. To start faster, keep images small, especially when you're first iterating or debugging. See [Cold Starts and Iterating Quickly](/container-engine/how-to-guides/cold-starts-and-iterating-quickly). ### Updates Restart Every Replica When you change the image, command, environment variables, or resources, every replica restarts on the new version at about the same time. There's no built-in rolling update. Customers keep services available during updates with patterns like running the new version as a second container group, described in [Deployment Strategies](/container-engine/how-to-guides/deployment-strategies). If rolling updates are important for your workload, [contact us](/support) so we know. ### Performance Variability Nodes that match the same requirements still differ in network speed, CPU, and storage. For example, a container group that requests 2 vCPU, 12 GB RAM, and an RTX 4090 can land on nodes with quite different network performance. Monitor your application's performance over time, and reallocate instances that consistently underperform. ![](https://mintcdn.com/salad/pEBrSzH4UQRtJw00/container-engine/images/node-variability.png?fit=max\&auto=format\&n=pEBrSzH4UQRtJw00\&q=85\&s=69f97a9798c8b116aa191ed0b7be6e62) ### Capacity Is Shared Nodes are shared by all SaladCloud customers. The [availability](/container-engine/explanation/infrastructure-platform/availability) shown when you create a container group is an estimate, not a reservation, and higher priority levels get nodes first. Selecting more than one GPU class makes it easier to find nodes. Your organization also has a [replica quota](/container-engine/reference/quotas), which you can ask to increase. ### Networking Goes Through the Container Gateway To receive requests from the internet, enable the [Container Gateway](/container-engine/explanation/infrastructure-platform/networking). It gives your container group a public URL and load-balances requests across ready instances. Your application must listen on IPv6 (`::`) on the one port you configure. A request fails if your application sends nothing back for 100 seconds, so stream long responses, or use a [job queue](/container-engine/explanation/job-processing/job-queues) for long-running work. ### Containers Run in WSL2 Nodes run Windows, and your container runs in a Linux environment under the Windows Subsystem for Linux (WSL2). Your image must be a Linux image built for AMD64 (x86-64); ARM images and Windows containers aren't supported. If you build on an ARM-based Mac, build for AMD64: ```bash theme={null} docker buildx build --platform linux/amd64 . ``` GPU access works through CUDA on NVIDIA GPUs and ROCm on AMD GPUs. Because the GPU is also used by the Windows host, a small part of its VRAM is reserved for Windows, so your container sees slightly less than the card's full VRAM. Containers can't run in privileged mode or access extra devices. ### Logs Come From Standard Output SaladCloud collects what your application writes to standard output and standard error. See [Container Logs](/container-engine/explanation/container-groups/container-logs). ### Data-Sensitivity Compliance Customers in specialized industries may be legally obligated to protect sensitive data such as medical records or private financial information. While SaladCloud takes precautions to secure every workload on our network, we cannot guarantee that our solutions are considered compliant with requirements outlined by select regulatory commissions or legislative authorities (including but not limited to HIPAA and the Financial Modernization Act of 1999). ## Key Concepts A **container group** is a container image, the hardware it needs, and the number of **replicas** to run. SCE creates or replaces **container instances** as needed to keep that many running. A **container instance** is one run of your container on one node. Each instance has a unique ID and its own logs. When an instance is moved to a different node, it gets a new instance ID. ## Ways to Deploy * **[SaladCloud Portal](https://portal.salad.com):** Create, edit, and monitor container groups in your browser, and manage your organization, billing, and support. * **[SaladCloud API](/reference/api-usage):** Manage container groups from your own code or pipelines. New features sometimes reach the API before the Portal. ## Scaling You can change the replica count at any time in the Portal or the API. SCE can also scale for you: * [Job queue autoscaling](/container-engine/how-to-guides/autoscaling/enable-autoscaling) adds and removes replicas based on the number of jobs waiting in a queue. * [Scheduled scaling](/container-engine/how-to-guides/autoscaling/time-of-day-scaling) changes replicas on a schedule. ## Next Steps * [Quickstart](/container-engine/tutorials/quickstart): Deploy your first container group. * [Architectural Overview](/container-engine/explanation/core-concepts/architectural-overview): How SCE works under the hood. * [Troubleshooting](/container-engine/how-to-guides/troubleshooting): Fix common problems. * [FAQs](/container-engine/explanation/core-concepts/faqs): Answers to common questions. # Container Engine Recipes Source: https://docs.salad.com/container-engine/explanation/core-concepts/recipes-overview Easy-to-deploy templates for deploying common workloads on Salad Container Engine. *Last Updated: July 9, 2025* > [!TIP] > > Dockerfiles and configuration for all recipes can be found in the [SaladCloud Recipes GitHub > repository](https://github.com/SaladTechnologies/salad-recipes/tree/master/src). ## What are Recipes? **Recipes** are pre-configured deployment templates for [Container Groups](/container-engine/explanation/container-groups/container-groups) that make it easy to get started with common workloads. Each Recipe includes a set of default parameters and configurations that can be deployed as-is or customized to meet your specific needs. See also [Recipe Documentation.](/container-engine/reference/recipes/overview) ## How to Use Recipes Recipes can be deployed from the SaladCloud Portal, from the "Create Container Group" page. 1. **Navigate to the Portal**: Visit [https://portal.salad.com](https://portal.salad.com) and log in to your account. 2. **Select your Organization**: If you have multiple organizations, select the one where you want to deploy the Recipe. 3. **Select your Project**: If you have multiple projects, select the one where you want to deploy the Recipe. 4. **Navigate to Container Groups**: Click on the "Container Groups" tab in the left-hand navigation. 5. **Create a New Container Group**: Click the "Deploy a Container Group" button. 6. **Choose a Recipe**: Select a Recipe, either from the "Featured" section, or from the "Recipes" section. 7. **Deploy or Customize**: Review the Recipe parameters and configurations, and click "Deploy" to create the Container Group. The default configuration is chosen for an optimal experience, but you can customize the Recipe to meet your specific requirements, including number of replicas, hardware resources, and more. 8. **Explore the Documentation**: Each recipe has a readme that lives on the container group page once deployed. Additionally, some recipes have additional documentation here or on third party sites. 9. **Monitor and Manage**: Once the Container Group is deployed, you can monitor its status and logs from the Portal. You can also edit and scale the Container Group as needed, including deploying custom docker images. ## Billing Recipes are billed as standard container groups, based on the amount of time any workload replica is running. For more information on billing and pricing, see the [Billing and Pricing](/container-engine/explanation/billing-pricing/billing) section. ## Want to Contribute? We welcome contributions to the SaladCloud Recipes repository! If you have a Recipe you'd like to share, or if you have suggestions for improvements, please submit a pull request or open an issue on the [SaladCloud Recipes GitHub repository](https://github.com/SaladTechnologies/salad-recipes) # Service Performance and Reliability Overview Source: https://docs.salad.com/container-engine/explanation/core-concepts/service-performance To develop high-performance, reliable applications on SaladCloud *Last Updated: May 20, 2026* SaladCloud consists of tens of thousands of globally distributed nodes, primarily high-performance desktop computers and servers running the SaladCloud agent. Each node is equipped with consumer-grade GPUs, along with varying CPU and memory configurations. Node distribution is uneven across regions and countries: nodes in the US and Canada account for 50–60% of the total. When these devices are idle, SaladCloud leverages them to run workloads by dynamically pulling and executing container images. Once a container group is stopped, the image and any associated runtime data are removed from the allocated nodes, which are then released. Due to its distributed architecture, nodes can vary in distance, latency, network throughput to specific endpoints, startup times, uptimes, and processing capabilities—factors that should be carefully considered when designing applications on SaladCloud. ## Startup Times When a container group starts, its image is first pulled from your registry into SaladCloud’s internal caches in Europe and the US (only once), and then distributed to the allocated nodes. Startup times can range from a few minutes to longer, depending on image size and network conditions. Instances on nodes located closer to a cache or with higher throughput typically come online faster. You can further improve startup speed by using smaller images to reduce transfer and decompression time, and by deploying workloads in regions closer to the EU or US. [Our 2025 test](https://github.com/SaladTechnologies/performance-reliability-test-2025/) measured the startup times for 100 container instances at high-priority across all consumer GPU types and regions, using a 5.53 GB image. This metric tracks the number of instances that became operational since startup: ![](https://mintcdn.com/salad/iWPB8RRsH9OyCiWc/container-engine/images/sp1.png?fit=max\&auto=format\&n=iWPB8RRsH9OyCiWc\&q=85\&s=7ae401ce2253d7e7c00d0ccf560fa1cd) Key observations are: * Instances began coming online and reporting results within `3 minutes` of the test start. * `50% of instances` came online by `10 minutes`, `80%` by `20 minutes` and `90%` by `40 minutes`. * The count of online instances then briefly dropped by one, indicating one instance was just reallocated. * By around `80 minutes`, nearly all 100 instances were online, with minor fluctuations afterward due to reallocations. ## Interruptions and Reallocations An instance may go offline after coming online for several reasons. In such cases, a new instance is allocated to continue processing: * **Voluntary Interruptions**: Node owners may temporarily reclaim their resources for their own use, pausing sharing. However, high-priority workloads that run reliably over long periods generate higher earnings, giving owners less incentive to interrupt. * **External Interruptions**: Factors such as power outages, network issues, or hardware failures can also take nodes offline. * **Proactive Reallocations**: During periods of high demand, SaladCloud may reassign resources from lower-priority workloads to higher-priority ones. Applications can also trigger reallocation via IMDS Reallocate API if current instances fail to meet requirements. The same 2025 test also tracked interruptions and reallocations for the 100 container instances over a 7-day period. To avoid the effects of initial allocations, the first two hours after startup were excluded. The hourly and daily reallocation results are shown below: ![](https://mintcdn.com/salad/iWPB8RRsH9OyCiWc/container-engine/images/sp11.png?fit=max\&auto=format\&n=iWPB8RRsH9OyCiWc\&q=85\&s=74dd579584dfc760b0e72c1906fffee5) ![](https://mintcdn.com/salad/iWPB8RRsH9OyCiWc/container-engine/images/sp12.png?fit=max\&auto=format\&n=iWPB8RRsH9OyCiWc\&q=85\&s=7c9e4a4fb57658a9cf41143ce20090c9) Key observations are: * Maximum hourly reallocations: `6` * Average hourly reallocations: `1.1 ( 182 reallocations over 168 hours )` * Reallocations decreased over time, dropping from more than `45 per day` to fewer than `15 per day`, with some fluctuations along the way. **This trend shows that as applications run stably for longer periods on nodes, the likelihood of interruption by node owners decreases.** ## Uptimes Additionally, the 2025 test measured the uptime distributions of instances over the same period, which are primarily influenced by startup times and interruptions. The results show that: ![](https://mintcdn.com/salad/iWPB8RRsH9OyCiWc/container-engine/images/sp13.png?fit=max\&auto=format\&n=iWPB8RRsH9OyCiWc\&q=85\&s=4ad2678e28617b2a2187153e7611be4d) ![](https://mintcdn.com/salad/iWPB8RRsH9OyCiWc/container-engine/images/sp14.png?fit=max\&auto=format\&n=iWPB8RRsH9OyCiWc\&q=85\&s=76022cefbbfa990e7a86a412de6ad1cc) Key observations are: * 100 instances running over 7 days generated `282 samples` (instance runs). * Before the container group was shut down, `182` instance runs had already completed (interrupted) while `100` instances were still running. * `25` instances ran uninterrupted for full 7-day period. * The average uptime across all instance runs (interrupted and uninterrupted) was `60 hours`. * The average uptime of interrupted instance runs was `35 hours`. ## Run-to-Request Ratio The instance run-to-request ratio measures the actual compute capacity available compared to what is requested. For example, if 100 instances are requested and 99 are running, the run-to-request ratio is 99%. When a node goes offline and a replacement is allocated, additional time is required to download and decompress the image before the new instance becomes operational. Because of variations in startup times and uptimes, a 100% run-to-request ratio cannot be consistently guaranteed on SaladCloud’s GPU nodes. Large image sizes can increase startup times, which in turn lowers the run-to-request ratio. To mitigate this, it is often necessary to provision additional instances (5\~10%) beyond the initial plan, particularly for real-time inference workloads. Results from the 2025 test show the instance run-to-request ratio over the 7-day period: ![](https://mintcdn.com/salad/iWPB8RRsH9OyCiWc/container-engine/images/sp15.png?fit=max\&auto=format\&n=iWPB8RRsH9OyCiWc\&q=85\&s=7c0133d2590ee863bfc113ddf3fcd968) Key observations are: * Lowest instance run-to-request ratio: `94%` * Average instance run-to-request ratio: `more than 99%` * The instance run-to-request ratio can `temporarily exceed 100%` from the application’s perspective. When nodes lose connection to SaladCloud (not charged in this case), applications may continue running briefly before the nodes are fully shut down. During this overlap, as new nodes are allocated and start running, the number of active instances can temporarily exceed the original request. ## Processing Performance Nodes with the same consumer GPU type can exhibit different performance due to factors such as system configuration (CPU, RAM), clock speed, cooling, and power limits. Even for the same node, performance may fluctuate over time because of temperature changes and cooling efficiency. Based on our tests, over 90% of SaladCloud’s consumer GPU nodes provide stable and consistent performance. Here is an instance run from the 2025 test, illustrating stable performance (black line) and resource usage over the 7-day execution period. ![](https://mintcdn.com/salad/iWPB8RRsH9OyCiWc/container-engine/images/sp16.png?fit=max\&auto=format\&n=iWPB8RRsH9OyCiWc\&q=85\&s=a97e800448b4642bbf2fdfaff1f08f83) Another instance run from the same test highlights performance fluctuations due to temperature changes: as GPU temperatures increased, performance declined. ![](https://mintcdn.com/salad/iWPB8RRsH9OyCiWc/container-engine/images/sp17.png?fit=max\&auto=format\&n=iWPB8RRsH9OyCiWc\&q=85\&s=6d6ccbcbeeedf98c37d16ef5db2d3077) To manage performance variances and fluctuations from a small number of consumer GPU nodes, we recommend conducting an initial check and real-time performance monitoring to select suitable nodes and ensure they remain in an optimal state for application execution. For more details, please refer to [this guide](/container-engine/tutorials/performance/high-performance-apps#build-high-performance-applications). ## Network Performance Salad nodes with consumer GPUs often exhibit asymmetric bandwidth, as many operate on residential networks with high download speeds—frequently hundreds of Mbps—but lower upload speeds, sometimes only tens of Mbps. The 2025 test results, based on over 200 consumer GPU nodes performing upload and download tasks, reveal significant speed variance and bandwidth asymmetry. Nevertheless, a substantial number of nodes still provide symmetric bandwidth and strong overall performance. ![](https://mintcdn.com/salad/iWPB8RRsH9OyCiWc/container-engine/images/sp4.png?fit=max\&auto=format\&n=iWPB8RRsH9OyCiWc\&q=85\&s=de81d090fcbf67fdbcadbb1d436d3787) Round-trip time (RTT) is primarily determined by the geographical distance and underlying network latency between two endpoints, and it plays a critical role in data transfer throughput. Since Salad nodes are globally distributed, nodes with identical network speeds in different regions can exhibit varying throughput to a specific endpoint, such as a cloud storage bucket in a particular location. Transfer tools and algorithms also matter—using chunked and parallel data transfers can better utilize the available end-to-end bandwidth. If your applications require higher throughput with lower latency, perform startup checks from inside the container and request reallocation only when a node does not meet a real workload requirement. SaladCloud does not provide a container group setting or node filter for minimum network bandwidth. Please check [this guide](/container-engine/tutorials/performance/network-bandwidth-checks) for more information. # Error Pages Source: https://docs.salad.com/container-engine/explanation/gateway/error-pages *Last Updated: October 7, 2026* When the Container Gateway is configured for a container group, it will be assigned an Access Domain Name URL. If you try to access that URL in your browser, and encounter an error, we provide error messaging to help you understand the nature of the error. Errors can occur, for example, when a container has not been fully set up yet, or has failed. ## 400 ![](https://mintcdn.com/salad/Q-b7u7-avMFxB0Ze/container-engine/images/container-gateway-error-400.png?fit=max\&auto=format\&n=Q-b7u7-avMFxB0Ze\&q=85\&s=80eb5323279be3c9a355e8836eea229f) ## 401 ![](https://mintcdn.com/salad/Q-b7u7-avMFxB0Ze/container-engine/images/container-gateway-error-401.png?fit=max\&auto=format\&n=Q-b7u7-avMFxB0Ze\&q=85\&s=00d2fbadd51c8a84a442094778deba65) ## 403 ![](https://mintcdn.com/salad/Q-b7u7-avMFxB0Ze/container-engine/images/container-gateway-error-403.png?fit=max\&auto=format\&n=Q-b7u7-avMFxB0Ze\&q=85\&s=bb154bccd3653d80e867e8098b44762c) ## 404 ![](https://mintcdn.com/salad/Q-b7u7-avMFxB0Ze/container-engine/images/container-gateway-error-404.png?fit=max\&auto=format\&n=Q-b7u7-avMFxB0Ze\&q=85\&s=6dfb65dfc2ecf6bd79f28761cb74945c) ## 408 ![](https://mintcdn.com/salad/Q-b7u7-avMFxB0Ze/container-engine/images/container-gateway-error-408.png?fit=max\&auto=format\&n=Q-b7u7-avMFxB0Ze\&q=85\&s=5185af32e6cc977e40302257bf4bf052) ## 410 ![](https://mintcdn.com/salad/Q-b7u7-avMFxB0Ze/container-engine/images/container-gateway-error-410.png?fit=max\&auto=format\&n=Q-b7u7-avMFxB0Ze\&q=85\&s=3c8ca844e091bad23296384db3cf5518) ## 413 If you try to send large files over the URL. Currently the maximum request size is set to 1GB by the Container Gateway and its related services. ![](https://mintcdn.com/salad/Q-b7u7-avMFxB0Ze/container-engine/images/container-gateway-error-413.png?fit=max\&auto=format\&n=Q-b7u7-avMFxB0Ze\&q=85\&s=eeab0788f30436c2caf02ad146c4701f) ## 500 ![](https://mintcdn.com/salad/Q-b7u7-avMFxB0Ze/container-engine/images/container-gateway-error-500.png?fit=max\&auto=format\&n=Q-b7u7-avMFxB0Ze\&q=85\&s=ff0ccdc721dba407a9160449b3848e4f) ## 501 ![](https://mintcdn.com/salad/Q-b7u7-avMFxB0Ze/container-engine/images/container-gateway-error-501.png?fit=max\&auto=format\&n=Q-b7u7-avMFxB0Ze\&q=85\&s=1d8c8d898f831ebc4490891b0ba6bfaf) ## 502 ![](https://mintcdn.com/salad/Q-b7u7-avMFxB0Ze/container-engine/images/container-gateway-error-502.png?fit=max\&auto=format\&n=Q-b7u7-avMFxB0Ze\&q=85\&s=c35f8c4ff5e1887d3bda600a81727253) ## 503 It is possible to get this 503 error, if you have [health probes](/container-engine/explanation/infrastructure-platform/health-probes) configured that are not yet passing If a 503 occurs, check that it is passing on at least 1 instance. If the instance has only just become ready, there may be a short delay before the gateway starts routing traffic to it. ![](https://mintcdn.com/salad/Q-b7u7-avMFxB0Ze/container-engine/images/container-gateway-error-503.png?fit=max\&auto=format\&n=Q-b7u7-avMFxB0Ze\&q=85\&s=e31ab6d1586f8af9091f2faf469ea8e9) ## 504 ![](https://mintcdn.com/salad/Q-b7u7-avMFxB0Ze/container-engine/images/container-gateway-error-504.png?fit=max\&auto=format\&n=Q-b7u7-avMFxB0Ze\&q=85\&s=82b6675ab96efbb18a3582f63cf88ac0) # Load Balancing Options Source: https://docs.salad.com/container-engine/explanation/gateway/load-balancer-options *Last Updated: September 3, 2025* When you enable the container gateway during container group creation, several load balancing (LB) options determine how requests are forwarded to the container instances, including algorithms, concurrency and timeouts. These settings cannot be changed once a container group is created. To modify the container gateway settings, you can duplicate the existing container group, create a new one, and apply the desired changes. # Simulator Try the [Container Gateway Simulator](https://gateway-simulator.saladexamples.com/index.html) to better understand all of the concepts described here, and how they impact system performance. # Settings ![](https://mintcdn.com/salad/pEBrSzH4UQRtJw00/container-engine/images/load-balancer-options-1.png?fit=max\&auto=format\&n=pEBrSzH4UQRtJw00\&q=85\&s=e0a9b79f15e2c554c2c8a59852d11bde) ## Algorithms There are two load balancing algorithms currently supported by SaladCloud: Round Robin and Least Number of Connections. **Round Robin:** This algorithm evenly distributes incoming requests to instances within a container group in a sequential and cyclical order, without considering the instance’s current load or processing power. It is ideal for a container group using the single GPU type, especially when all requests have similar processing time and the workload is light. **Least Number of Connections:** This algorithm continuously monitors the load on each instance and directs new requests to those with the fewest active connections. By prioritizing the least-loaded instances and preventing any one from becoming overwhelmed, it balances workloads more effectively and optimizes system performance, resulting in greater efficiency and reliability. Processing time for AI inference can vary significantly based on factors like image size, context length, and audio duration. Additionally, deploying a container group with multiple GPU types that share the same VRAM size but have different processing capabilities can further complicate this variability. **In most cases, the Least Number of Connections algorithm can effectively manage these differences and is recommended for optimal performance.** ## Concurrency To enhance overall performance and throughput, the container gateway typically utilizes multiple connections to each instance and sends multiple requests to the instance concurrently. For inference servers, it is ideal to design them to handle multiple simultaneous requests. This includes incorporating a local queue to buffer requests, the ability to accept new requests during inference (non-blocking I/O), explicitly rejecting excessive requests as a back-pressure mechanism when the queue is full, and supporting batched inference by grouping incoming requests or performing single inference. Some inference servers support streaming mode, enabling real-time responses during the inference process rather than waiting for the entire process to complete. This capability is particularly useful for LLMs. In contrast to batched or single inference, using multiprocessing or multithreading for concurrent inference on a single GPU may limit optimal GPU cache utilization and negatively impact performance; therefore, this approach should generally be avoided. **To support various inference servers and use cases, two settings are available for concurrency:** **When the option - “Limit each server to a single, active connection” is unselected**, the container gateway will establish multiple connections per instance and forward concurrent requests to the inference server in the container. This server should be capable of handling multiple requests simultaneously, including a local queue, use non-blocking I/O and have a back-pressure mechanism. **When the option - “Limit each server to a single, active connection” is selected**, the container gateway will use a single active connection per instance and only forward one request at a time to an instance, even when using HTTP/2 multiplexing. **New requests will wait and be queued by the container gateway until the current one is processed and a response is returned by the instance.** This configuration ensures that an instance receives and processes only one request at any time. Note that a WebSocket connection treated as a single request. For single inference tasks, such as generating an image at a time, choosing this option can significantly simplify the implementation of the inference server by using synchronous calls. **Otherwise, this option will reduce system throughput and should be avoided.** ## Client Request Timeout This setting (millisecond) determines how long a request can be waiting and queued in the container gateway before being sent, after which a timeout error is returned to the client. The default is **100 seconds** (or 100000 milliseconds), which is the maximum allowable waiting time for queued requests. **When a container gateway is configured to use multiple connections per instance, this setting can be ignored**, as all requests are sent to the instance immediately and would be queued by the inference server. **However, if a container gateway is configured to use a single active connection per instance, the setting is crucial in influencing the system behavior:** * **If set too low, the system may struggle to handle burst traffic.** * **If set too high, it could result in longer waiting times on the client side.** This setting should be determined carefully based on the application requirements. In the long term, the system resources must align with the workload. If the client frequently encounters errors, such as client request timeout errors from the container gateway, or queue full errors from the inference server, you may need to increase or adjust resources to enhance processing capability. Alternatively, you can implement flow control and retry mechanisms on the client side to stop accepting new user requests, rather than letting them be dropped within the system. ## Server Response Timeout This setting (millisecond) determines how long the container gateway will wait for a response from the instance after sending a request. If no response is received within this timeframe, a timeout error is returned to the client, preventing prolonged waits for responses that may never arrive. The default value is **100 seconds** (100000 milliseconds), which is the maximum allowable waiting time for a response. A 100-second timeout is generally sufficient for many tasks, including image generation and classification. However, for LLMs, the decoding process for very long conversions may take a few minutes. **If the inference server operates in streaming mode - providing responses immediately after the first token is generated rather than waiting for the entire process to complete, LLM applications can still function effectively with the container gateway.** **The container gateway is not intended for long-running tasks, such as molecular simulations and long audio transcriptions, which would take hours or days to complete for each job. These tasks should instead be managed using a job queue.** # Common Errors and Their Causes Generally, the inference server handles multiple tasks for each request, including downloading/uploading, pro-processing, post-processing and GPU inference. These tasks take time and may encounter errors along the way. When the client sends a burst of requests to the instances through the container gateway, the following common errors related to these LB options may arise: -The client may encounter server response timeout errors (524) if processing certain requests on the inference server takes longer than the server response timeout. -If the inference server runs a single thread with blocking I/O, it cannot accept new requests during inference, which may result in connection timeout errors (504). -If requests wait in the container gateway for more than the client request timeout, the client may receive connection timeout errors (504). -The client may receive server-side errors (500) if the inference server encounters issues or crashes during inference. -If the local queue of the inference server is full, the server may reject new requests and return errors (400 or 500) with custom messages. **You may receive some of these error messages from Cloudflare, as the container gateway is built on top of it.** For more information about error messages, please refer to [this link](/container-engine/explanation/gateway/error-pages). # WebSockets Source: https://docs.salad.com/container-engine/explanation/gateway/websockets *Last Updated: October 10, 2024* When using long-lived WebSocket connections with SaladCloud's Container Gateway, there are a couple things you need to be aware of. 1. The WebSocket protocol doesn't allow passing headers of any kind, including authorization headers. This means you must disable authentication when you enable the Container Gateway for your container group. Your container will get assigned a highly unique domain name as a secure alternative to the `Salad-Api-Key` header. 2. Idle connections get terminated after 100 seconds. This means you need to send a heartbeat through the WebSocket connection periodically to keep the connection alive. # Job Queue Autoscaling Overview Source: https://docs.salad.com/container-engine/explanation/infrastructure-platform/autoscaling Learn how SaladCloud Job Queue autoscaling automatically adjusts container instances based on queue depth to optimize performance and cost for batch processing workloads. *Last Updated: October 7, 2026* > Treat queue length, quota, and capacity as live values. Use the [Job Queue autoscaling > runbook](/agents/container-engine/configure-job-queue-autoscaling), verify the queue/group association, and observe > actual instances and job state before claiming scale-up or scale-down succeeded. **Job Queue Autoscaling** in SaladCloud dynamically adjusts the number of container instances based on the number of jobs in your SaladCloud job queues. This ensures that your infrastructure scales up when job volume increases and scales down during low usage periods, optimizing both performance and cost efficiency. Job Queue autoscaling integrates directly with SaladCloud's managed queue service and the Job Queue Worker to provide seamless scaling for batch processing and job-based workloads. ## Prerequisites Before you can enable Job Queue autoscaling, you must configure the Job Queue: 1. Ensure that [**SaladCloud Job Queues**](/container-engine/explanation/job-processing/job-queues) are enabled for your container group. 2. Verify that your application can handle scaling with multiple container instances. 3. Review the [Job Queue Autoscaling Settings](/container-engine/reference/autoscaling/settings) to understand how to fine-tune autoscaling for your workloads. > [!TIP] > > Get jobs running end to end with a fixed replica count first, then attach the autoscaler. See [Cold Starts and > Iterating Quickly](/container-engine/how-to-guides/cold-starts-and-iterating-quickly). ## Example Use Case Let's say you run a batch processing workload, but the number of jobs you receive is inconsistent. Sometimes, there are no jobs at all, and you want to scale down to zero instances to avoid paying for unused compute resources. By setting the **Minimum Replicas** to 0, the Job Queue autoscaler will automatically scale down to zero when the queue is empty, which means you don't pay for any resources when there is no workload. However, this will result in cold starts when new jobs arrive. Cold starts occur when the system needs to initialize new instances, which can introduce a delay while containers are started from an inactive state. At other times, you might experience a spike where thousands of jobs need to be processed quickly. By setting the **Maximum Replicas** to 100, you can scale up and process all the jobs much faster. Even though you're using more instances, you're still paying for the same amount of compute hours you would have spent on one instance, but the jobs are completed 100 times faster, reducing overall processing time. *** Ready to configure Job Queue autoscaling? Learn more about the available [Settings](/container-engine/reference/autoscaling/settings) or [Set Up Job Queue Autoscaling](/container-engine/how-to-guides/autoscaling/enable-autoscaling) in SaladCloud. # Availability Source: https://docs.salad.com/container-engine/explanation/infrastructure-platform/availability Learn how to access and interpret the availability of CPU and GPU resources at different priority levels on SaladCloud. *Last Updated: October 19, 2026* > Do not infer current capacity from this page or its screenshot. Use the `salad-container-engine-preflight` skill and > call `list_gpu_classes` followed by the current GPU or CPU availability operation with the exact hardware, country, > and priority plan. Record the UTC observation time. SaladCloud provides estimated availability to help you understand how many nodes are available to run your workloads at different [priority levels](/container-engine/explanation/billing-pricing/priority-pricing#priority-levels). Availability is shown in the SaladCloud Portal when creating container groups and via the [Get GPU Availability](/reference/saladcloud-api/organizations/get-gpu-availability) and [Get CPU Availability](/reference/saladcloud-api/organizations/get-cpu-availability) API endpoints. ![Availability shown in the Portal](https://mintcdn.com/salad/lmi25xqe590w-U5r/container-engine/images/availability.png?fit=max\&auto=format\&n=lmi25xqe590w-U5r\&q=85\&s=86913155f2d69a8f380b3597cfab79fd) In the portal, availability is shown under the Estimated Cost when creating a container group. The numbers indicate how many nodes are currently online and available to run workloads at each priority level. In this example, there are 557 nodes available at the "Lowest" priority level and 1,950 nodes available at the "Low" priority level. Clicking a priority level card will update the priority level of the container group. Keep in mind the following considerations when interpreting availability counts: * **Availability only includes currently online nodes.** Many more nodes are available on our network and can be activated as needed. If you need more capacity than is currently available, reach out to [SaladCloud support](/support) and we can work to grow the network based on anticipated needs. * **Node allocation depends on multiple factors, not just priority level.** Even if few nodes are shown as available at your selected priority level, your workload may be able to be allocated nodes from other workloads. For example, if your workload has higher RAM requirements, nodes from same-priority workloads may be reallocated to meet those needs. * **Nodes where your workload exited will still appear in availability counts.** Availability data can include nodes that previously ran your workload and exited with a non-zero exit code and will not be reassigned to it. Check your workload’s system events to confirm whether it has failed on nodes. * **Available nodes may not be immediately reassigned.** Some nodes stay with their current workloads for a period before being reallocated. This prevents excessive workload churn and repeated image pulls. How long a node stays depends on the priority level of the workload it is running, and nodes running high-priority workloads are not reallocated to other workloads. ## Choosing GPU Classes Availability depends heavily on which GPU classes you select. When you choose them: * **Start with VRAM.** Your model and its working memory must fit in the GPU's memory, with some room to spare, because a small part of each GPU's VRAM is reserved for the Windows host. The [List GPU Classes](/reference/saladcloud-api/organizations/list-gpu-classes) endpoint and [salad.com/pricing](https://salad.com/pricing) show the VRAM of each class. * **Select every class that fits.** Each instance can run on any of the classes you select, so more classes means more nodes to choose from and faster allocation. Classes differ in speed and price, so check which GPU an instance received (for example, with `nvidia-smi`) when comparing performance. * **Stay with one vendor.** An image built for CUDA runs on NVIDIA GPUs and an image built for ROCm runs on AMD GPUs, so select classes from the vendor your image supports. See [AMD GPUs and ROCm](/container-engine/reference/amd-gpus). * **Choose a priority.** Higher [priority levels](/container-engine/explanation/billing-pricing/priority-pricing) get nodes first and aren't interrupted by lower-priority work, but cost more per hour. * **Check availability when you plan.** Availability changes throughout the day, so check it before you deploy or change GPU classes, rather than polling it continuously. # Container Registries Source: https://docs.salad.com/container-engine/explanation/infrastructure-platform/container-registries *Last Updated: November 22, 2024* A container registry is a collection of repositories designed to efficiently store and distribute container images. SCE integrates with the most popular container registries, allowing you to use your existing build pipelines to create and manage your container images. When a Container Group is created, SaladCloud will automatically pull the image from your registry into a private container registry that is managed by Salad, allowing us to generate 1-time access tokens that are only distributed to specific machines that are designated to run your application. SaladCloud supports both Public and Private Registries, many providers offer both options depending on your specific requirements. A private registry allows users to store and distribute container images without making them publicly accessible. This allows for better control over the distribution of images, as well as the ability to keep proprietary or sensitive information secure. # Specifying the Container Image Source When configuring a Container Group for deployment, you'll need to specify the source of the container image. If your image is hosted on the Docker Hub Registry, you don't need to include the registry name. If your image is hosted on another registry, such as GitHub Container Registry, you'll need to include the registry path. This path is similar to a URL, but doesn't contain a protocol specifier (e.g. `https://`). You may optionally append a tag, as well. Note that if no tag is supplied, the `:latest` tag will be used by default. > ```shell theme={null} > docker manifest inspect $REMOTEIMAGESOURCE > ``` > > If you're building using Docker, you can specify the output manifest spec using `buildx`: > > ```shell theme={null} > docker buildx build \ > -t $LOCALIMAGESOURCE \ > --provenance=false \ > --output type=docker \ > . > ``` ### Examples * Image hosted on Docker Hub, with the tag `v1` - * Full URL: `docker.io/my-name/imagename:v1` * Shortened URL: `my-name/imagename:v1` * Image hosted on GHCR, latest version - `ghcr.io/my-org/imagename` # Supported Registries Details of using a Private Container Registry with SaladCloud will vary depending on the private registry used. Guides for supported registries are linked here: * [Google Container Registry](/container-engine/how-to-guides/registries/gcp-gar) * [Azure Container Registry](/container-engine/how-to-guides/registries/azure-acr) * [Docker Hub](/container-engine/how-to-guides/registries/dockerhub) * [Amazon Elastic Container Registry (ECR)](/container-engine/how-to-guides/registries/aws-ecr) * [Quay Container Registry](/container-engine/how-to-guides/registries/quay) * [GitHub Container Registry](/container-engine/how-to-guides/registries/github-ghcr) * Self-Hosted or Basic Auth > 👀 Missing a Registry? > > We're working to expand the supported registries on SaladCloud. If you're using a registry not listed here, please > [get in touch](mailto:cloud@salad.com)! # Requirements To use a registry, an image must first be pushed to the registry. This can be done using the docker push command, specifying the registry URL and the image name. Once the image is in the registry, it can be pulled and used to create a new Container Group through the Portal or the Public API. * SaladCloud requires authentication details to pull images, but authentication details are only stored long enough to pull the image and place it into encrypted storage for distribution to the SaladCloud Network. * When we distribute a workload to a node, we generate a 1 time access token, allowing only specific node(s) to download and run the container image * There currently a max **image size of 35 GB (note: subject to change)** * We pull and store images at moment of container group creation, so if the image is modified you will have to create a new container group ### View Status When Creating a Container Group * While the image is being pulled and stored, the container group status will be "pending" * Once the image is ready, the container group status will change to stopped, and the container group can be started. ### Failures A few unique failures can occur when pulling an image from a registry * **Failure to authenticate**: This will occur if we are unable to authenticate to the private registry with the credentials provided. Double check the credentials are correct and try again. * **Failure to store**: This will occur if we are unable to store the container image. This should be a temporary condition so try again. * **Image too large**: This will occur if the container image is too large. You will need to use a smaller container image. If issues persist, **[please contact support here.](mailto:cloud@salad.com)** # Caching of Container Images Encrypting and caching image layers on compatible nodes allows us to start your container images much faster in the event the workload fails over to a new node or you make small updates to your container image. By caching image layers across our network, startup and failover times are significantly decreased for workloads using those image layers. Without image layer caching, any time a new node needs to start your container image, the new node would need to download the entire image. All image layers from public repositories are automatically cached across the network for up to 30 days. Image layers from private repositories are optionally cached for up to 30 days. Image layers from private repositories may be cached for up to 5 minutes to allow for restarts after brief interruptions. Note that all container images across the SaladCloud network are encrypted (AES-256) from when they are pulled up until the image is ready to be started on the node. # External Logging Source: https://docs.salad.com/container-engine/explanation/infrastructure-platform/external-logging *Last Updated: November 12, 2026* You may wish to stream event logs from your container group deployment to an external service for easier parsing, retention, and monitoring. To configure external logging, click 'edit' on the External Logging Services section on the Container Group Deployment page. External logging is also the way to read logs continuously or in high volume. Reading logs through SaladCloud counts against [daily log query limits](/container-engine/explanation/container-groups/container-logs#daily-log-query-limits), but logs streamed to your own service arrive as they're written, with no polling and no SaladCloud query limit. ![](https://mintcdn.com/salad/pEBrSzH4UQRtJw00/container-engine/images/portal-edit-external-logging.png?fit=max\&auto=format\&n=pEBrSzH4UQRtJw00\&q=85\&s=735c47c96ef27e47c2aa826331b109d1) In the sidebar that appears, select the logging service you wish to use. > ❓ Logging service not supported? > > We're working to expand the logging services supported on SaladCloud. If you're using an external logging service not > listed here, please [get in touch](mailto:cloud@salad.com)! > > Under the hood, SaladCloud uses [Fluent Bit](https://docs.fluentbit.io/manual/pipeline/outputs) to collect and send > container logs. Check the Fluent Bit documentation here to see if your preferred logging service is supported out of > the box. If so, we can easily add support for it - just let us know. ![](https://mintcdn.com/salad/ko38nW-LNf6N2Y1I/container-engine/images/portal-select-logging-service.png?fit=max\&auto=format\&n=ko38nW-LNf6N2Y1I\&q=85\&s=0880e2949b572579576ce51ffc4927ce) Finally, fill out the form fields and press Configure. ![](https://mintcdn.com/salad/pEBrSzH4UQRtJw00/container-engine/images/portal-configure-logging-service.png?fit=max\&auto=format\&n=pEBrSzH4UQRtJw00\&q=85\&s=d3494e8e9e24f54bc826b941450a4f26) > 📘 Don't have an external logging provider? > > Check out the [Container Logs](/container-engine/explanation/container-groups/container-logs) feature in the > SaladCloud Portal. # Health Probes Source: https://docs.salad.com/container-engine/explanation/infrastructure-platform/health-probes *Last Updated: October 19, 2026* # Overview Health probes provide an automated way for SaladCloud users to trigger certain actions based on the status of the containers in a container group deployment. SCE supports three types of probes: Startup, Liveness, and Readiness probes. These probes run for each container deployed in the container group. If configured, the Startup probe runs first, and the Liveness/Readiness probes (if configured) are suspended until after the Startup probe is successful. > ⚠️ Caution > > Health probes can be extremely useful for catching deadlocks in an application, recovering from errors during > container initialization, and ensuring local resources are available before exposing nodes via the Container Gateway. > > However, misconfigured health probes can easily cause unnecessary termination of containers, leading to slower > deployment and less reliable application uptime. It is important to first understand the normal behavior of your own > containers on SaladCloud in order to minimize false positives when configuring health probes. # Probe Protocols Salad Container Engine (SCE) supports four probe protocols: `exec`,` TCP`, `gRPC`, and` HTTP/1.X`. These protocols provide a way to check the health of containers and trigger actions based on the results of the probes. ## `Exec Protocol` The exec protocol executes a command inside the container and checks the exit code. If the exit code is zero, the probe is considered successful. If the exit code is non-zero, the probe is considered a failure. Parameters for this protocol include: * **Command :** The command to be executed within the container. * *Example:* Command : `cat`and argument `/etc/hostname` ## `TCP Protocol` The TCP probe checks whether a TCP port inside the container is open and ready to accept the traffic. The probe sends a SYN packet to the port and checks the response code. If the response code indicates that the port is open, the probe is considered successful. Note that using TCP probes without a Container Gateway enabled may result in unexpected behavior. Parameters for this protocol include: * **Port:** The port number for the TCP connection (between 1 to 65535). * *Example:* `8080` ## `gRPC Protocol` The gRPC probe checks the health of a gRPC service running inside the container. The probe sends a request to the service and checks the response code. Parameters for this protocol include: * **Service:** The service field used to distinguish between different types of probes or features. * *Example:* `"liveness"` service field in gRPC allows you to differentiate between probes of different types or for different features. * **Port:** The port number for the gRPC connection (between 1 to 65535). * *Example:* `50051` ## `HTTP/1.X Protocol` The HTTP/1.X probe checks the health of an HTTP service running inside the container. The probe sends an HTTP GET request and checks the response code. Parameters for this protocol include: * **Path**: The path for the HTTP request. * *Example*: `/healthz` * **Port**: The port number for the HTTP connection (between 1 to 65535). * *Example*: `80` ## Common Probe Protocol Parameters * `Initial Delay Seconds`: Number of seconds after the container starts before probes are initiated. * `Period Seconds`: How often (in seconds) to perform the probe. * `Timeout Seconds`: Number of seconds after which the probe times out. * `Success Threshold`: Minimum consecutive successes for the probe to be considered successful. * `Failure Threshold`: Number of consecutive failures of the probe before the container is reallocated. # Probe States Each probe can be in 1 of 3 states: * `Unknown`- The container is neither in a success or failure state yet. Causes no change to the system. * `Success` - The probe has met the `successThreshold` and has not yet failed. * `Failure` - The container failed the diagnostic. In the case of a failed Startup or Liveness probe, the container will be automatically reallocated to a new node. In the case of a failed Readiness probe, the container will continue to run on the node, but no networking traffic will be routed to it. # Probe Timing ## Startup Probe ### Successful Startup Probe ![](https://mintcdn.com/salad/oE6Ic7VdFlh4rKXK/container-engine/images/startup-success.png?fit=max\&auto=format\&n=oE6Ic7VdFlh4rKXK\&q=85\&s=5abc4db02f375ea8a7fd8c62282d7cb6) ### Failed Startup Probe ![](https://mintcdn.com/salad/oE6Ic7VdFlh4rKXK/container-engine/images/startup-failure.png?fit=max\&auto=format\&n=oE6Ic7VdFlh4rKXK\&q=85\&s=b0f17053349bdf0303f331e853a6204d) ## Liveness Probe ### Successful Liveness Probe ![](https://mintcdn.com/salad/FAbpq_8Gi6WzwO0s/container-engine/images/liveness-success.png?fit=max\&auto=format\&n=FAbpq_8Gi6WzwO0s\&q=85\&s=17bc3df45d4143c26e353b734a23f0d2) ### Failed Liveness Probe ![](https://mintcdn.com/salad/FAbpq_8Gi6WzwO0s/container-engine/images/liveness-failure.png?fit=max\&auto=format\&n=FAbpq_8Gi6WzwO0s\&q=85\&s=1318ba39d2101ed92fd565ed2a2f269c) ## Readiness Probe ### Successful Readiness Probe ![](https://mintcdn.com/salad/ko38nW-LNf6N2Y1I/container-engine/images/readiness-success.png?fit=max\&auto=format\&n=ko38nW-LNf6N2Y1I\&q=85\&s=952d31cbda9b336b07fe2a7249bb770b) ### Failed Readiness Probe ![](https://mintcdn.com/salad/ko38nW-LNf6N2Y1I/container-engine/images/readiness-failure.png?fit=max\&auto=format\&n=ko38nW-LNf6N2Y1I\&q=85\&s=69c6f8b248a78903bf184769d4dcd111) # Enabling Health Probes Each of these probes can be configured from the container group configuration page by clicking the edit button beside each probe section. ![](https://mintcdn.com/salad/pEBrSzH4UQRtJw00/container-engine/images/portal-edit-probes.png?fit=max\&auto=format\&n=pEBrSzH4UQRtJw00\&q=85\&s=4e27e4d1cd0a0d0cc52545f7a75a317d) # Probe Configuration SaladCloud provides comprehensive protocol support, including `exec`, `gRPC`, `TCP`, and `HTTP`. To perform a probe, SaladCloud executes the command you specify in the target container. To configure a command, press the Edit link as shown below. ![](https://mintcdn.com/salad/oE6Ic7VdFlh4rKXK/container-engine/images/startup-exec-edit-command.png?fit=max\&auto=format\&n=oE6Ic7VdFlh4rKXK\&q=85\&s=3d4272a6d8f95974aeed7f0a04532262) Configure the command and any additional arguments. In this example, the container will attempt to read a file located at `/tmp/healthy` exactly `Initial Delay Seconds` after startup. If it successfully executes the command within `Timeout Seconds`, the probe returns an exit code 0. Once this has happened `Success Threshold` times, the Startup probe is 'done' and the Liveness and Readiness probes (if configured) are initiated. ![](https://mintcdn.com/salad/oE6Ic7VdFlh4rKXK/container-engine/images/startup-exec-config-command.png?fit=max\&auto=format\&n=oE6Ic7VdFlh4rKXK\&q=85\&s=d1bcbd02aae1990d49fad3a57adcde64) ## Standard Probe Properties All probes (Startup, Liveness, and Readiness) share the following properties. | Property | Type (Min, Max) | Details | | :- | :- | :- | | **Initial Delay Seconds** | Integer (0 - 1,200) | The number of seconds after the container has started before the probe is initiated. If a Startup probe is configured, the initial delay for Liveness and Readiness probes begins counting when the Startup probe has reached the success threshold. | | **Period Seconds** | Integer (1 - 120) | How often, in seconds, to perform the probe. | | **Timeout Seconds** | Integer (1 - 60) | After a probe initiates, the number of seconds to wait for a successful response before timing out (failing). | | **Success Threshold** | Integer (1 - 10) | The minimum consecutive successes for the probe to return a 0 (success) for the probe to be considered successful. | | **Failure Threshold** | Integer (1 - 20) | The number of consecutive failures of the probe before the container is reallocated (in the case of Startup and Liveness probes) or Container Gateway (networking) is disabled (in the case of Readiness probes). | # Further Reading In SCE, the Startup, Liveness, and Readiness probes were designed based on the Kubernetes specifications. For additional information on how probes work under the hood, as well as excellent examples of configured probes and common pitfalls, check out the Kubernetes documentation on [configuring probes ](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/)and [when to use each one](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/). [Health Probe Deep Dive](https://cloud.redhat.com/blog/liveness-and-readiness-probes) # Instance Metadata Service (IMDS) Overview Source: https://docs.salad.com/container-engine/explanation/infrastructure-platform/imds *Last Updated: October 15, 2024* The SaladCloud Instance Metadata Service (IMDS) provides your container instances with data and operations that you can use to configure and manage your applications. IMDS is a REST API available at the non-routable IPv4 address `169.254.169.254` on port `80`. IMDS is only accessible from within a running container instance on SaladCloud, and the requests never leave the SaladCloud Node. HTTP clients in your container instances must bypass any web proxies when calling IMDS. ## Access IMDS To access IMDS, create a Container Group through the SaladCloud API or the SaladCloud Portal, open a terminal to a running container instance through the SaladCloud Portal, and use the following sample. The `/v1/status` endpoint can be used to get the health statuses of the running container instance. Call the endpoint from the terminal using `curl`: ```sh theme={null} curl -s -H "Metadata: true" --noproxy "*" http://169.254.169.254/v1/status ``` > [!NOTE] > > You can \[learn more]\[1] about this command and its arguments on the awesome [https://explainshell.com](https://explainshell.com) website. This returns the health statuses of the running container instance as a JSON string. This example response is pretty-printed for readability. ```json theme={null} { "ready": true, "started": true } ``` Other endpoints are provided to get an identity token for the running container instance and to reallocate the container instance to another SaladCloud Node. Refer to the [IMDS API Reference](/reference/imds/) for more details. ## IMDS SDKs We provide SDKs to facilitate IMDS integrations from your applications. We strongly encourage the use of the IMDS SDKs over custom HTTP client integrations whenever possible. Refer to the package READMEs for more details on installation and configuration. > [card] [Python](https://pypi.org/project/salad-cloud-sdk/) > > PyPI > [card] [JavaScript (TypeScript)](https://www.npmjs.com/package/@saladtechnologies-oss/salad-cloud-imds-sdk) > > npm > [card] [Java (Kotlin)](https://central.sonatype.com/artifact/com.salad.cloud/imds-sdk) > > Maven Central Repository > [card] [Go](https://github.com/SaladTechnologies/salad-cloud-imds-sdk-go) > > GitHub > [card] [.NET](https://www.nuget.org/packages/Salad.Cloud.IMDS.SDK) > > NuGet The following samples demonstrate using the SDKs to get the health statuses of the running container instance. ```python Python theme={null} from salad_cloud_imds_sdk import SaladCloudImdsSdk client = SaladCloudImdsSdk() response = client.metadata.get_container_status() print(f'Started: {response.started}') print(f'Ready: {response.ready}') ``` ```javascript JavaScript theme={null} import { SaladCloudImdsSdk } from '@saladtechnologies-oss/salad-cloud-imds-sdk' const client = new SaladCloudImdsSdk({}) const { data } = await client.metadata.getContainerStatus() console.log(`Started: ${data.started}`) console.log(`Ready: ${data.ready}`) ``` ```java Java theme={null} import com.salad.cloud.imdssdk.SaladCloudImdsSdk; import com.salad.cloud.imdssdk.models.ContainerStatus; SaladCloudImdsSdk client = new SaladCloudImdsSdk(); ContainerStatus response = saladCloudImdsSdk.metadataService.getContainerStatus(); System.out.println("Started: " + response.started.toString()); System.out.println("Ready: " + response.ready.toString()); ``` ```go Go theme={null} import ( "context" "fmt" "github.com/saladtechnologies/salad-cloud-imds-sdk-go/pkg/saladcloudimdssdk" "github.com/saladtechnologies/salad-cloud-imds-sdk-go/pkg/saladcloudimdssdkconfig" ) config := saladcloudimdssdkconfig.NewConfig() client := saladcloudimdssdk.NewSaladCloudImdsSdk(config) resp, err := client.Metadata.GetContainerStatus(context.Background()) if err == nil { fmt.Printf("Started: %t", resp.Data.Started) fmt.Printf("Ready: %t", resp.Data.Ready) } ``` ```csharp C# theme={null} using Salad.Cloud.IMDS.SDK; var client = new SaladCloudImdsSdkClient(); var response = await client.Metadata.GetContainerStatusAsync(); Console.WriteLine($"Started: {response.Started}"); Console.WriteLine($"Ready: {response.Ready}"); ``` ## Security and Authentication IMDS is only accessible from within a running container instance on SaladCloud, and the requests never leave the Salad Node. IMDS requests sent to web proxies will fail, and you should explicitly configure your HTTP client to disable any web proxies (manually configured or automatically discovered). To prevent unintended or unwanted redirection of requests, requests to IMDS must contain the custom header `Metadata: true` and must not contain any `X-Forwarded-For`, `X-Forwarded-Host`, or `X-Forwarded-Proto` headers. Any requests missing the custom header `Metadata: true` or containing the `X-Forwarded-For`, `X-Forwarded-Host`, or `X-Forwarded-Proto` headers are rejected with a `403 Forbidden` response. [1]: https://explainshell.com/explain?cmd=curl+-s+-H+%22Metadata%3A+true%22+--noproxy+%22*%22+http%3A%2F%2F169.254.169.254%2Fv1%2Fstatus # Instance Deletion Cost Source: https://docs.salad.com/container-engine/explanation/infrastructure-platform/instance-deletion-cost Manage scale-in behavior for container groups by setting the instance deletion cost. *Last Updated: July 21, 2025* ## Overview Setting the instance deletion cost is a powerful and flexible way to manage scale-in behavior for container groups. Note, however, that this deletion cost only applies when intentional scaling events occur, such as setting replica count, or via [Job Queue autoscaling policies](/container-engine/explanation/infrastructure-platform/autoscaling). It does not apply to instances that are terminated due to other reasons, such as host interruptions or failed instances. When a salad container group is scaled in via adjusting its replica count or a Job Queue autoscaling policy, the instance deletion cost determines how the system selects which instances to terminate. The instance deletion cost is an integer value with a default of `0` that you can assign to each instance in the container group. Instances with a lower deletion cost are prioritized for termination when scaling down. Assigning this value can be done from within the application through the instance metadata service, using the [Replace Deletion Cost Endpoint](/reference/imds/replace-deletion-cost). It can also be done externally via the [Update Container Group Instance Endpoint](/reference/saladcloud-api/container-groups/update-container-group-instance). This function is also available in SaladCloudIMDS SDKs, and the SaladCloud SDKs respectively. **In general, you should only use one of these methods to set the deletion cost for an instance, as using both may lead to unexpected behavior.** **[IMDS Endpoint:](/reference/imds/replace-deletion-cost)** *Accessed from within the container group instance.* ```shell theme={null} curl --request PUT \ --url http://169.254.169.254/v1/deletion-cost \ --header 'Content-Type: application/json' \ --header 'Metadata: true' \ --data '{ "deletion_cost": 100 }' ``` **[SaladCloud API Endpoint:](/reference/saladcloud-api/container-groups/update-container-group-instance)** *Accessed externally via the SaladCloud API.* ```shell theme={null} curl --request PATCH \ --url https://api.salad.com/api/public/organizations/{organization_name}/projects/{project_name}/containers/{container_group_name}/instances/{container_group_instance_id} \ --header 'Content-Type: application/merge-patch+json' \ --header 'Salad-Api-Key: ' \ --data '{ "deletion_cost": 100 }' ``` ## Example 1: Batch Model Finetuning Suppose you have a container group running dozens or hundreds of instances, each pulling training jobs from a queue. In this situation, you would want idle nodes to set their deletion cost to 0, while nodes that are actively doing work could gradually increase their deletion cost as the job progresses. This way, if replica count is reduced, the system would not interrupt the training job by terminating an instance that is currently processing a task, but rather terminate an idle instance instead. ## Example 2: Image Generation with ComfyUI In a scenario where you are using ComfyUI for large-scale image generation, instances may accumulate work in their internal queues. You can set the deletion cost of the instance to the depth of the queue, so that fewer jobs are lost when scaling down. For example, if an instance has a queue depth of 5, you can set its deletion cost to 5. This way, if the system needs to scale down, it will prioritize terminating instances with a lower deletion cost, thus preserving instances that are actively processing jobs in their queues. ## Related Topics * **[Job Queue Autoscaling Overview](/container-engine/explanation/infrastructure-platform/autoscaling)**: Learn how SaladCloud's built-in autoscaling works with job queues * **[Set Up Job Queue Autoscaling](/container-engine/how-to-guides/autoscaling/enable-autoscaling)**: Configure autoscaling for your container groups * **[Job Queue Autoscaling Settings](/container-engine/reference/autoscaling/settings)**: Reference for autoscaling configuration parameters # Liveness Probes Source: https://docs.salad.com/container-engine/explanation/infrastructure-platform/liveness-probes *Last Updated: July 13, 2026* # Overview Liveness probes are similar to startup probes, except that they run after the startup probe has completed successfully. Typically, Liveness probes are used to evaluate whether the application running in your container is in a healthy state. If a container's liveness probe reaches the failure state, the container will be reallocated to a different node. Liveness probes are a good place to check for unrecoverable application and GPU runtime errors, including CUDA errors in NVIDIA workloads or ROCm/HIP errors in AMD workloads. ## Successful Liveness Probe ![](https://mintcdn.com/salad/FAbpq_8Gi6WzwO0s/container-engine/images/liveness-success.png?fit=max\&auto=format\&n=FAbpq_8Gi6WzwO0s\&q=85\&s=17bc3df45d4143c26e353b734a23f0d2) ## Failed Liveness Probe ![](https://mintcdn.com/salad/FAbpq_8Gi6WzwO0s/container-engine/images/liveness-failure.png?fit=max\&auto=format\&n=FAbpq_8Gi6WzwO0s\&q=85\&s=1318ba39d2101ed92fd565ed2a2f269c) # Configuration Check the checkbox to enable the liveness probe. Currently, the supported protocols are `exec`, `gRPC`, `TCP`, and `HTTP/1.X` ![](https://mintcdn.com/salad/pEBrSzH4UQRtJw00/container-engine/images/liveness-tcp-config.png?fit=max\&auto=format\&n=pEBrSzH4UQRtJw00\&q=85\&s=192a719974b284a8d01813c64ba1e51c) # Log Explorer Source: https://docs.salad.com/container-engine/explanation/infrastructure-platform/log-explorer *Last Updated: November 12, 2026* The Log Explorer provides access to container and system logs across all container groups, allowing you to run detailed queries. Once you have selected an organization, the Log Explorer is accessible from the left menu. You can also access it from the Container Logs or System Events tab of a Container Group, where the query will be pre-populated for the group you were viewing There are two interfaces for creating queries in the Log Explorer: the Query Builder and the Code Builder. The Query Builder offers a simple graphical interface to build log queries without needing to know the [Salad Log Query Language](https://docs.salad.com/container-engine/reference/log-queries). Use the dropdowns and input fields to specify filters for your logs. The Code Builder allows you to write queries directly in the Salad Log Query Language for more advanced capabilities. After you run a query, the results are displayed in the table below the query interface. Each query you run, and each auto-refresh, counts against your [daily log query limits](/container-engine/explanation/container-groups/container-logs#daily-log-query-limits). If a limit is reached, the Log Explorer shows a "Daily log query limit reached" banner and queries resume at 00:00 UTC. ![Log Explorer Portal Screenshot](https://mintcdn.com/salad/V4S3_t1JxH3zhOLs/container-engine/images/portal-log-explorer.png?fit=max\&auto=format\&n=V4S3_t1JxH3zhOLs\&q=85\&s=02b5a4bb1cac01bd8a96bd255507d2cc) # Networking / Container Gateway Source: https://docs.salad.com/container-engine/explanation/infrastructure-platform/networking *Last Updated: October 10, 2024* Networking is a crucial aspect of any modern application. In Salad, it is particularly important to have a good understanding of two types of networking requests: outbound and inbound. Outbound networking involves sending data from your application to other APIs or services, while inbound networking involves receiving https requests by your application from other servers or services. ## Outbound Network Requests When your application runs on a SaladCloud node, it will have the ability to make any outbound requests using the residential IP address of the selected node. This means that your application will have the ability to access websites and other online resources using a different IP address than your server, which can be particularly useful for tasks such as web scraping and online market research. Additionally, because the IP address is associated with a residential location rather than a datacenter, your requests are less likely to be blocked or flagged as suspicious, enhancing the reliability and effectiveness of your application. Overall, running your application on a SaladCloud node provides a powerful tool for accessing online resources and conducting online research in a more efficient and effective manner. ### Outbound Networking Information * The IP address will be the residential IP address of the particular node running your application * The hostname will be set to the unique SaladCloud machine id, this is the same value as the `SALAD_MACHINE_ID` environment variable. ## Inbound Network Requests If your application needs to receive http requests from external services, SaladCloud provides a simple networking solution that will automatically load balance the inbound requests across all the container instances running within a specific container group. This feature is particularly useful for applications that require high availability and scalability. Furthermore, load balancing ensures that incoming requests are distributed evenly across all instances, which in turn improves the overall performance of the application, reduces latency, and prevents any one instance from becoming overloaded. With SaladCloud's Container Gateway solution, you can rest assured that your application will be able to handle a large volume of traffic without encountering any issues related to scalability or availability. Each container group can be configured to include inbound networking via the Container Gateway feature. For each container group, you will need to specify the port that your application uses to handle http requests. This is necessary to ensure that SaladCloud can automatically create a static URL with a load balancer, which allows you to send requests directly to your container group. As you scale your container group up or down, SaladCloud will automatically manage the load balancer, allowing you scale without additional configuration. Additionally, your container will need to accept IPv6 connections. To test and if needed enable IPv6 connections, see [Sending authenticated requests to your container](/container-engine/how-to-guides/gateway/sending-requests) We support options for both authenticated (recommended) and unauthenticated networking. If authentication is selected, you must include your SaladCloud API key when making requests to your application, see [Sending authenticated requests to your container](/container-engine/how-to-guides/gateway/sending-requests). If authentication is not selected, any traffic to the domain name will go to your container. In this case authentication should be completed by your container. > 📘 Requesting a unique URL for each node > > Create container groups with only one replica each. Because each container group has a unique URL assigned to it, this > approach allows you to uniquely address each node. To manage large numbers of nodes/replicas, we recommend using the > API. ### Container Gateway Requirements * Your application support IPv6 * All requests to the SaladCloud load balancer must be over HTTPS ### What is the maximum request size I can send? The maximum request size is set to 1 GB by the Container Gateway and its related services. To follow best practices for processing large files, we recommend that you architect applications using a pull model rather than a push model: 1. Put the large files in Cloud Storage, such as AWS S3,Cloudflare R2 or YouTube. Select the appropriate service tier and lifecycle policy (Hot/Warm/Cold/Archive) based on their access patterns to optimize costs. 2. Following the principle of least privilege, grant access to these files for your containers on SaladCloud. 3. Send the jobs (file URL and metadata) to the containers via the Container Gateway. 4. Ensure your container application will receive the url, download and process the files and provide the results. # Readiness Probes Source: https://docs.salad.com/container-engine/explanation/infrastructure-platform/readiness-probes *Last Updated: October 15, 2024* # Overview Readiness probes are only available if [Container Gateway](/container-engine/explanation/infrastructure-platform/networking) or [Job Queues](/container-engine/explanation/job-processing/job-queues) are turned on. They run after the startup probe has completed successfully. They are typically used to evaluate whether the application running in your container is ready to accept traffic. If configured, no traffic will be sent from the load balancer until the readiness probe has passed, so prevent your readiness probe from passing until you have downloaded and warmed up your models. Readiness probes can flap back between passing and failing. If a container's readiness probe reaches the failure state, the container will continue to run on the node but the load balancer will not route any networking traffic. Readiness probe configuration should be fairly strict in order to get that signal out as fast as possible so requests get routed to other nodes. ## Successful Readiness Probe ![](https://mintcdn.com/salad/ko38nW-LNf6N2Y1I/container-engine/images/readiness-success.png?fit=max\&auto=format\&n=ko38nW-LNf6N2Y1I\&q=85\&s=952d31cbda9b336b07fe2a7249bb770b) ## Failed Readiness Probe ![](https://mintcdn.com/salad/ko38nW-LNf6N2Y1I/container-engine/images/readiness-failure.png?fit=max\&auto=format\&n=ko38nW-LNf6N2Y1I\&q=85\&s=69c6f8b248a78903bf184769d4dcd111) # Configuration Check the checkbox to enable the readiness probe. Currently, the supported protocols are `exec`, `gRPC`, `TCP`, and `HTTP/1.X` ![](https://mintcdn.com/salad/ko38nW-LNf6N2Y1I/container-engine/images/readiness-tcp-config.png?fit=max\&auto=format\&n=ko38nW-LNf6N2Y1I\&q=85\&s=c511ec60e4a39fab3152554a5f9246eb) # Probe Status You can see the status of a readiness probe, if configured, on each instance of a container group. ![](https://mintcdn.com/salad/ko38nW-LNf6N2Y1I/container-engine/images/portal-view-readiness.probe.png?fit=max\&auto=format\&n=ko38nW-LNf6N2Y1I\&q=85\&s=ffed42a010f35735a28dc7664da9dfcf) # Startup Probes Source: https://docs.salad.com/container-engine/explanation/infrastructure-platform/startup-probes *Last Updated: October 15, 2024* # Overview Startup probes, when configured, run as soon as the container is created. They are typically used to ensure that the application has started, and is ready to accept traffic. No traffic will be sent from the load balancer until the startup probe has passed, so prevent your startup probe from passing until you have downloaded and warmed up your models. ## Successful Startup Probe ![](https://mintcdn.com/salad/oE6Ic7VdFlh4rKXK/container-engine/images/startup-success.png?fit=max\&auto=format\&n=oE6Ic7VdFlh4rKXK\&q=85\&s=5abc4db02f375ea8a7fd8c62282d7cb6) ## Failed Startup Probe ![](https://mintcdn.com/salad/oE6Ic7VdFlh4rKXK/container-engine/images/startup-failure.png?fit=max\&auto=format\&n=oE6Ic7VdFlh4rKXK\&q=85\&s=b0f17053349bdf0303f331e853a6204d) # Configuration Check the checkbox to enable the startup probe. Currently, the supported protocols are `exec`, `gRPC`, `TCP`, and `HTTP/1.X` ![](https://mintcdn.com/salad/B_utM-6XUMV1Xhv8/container-engine/images/startup-tcp-config.png?fit=max\&auto=format\&n=B_utM-6XUMV1Xhv8\&q=85\&s=5c919c08e778b15e0320e7ea892c5fd8) > 📘 Tips for slow-starting containers > > SCE attempts to estimate the maximum time the probe can run before resulting in a failure, based on the values in the > fields above. This guidance is provided below the Configure button. If you expect your container often takes longer > than this to start, you should adjust the thresholds in the fields above to ensure that you're not prematurely > reallocating containers that could have reached a successful status. # Salad Job Queues Source: https://docs.salad.com/container-engine/explanation/job-processing/job-queues *Last Updated: October 6, 2026* > Use `salad-job-queue-autoscaling` and the [queue autoscaling > runbook](/agents/container-engine/configure-job-queue-autoscaling). Discover the queue and group by exact name; > associate `queue_connection` during group creation, design workers to be idempotent, and verify queue, group, > instances, and jobs after writes. Job Queues provide a way to process discrete jobs without worrying about node capacity, load balancing, and retries. With Job Queues you configure a port on your container, deploy your container group, and then send requests to a static endpoint. These requests are automatically queued and distributed to healthy nodes, with automatic retries to handle transient failures. # Limitations * Our Job Queues are designed to distribute tasks to an HTTP server, and queue operations are managed with http response symantics, e.g. return 200 for a successful job, 500 for a failed job. * Jobs will be retried up to 3 times (meaning 4 total attempts) before being marked as failed. This limitation in combination with interruptible instances means our job queues are not well suited for extremely long running tasks. * A failed attempt is retried immediately, with no backoff, and the retry can land on the same instance. With one instance running, all four attempts of a failing job can be used up within seconds, so a transient fault that lasts a few seconds fails the job. * Instance interruptions count as job failures, and those jobs will be retried according to the above policy. The interruption is noticed only when the job's lease runs out, which takes several minutes. Until then the job reads `running`. * Jobs are dispatched in the order they were created. With more than one instance, jobs run at the same time and can finish out of order. * Jobs are not guaranteed to be processed by the same node, but they will be processed by a healthy node. * The response body from your http server cannot exceed 10MB. A larger reply counts as a failed attempt, so the job runs four times in full and then fails. The job does not record why, and the retries cannot succeed. * A container group's queue connection can be set only when the group is created. It cannot be added, changed or removed afterwards, so to change it you need a new container group. * Deleting a queue deletes its pending jobs and permanently removes the connection from every container group attached to it. The group keeps running with no queue, and creating a new queue with the same name does not reconnect it. The API neither refuses the delete nor reports this. * Stopping or deleting a container group does not stop its worker immediately. The old container can keep taking new jobs for a short time afterwards. A job it takes then stays `running` until the queue notices the worker is gone and retries the job. That takes several minutes, and longer if no other worker is connected to the queue. Stop submitting jobs, or let the queue drain, before you stop or delete a group. * Cancelling a running job does not stop it. See [Using Queues](/container-engine/how-to-guides/job-processing/using-queues). * Job Queues can only be managed and accessed via the [Job Queue API](/reference/saladcloud-api/queues/create-queue) # Terminology * **Job:** An individual request to be processed. An example of a job might be a token string sent to an image generation service. * **Job Queue Worker:** A small go binary program (x86_64 Linux only) you install in your container which receives jobs from the Queue, forwards them to your application running in the container, receives results and returns them to the Queue. * **Job Queue:** Salad-managed queue service that receives requests from your systems, queues them, and distributes them FIFO to nodes. Job queues distribute received jobs to one or more container groups. A container group is connected to a Job Queue when the container group is first created, and that connection cannot be added, changed or removed afterwards. # Architecture ![](https://mintcdn.com/salad/FAbpq_8Gi6WzwO0s/container-engine/images/job-queues-architecture.png?fit=max\&auto=format\&n=FAbpq_8Gi6WzwO0s\&q=85\&s=ea76cc54d3c14ddaf5786c46bd589c3e) # Getting Started with Job Queues 1. **Create a Job Queue** - [How-to Guide](/container-engine/how-to-guides/job-processing/creating-a-job-queue) | [API Reference](/reference/saladcloud-api/queues/create-queue) 2. **Configure the Job Queue Worker** - [How-to Guide](/container-engine/how-to-guides/job-processing/queue-worker) 3. **Push your container to a registry** - [Container Registry Guides](/container-engine/how-to-guides/registries) 4. **Configure a Container Group with a Job Queue** - [How-to Guide](/container-engine/how-to-guides/job-processing/using-queues) | [API Reference](/reference/saladcloud-api/container-groups/create-container-group) 5. **Add Jobs to the Queue** - [API Reference](/reference/saladcloud-api/queues/create-job) 6. **Retrieve Results** - [API Reference](/reference/saladcloud-api/queues/get-job) | [List Jobs](/reference/saladcloud-api/queues/list-jobs) # Long-Running Tasks Solution Overview Source: https://docs.salad.com/container-engine/explanation/job-processing/long-running-tasks Performing Long-Running Tasks on SaladCloud *Last Updated: July 13, 2026* There are [two primary methods](/container-engine/explanation/core-concepts/architectural-overview#provide-input-to-applications) to provide inputs and retrieve results from applications running on SaladCloud: * **SaladCloud’s Container Gateway:** The client application sends requests to the gateway, which forwards them to the container instances, waits for their responses, and then relays the responses back to the client. * **Job Queue System: Salad Kelpie, Salad Job Queue, AWS SQS, or other queue solutions, such as Redis, RabbitMQ, or Kafka** can be used to distribute jobs to instances integrated with a job queue client. The results are then delivered via webhooks or retrieved through job queries. The input and output data of a job can be directly embedded in the request/response and job/result. For larger datasets, it is recommended to exchange data between the instances and cloud storage, while the gateway or job queue only carries references of the data. You can also create a **single-replica container group** for a job and use environment variables to specify the cloud storage locations for the job's input and output. In this setup, the gateway or job queue is not required. **Performing long-running tasks on SaladCloud involves the following key considerations:** ### Container Gateway or Job Queue SaladCloud’s Container Gateway has a maximum [server response timeout](/container-engine/explanation/gateway/load-balancer-options#server-response-timeout) of **100 seconds**. This timeout specifies the maximum duration the gateway will wait for a response from an instance after forwarding a request. If no response is received within this timeframe, the gateway returns a timeout error to the client. For jobs that may run more than 100 seconds, such as video generation and long audio transcription, you will need to either use webhooks to receive the results asynchronously while still using the gateway, or integrate with a job queue system for better handling of long-running tasks. ### Concurrency and Throughput The simplest approach while using the gateway or a job queue is to process a job at a time, ensuring that each job is fully completed before the next one begins. ![](https://mintcdn.com/salad/pEBrSzH4UQRtJw00/container-engine/images/lrt-so1.png?fit=max\&auto=format\&n=pEBrSzH4UQRtJw00\&q=85\&s=4f5fc599b4dbdf5db9099ceb41ac3fab) The lifecycle of job execution may involve multiple stages, including downloading the input, pre-processing (e.g., format conversion, resampling and chunking), executing GPU inference, post-processing (e.g., merging and summarizing), uploading the output. Each stage has different resource demands—some are I/O-bound, others are CPU-intensive, and some are GPU-intensive. If the GPU inference constitutes only a small portion of the process, concurrent processing can significantly enhance throughput and optimize resource utilization for these types of jobs. While leveraging CPU and I/O capacity effectively, multiprocessing or multithreading-based concurrent inference over a single GPU might limit optimal GPU cache utilization and degrade performance, due to each inference running in isolation at its own layer or stage. Additionally, the multiprocessing approach can increase VRAM consumption, as each process creates a separate GPU runtime context and loads its own model into GPU VRAM. The recommendation is to use a multi-pipeline, staged architecture, where GPU inference remains sequential or batched by a separated process or thread, while other tasks run in parallel or asynchronously across one or more processes or threads to maximize efficiency. Typically, a local queue is employed to connect these two parts. ![](https://mintcdn.com/salad/pEBrSzH4UQRtJw00/container-engine/images/lrt-so2.png?fit=max\&auto=format\&n=pEBrSzH4UQRtJw00\&q=85\&s=e4af7d881a0d404b97dee1f8617f0ce3) Compared to single inference, batched inference may achieve higher throughput, but usually requires more VRAM. The decision should be based on your specific use case and resource selection. ![](https://mintcdn.com/salad/pEBrSzH4UQRtJw00/container-engine/images/lrt-so3.png?fit=max\&auto=format\&n=pEBrSzH4UQRtJw00\&q=85\&s=93821b5f25b67166a85ba567e06efe1c) [This repository](https://github.com/SaladTechnologies/mds/tree/main/inference-server) provides the reference implementation of inference servers that support concurrent processing while using the gateway and the job queue - AWS SQS. To handle multiple jobs concurrently while using a job queue, AWS SQS is preferred, as it allows your application to handle each job independently and flexibly, including pulling the job, extending its leasing, and deleting it once completed. [In our YouTube video transcription benchmark test with AWS SQS](https://blog.salad.com/ai-batch-transcription-benchmark/), which transcribed 1 million hours of video using 100 mid-end GPUs within a week, utilizing three or more threads for downloading and pre-processing enabled us to achieve nearly 100% GPU utilization. ### Save Running State SaladCloud operates on a foundation of distributed and interruptible nodes, meaning that a node hosting your instance may go down unexpectedly at any time. However, the majority of nodes are capable of running continuously for over 10 hours. Please refer to [the benchmark test results](https://github.com/SaladTechnologies/mds/tree/main/demo-app3) detailing uptime and the number of interruptions for jobs running over a 48-hour period on SaladCloud. If an instance fails to complete (or delete) a job due to the node failure, the job will typically become available for other instances via the job queue system. To avoid restarting an unfinished job from scratch after an interruption—particularly for jobs expected to run longer than 30 minutes (depending on the use case), such as molecular dynamics simulations—**consider implementing the following features in your applications:** * Start fresh while pulling a new job. * Regularly save and upload the running state to cloud storage during job execution. * Download and resume from the previous running state if retrieving an unfinished task. Key application settings, such as saving intervals, upload data size, and required upload speed, should be carefully tested and aligned: * Longer saving intervals reduce the required upload speed but may result in greater GPU processing losses if nodes go down. * Shorter saving intervals require higher upload speeds, which may lead to upload backlogs. The asymmetric bandwidth of SaladCloud is notable, as many nodes are located in residential networks. Your applications may perform [initial checks to filter nodes](/container-engine/tutorials/performance/high-performance-apps#perform-initial-checks-to-filter-nodes) with specific download and upload speeds. Consider using [open-source tools like Rclone](/container-engine/tutorials/performance/high-performance-storage-solutions) to optimize performance and throughput. These tools support chunked, parallel uploads and downloads, enabling more efficient utilization of bandwidth by establishing multiple simultaneous connections. Additionally, progressive or incremental uploads can reduce the overall required upload speed with shorter saving intervals, while also allowing you to tap into a larger pool of available nodes. Your applications can implement the above mechanism alongside any job queue system, such as Salad Kelpie, Salad Job Queue and AWS SQS. Alternatively, you can create a single-replica container group for each job and integrate these features, eliminating the need for a job queue. **Since the release of Salad Kelpie 0.5.0, it supports two use cases:** * Use Kelpie as a job queue system along with its built-in data synchronization for easy implementation. * Use Kelpie solely as a job queue while implementing custom, flexible data management strategies, including selective downloads and progressive uploads. ### Super Long Running Jobs Certain large molecular dynamics simulations, or model fine-tunning and hyperparameter tuning jobs, can run for several days or even a week, generating tens to hundreds of gigabytes of data (e.g., trajectory files or checkpoints at various time points) that must be uploaded to cloud storage. This is fully achievable on SaladCloud, as validated by customer use cases. However, both AWS SQS and Salad Job Queue are not ideal for this case. Due to the 12-hour maximum visibility timeout imposed by AWS SQS (starting from when the job is first received, extending the timeout doesn't reset this limit), the long-running solution built on it can handle tasks for up to 12 hours at a time. After this period, the job reappears in the queue and can be picked up by another instance to continue execution. Salad Job Queue can tolerate up to 3 node failures for a job. When more nodes fail during job execution, the job will be reported as failed. For jobs running longer than a day, the likelihood of failure increases significantly. For super long running jobs, we recommend using Salad Kelpie: * **Simplified Architecture:** It significantly reduces application complexity by eliminating the need for job and leasing management. * **Enhanced Task Duration:** It allows unlimited node reallocations, enabling seamless support for longer running tasks on SaladCloud. If you have a small number of very long-running jobs, you can also create a single-replica container group for each job and use environment variables to specify the locations of the job's input, state, and output. In this scenario, a job queue system is unnecessary. **While a job remains unprocessed during node reallocation, our tests show that such interruptions are minimal, occurring less than 4% of the time over a few-day period.** ### Summary Here is a summary of the recommended solutions for each scenario: | Job Duration | Use Case | Solution Description | | :- | :- | :- | | Under 100 seconds | Image generation, LLM streaming, real-time transcription | SaladCloud’s Container Gateway, or any job queue system. | | Under 30 minutes | Video generation, LLM non-streaming, long audio transcription | Any job queue system. To handle multiple jobs concurrently while using a job queue, AWS SQS is preferred. | | Under 12 hours | Molecular dynamics simulation, model fine-tuning | Any job queue system. Applications need to regularly save running state to cloud storage during job execution, and resume from the previous running state if retrieving an unfinished task. Use the Kelpie built-in data synchronization for easy implementation. | | Over 12 hours | Large molecular dynamics simulation, model fine-tuning and hyperparameter tuning | Salad Kelpie is preferred for simplified architecture and enhanced task duration. For a small number of very long-running jobs, use the single-replica container group, eliminating the need for a job queue. | Please refer to the example code and applications for further details: | No | Description | Repository | | :- | :- | :- | | 1 | Reference implementation of inference server using SaladCloud’s Container Gateway, supporting concurrent processing with batched inference. | [link](https://github.com/SaladTechnologies/mds/tree/main/inference-server#use-the-container-gateway-load-balancer) | | 2 | Reference implementation of inference server integrated with AWS SQS, supporting concurrent processing with single inference. | [link](https://github.com/SaladTechnologies/mds/tree/main/inference-server#use-a-job-queue) | | 3 | Use Kelpie as the job queue along with its built-in data management. | [link](https://github.com/SaladTechnologies/mds/tree/main/demo-app1) | | 4 | Use Kelpie solely as the job queue, while implementing flexible data management strategies, including selective downloads and progressive uploads | [link](https://github.com/SaladTechnologies/mds/tree/main/demo-app3) | | 5 | Use AWS SQS as the job queue, while implementing flexible data management strategies. | [link](https://github.com/SaladTechnologies/mds/tree/main/demo-app2v2) | # Virtual Kubelet Solution Overview Source: https://docs.salad.com/container-engine/explanation/platform-integrations/kubernetes-integration Integrate unlimited GPU resources from SaladCloud into your Kubernetes clusters ## Introduction [Kubernetes](https://kubernetes.io/docs/home/) (K8s) is a powerful open-source container orchestration platform that automates the deployment, scaling, and management of containerized applications. [Kubelet](https://kubernetes.io/docs/reference/command-line-tools-reference/kubelet/) is a core component that runs on each node in a Kubernetes cluster, ensuring that containers operate as expected. It communicates with the Kubernetes control plane and interacts with container runtimes like Docker or containerd to start, stop, and monitor containers while maintaining the desired state defined in Pod specifications. [Virtual Kubelet](https://github.com/virtual-kubelet/virtual-kubelet) (VK) extends Kubernetes by acting as an abstraction layer that allows workloads to run on external or virtual resources, such as cloud services, as if they were standard nodes. This enables greater scalability, flexibility, and efficient resource utilization without requiring additional physical nodes. You can access SaladCloud directly through its APIs/SDKs in your Kubernetes applications. However, with **the Salad Virtual Kubelet solution (v0.2.3)**, you can now provision and manage GPU resources on SaladCloud using Kubernetes APIs. This solution includes: * [VK Provider Source Code](https://github.com/SaladTechnologies/virtual-kubelet-saladcloud/tree/v0.2.3) - Can be compiled into the VK binary. * [Dockerfile](https://github.com/SaladTechnologies/virtual-kubelet-saladcloud/blob/v0.2.3/docker/Dockerfile) - Used to build the VK container image that includes the pre-built VK binary. * [Helm Chart](https://github.com/SaladTechnologies/virtual-kubelet-saladcloud/tree/v0.2.3/charts/virtual-kubelet-saladcloud-chart) - Deploys the VK image on your Kubernetes cluster. To ensure compatibility, the versions/tags of the VK solution, provider source code, docker image and Helm chart are consistently aligned. ## Solution Highlights By translating between Kubernetes APIs and SaladCloud APIs, the Salad VK solution can integrate unlimited GPU resources from SaladCloud into your Kubernetes clusters, providing scalable and efficient acceleration for AI/ML workloads. Kubernetes users can provision, scale, and manage SaladCloud GPU resources using familiar Kubernetes APIs while utilizing flexible deployment strategies such as Rolling Updates, Recreate, and Blue-Green deployments. Additionally, popular DevOps tools like Jenkins, Argo CD, and Flux can be seamlessly integrated for automated deployment and management. Furthermore, Kubernetes-based Event-Driven Autoscaler (KEDA) can be leveraged to implement custom scaling logic, dynamically adjusting GPU resources on SaladCloud based on workload demand on Kubernetes. ## How It Works **Each Salad VK instance** functions as **a virtual node** in your Kubernetes cluster, interacting with the Kubernetes API server and managing GPU resources for **a single project** within your organization on SaladCloud through its APIs/SDKs. Multiple VK instances can run simultaneously, allowing you to simulate multiple virtual nodes in your cluster and manage multiple different projects on SaladCloud. ![](https://mintcdn.com/salad/FAbpq_8Gi6WzwO0s/container-engine/images/k8s-architecture.png?fit=max\&auto=format\&n=FAbpq_8Gi6WzwO0s\&q=85\&s=867e0f8613298be5355e5d405194c342) Here is an example of a Kubernetes cluster with 3 regular nodes (**k8s1, k8s2, k8s3**) and 2 virtual nodes (**scnode1, scnode2**) using the Salad VK provider: ![](https://mintcdn.com/salad/FAbpq_8Gi6WzwO0s/container-engine/images/k8s-nodes.png?fit=max\&auto=format\&n=FAbpq_8Gi6WzwO0s\&q=85\&s=12ed7a18ed73ee2d04a9922fbb1b987c) When you schedule **a pod** with GPU support on the selected virtual node using Kubernetes APIs, the Salad VK provider will create **a GPU-powered, single-replica container group** on SaladCloud by using its APIs/SDKs. This container group is then represented as **a virtual pod** running on the virtual node within your Kubernetes cluster. Let's consider another example: In the default namespace, there are 2 deployments: * The **myapp** deployment, which has 2 pods (myapp-xxxxxxxx-xxxxx) running on nodes k8s2 and k8s3, and the **vkapp-gpu-4090** deployment, with 2 virtual pods (vkapp-gpu-4090-xxxxxxxx-xxxxx) running on the scnode1 virtual node. ![](https://mintcdn.com/salad/FAbpq_8Gi6WzwO0s/container-engine/images/k8s-deployment.png?fit=max\&auto=format\&n=FAbpq_8Gi6WzwO0s\&q=85\&s=676637adf2232a2e0f1a74d7eec6e00b) * **The 2 virtual pods correspond to 2 single-replica container groups** on SaladCloud. You can further adjust the GPU node count , update or rollback through the Kubernetes vkapp-gpu-4090 deployment. ![](https://mintcdn.com/salad/FAbpq_8Gi6WzwO0s/container-engine/images/k8s-cg.png?fit=max\&auto=format\&n=FAbpq_8Gi6WzwO0s\&q=85\&s=752682bdcb30b13804d4b7a979887095) ## Key Specifications and Known Limitations Kubernetes and SaladCloud serve distinct functions and offer unique features. The VK solution also has certain limitations, as both nodes and pods are virtual and simulated, which may affect performance and functionality in specific scenarios. Below are the key specifications and known limitations to consider when building applications across Kubernetes and SaladCloud: | No | Description | | | :- | :- | :- | | 1 | There are several ways to install a Salad VK instance into your Kubernetes cluster. **The simplest method is to use the provided Helm chart.** Alternatively, you can build a custom binary, image, or Helm chart for a more tailored installation. | Please refer to [the installation guide](/container-engine/how-to-guides/platform-integrations/installation-helm-chart) for detailed instructions. | | 2 | You can simultaneously run multiple VK nodes in a Kubernetes cluster. **Each VK node is exclusively tied to a single project on SaladCloud, and any resources not created by the VK node will be automatically removed.** | Ensure that each VK node is deployed with its own dedicated, empty project on SaladCloud. | | 3 | Each virtual pod created by a VK node corresponds to a single-replica container group on SaladCloud. A Kubernetes deployment with multiple replicas is mapped to multiple single-replica container groups. | **Make sure to check your organization's quotas if you require a large number of container groups on SaladCloud.** | | 4 | Each container group on SaladCloud requires a unique resource name. You cannot reuse a previously used name, even if the container group has already been removed. | The Kubernetes deployment automatically appends a random suffix to the pod names it generates, ensuring each pod name is unique. **If you provision pods directly, rather than using a Kubernetes deployment, you must use unique names for each deployment.** | | 5 | For the resources on SaladCloud managed by a VK node, manual changes outside the VK node may lead to discrepancies between the Kubernetes deployment and the resources on SaladCloud. | **It is recommended not to modify resources managed by the VK node directly through the SaladCloud Portal or APIs.** | | 6 | The VK provider does not implement CNI (Container Network Interface) or CSI (Container Storage Interface). Consequently Kubernetes services cannot be used to expose virtual pods, and volume mounting is not supported. | There are a few methods for service access and data exchange across regular pods and the virtual pods in Kubernetes clusters, **including using external queue/storage and deploying an ingress gateway for virtual pods to access regular pods.** Please refer to [the service access guide](/container-engine/how-to-guides/platform-integrations/service-access) for detailed instructions. | | 7 | The VK provider does not support features like kubectl logs and kubectl exec for the virtual pods. | You can access container logs through the SaladCloud Portal, which also offers an interactive terminal, enabling you to log into running containers. | | 8 | **Due to the substantial differences between Kubernetes and SaladCloud, not all Kubernetes APIs and parameters have direct equivalents in SaladCloud. Additionally, special handling is required when using Kubernetes APIs to pass specific parameters to SaladCloud APIs.** | Please refer to [the application deployment guide](/container-engine/how-to-guides/platform-integrations/application-deployment) for detailed instructions. | ## Recommandations Although the Salad VK solution enables you to manage both regular pods and the virtual GPU pods within the same Kubernetes cluster, there are notable differences between the two, particularly in geolocation, latency and jitter, supported APIs and protocols, and other factors. Successful applications across Kubernetes and SaladCloud must be designed to handle and tolerate [the distributed and dynamic nature of SaladCloud](/container-engine/tutorials/performance/high-performance-apps), including variable startup times, performance variances and the potential for interruptions. Additionally, **containers on SaladCloud are not run in privileged mode**, which may impose restrictions on mounting volumes via NFS and accessing network devices for VPN connections. In such cases, you may consider alternative solutions, such as userspace networking and storage tools, to overcome these limitations. If converting between Kubernetes APIs and SaladCloud APIs introduces additional complexity and challenges to your use case, you can always opt to use SaladCloud APIs/SDKs directly. Leveraging SaladCloud’s native tools allows you to simplify the process, gain better control over resource management, streamline workflows, and ensure full compatibility with SaladCloud’s infrastructure and capabilities. # Tailscale Solution Overview Source: https://docs.salad.com/container-engine/explanation/platform-integrations/tailscale-integration Securely integrate unlimited GPU resources from SaladCloud into your applications ## Introduction [Tailscale](https://tailscale.com/) is a modern VPN solution built on WireGuard, designed to provide secure, scalable networking across diverse environments. It simplifies the process of connecting devices, whether they’re behind firewalls, NATs, or across private networks. Unlike traditional VPN services, Tailscale focuses on helping devices traverse NATs and firewalls while establishing connections through its coordination server. **Once the connection is established, traffic is typically sent directly between devices in a peer-to-peer fashion, without routing through Tailscale’s servers.** In some cases where strict NATs or firewalls prevent direct connections, Tailscale uses its DERP (Designated Encrypted Relay for Packets) servers to relay encrypted traffic, ensuring reliable communication. Please check these links \[[1](https://tailscale.com/blog/how-nat-traversal-works),[2](https://tailscale.com/blog/how-tailscale-works)] for details on how it works. A [tailnet](https://tailscale.com/kb/1136/tailnet) is a private network created and managed by Tailscale that allows devices to securely communicate with each other as if they were on the same local network, regardless of their physical location. Each Tailnet is isolated from others, meaning devices within one Tailnet cannot communicate with devices in another unless explicitly allowed. ## Use Cases SaladCloud primarily handles GPU-intensive workloads across most use cases, while also interacting with external services or systems to receive requests or jobs and deliver results. [Its native networking](/container-engine/explanation/infrastructure-platform/networking) allows all nodes to initiate outbound connections to these systems. When the Container Gateway is enabled, the external systems can also send HTTP requests to a group of Salad nodes and receive responses seamlessly. Integrating Tailscale with SaladCloud unlocks additional use cases, including: ![](https://mintcdn.com/salad/pEBrSzH4UQRtJw00/container-engine/images/networking-overview.png?fit=max\&auto=format\&n=pEBrSzH4UQRtJw00\&q=85\&s=10f3e711dff5cd216a79bc8ddd208529) * **Remote Development:** Developers can use [VSCode - Remote SSH](https://code.visualstudio.com/docs/remote/ssh) and [JupyterLab](https://jupyter.org/) on Mac or Windows to seamlessly test and debug their code running on Salad GPU nodes. * **Network Management and Troubleshooting:** Network operators can SSH into Salad nodes for configuration, management, and troubleshooting purposes. * **Node Discovery and Identity Broker:** Detecting when nodes come online or go offline, while implementing an identity broker for private, centralized authentication and authorization. This setup provides temporary credentials to Salad nodes for accessing external systems using [JWT authentication](/container-engine/tutorials/security/jwt-authentication). * **Accessing Private Services:** Connecting Salad nodes to private services hosted on-premises or in the cloud, including databases, message queues, Kubernetes clusters, and proxies. * **Enabling Meshed Communication:** Facilitating secure, direct communication between Salad nodes and private systems in a mesh network. Tailscale is fully compatible with SaladCloud's networking. While enabling the new use cases through the integration, the Container Gateway and outbound connections in SaladCloud remain unaffected. ## Scenarios and Protocols By default, Tailscale on Linux systems uses the **/dev/net/tun** device driver to create a virtual interface with a Tailscale IP, allowing nodes to access themselves and others for all traffic types via their Tailscale IPs. However, on SaladCloud, workloads run as containers in non-privileged mode and do not have access to the device driver. To integrate SaladCloud with Tailscale, we leverage [its userspace networking mode](https://tailscale.com/kb/1112/userspace-networking), which provides a local SOCKS5 and HTTP proxy, enabling applications to communicate across nodes. The [SOCKS5](https://datatracker.ietf.org/doc/html/rfc1928) proxy is a versatile and flexible solution that supports both TCP and UDP traffic. In contrast, the HTTP proxy operates over TCP and is limited to proxying only HTTP and HTTPS traffic. For a node in Tailscale’s userspace network mode, outbound connections to other nodes within the same Tailnet must be explicitly configured to use the SOCKS5 or HTTP proxy through [environment variables](https://tailscale.com/kb/1112/userspace-networking#configure-your-application-to-use-socks5-or-http) or network proxying tools like [proxychains](https://github.com/haad/proxychains), while inbound connections are automatically routed through the SOCKS5 proxy by Tailscale. Here is a summary of the supported communication scenarios and protocols when integrating SaladCloud with Tailscale. | Supported Communication Scenarios and Protocols | Target: Default Mode (Other Systems) | Target: Userspace Networking Mode (Salad Nodes) | | :- | :- | :- | | **Source: Default Mode (Other Systems)** | The application can access peers via their Tailscale IPs for all traffic types. The application can access itself via its Tailscale IP or the localhost (127.0.0.1) for all traffic types. | The application can access peers using their Tailscale IPs for TCP and UDP traffic. | | **Source: Userspace Networking Mode (Salad Nodes)** | The application can access peers via their Tailscale IPs for TCP and UDP traffic by using the local proxy provided by Tailscale. | The application can access peers via their Tailscale IPs for TCP and UDP traffic by using the local proxy provided by Tailscale. The application can access itself via the localhost (127.0.0.1) for all traffic types, but cannot reach its Tailscale IP. | **Note: Not all devices in the default mode can access their own Tailscale IPs, as this depends on the operating system, network configuration, and firewall settings.** ![](https://mintcdn.com/salad/oE6Ic7VdFlh4rKXK/container-engine/images/scenarios.png?fit=max\&auto=format\&n=oE6Ic7VdFlh4rKXK\&q=85\&s=17ba470984a673f81950937eeb5c96d3) ## Summary After integrating SaladCloud with Tailscale, you can fully utilize Tailscale’s features, solutions, and ecosystem to build a wide range of applications: * Salad nodes can securely connect to systems within the same tailnet, including on-premises datacenters and private services hosted on public clouds. This enables simpler development of distributed applications over TCP or UDP. * With [Tailscale’s pre-built Kubernetes integration](https://tailscale.com/kb/1185/kubernetes), Salad nodes can directly access pods and services—such as self-managed RabbitMQ and Redis—within public or private Kubernetes clusters. * Network operators and developers can easily use SSH clients or VSCode on Mac or Windows to test and debug applications running on Salad nodes. * You can build clustered applications on Salad nodes using TCP or UDP communication. However, ensure that in-cluster communication uses Tailscale IPs, while intra-node communication uses the localhost. Note that [Ray](https://www.ray.io/) is currently incompatible with the solution because it uses a single IP for both in-cluster and intra-node communication. You can begin testing the integration solution with [a Tailscale personal account](https://tailscale.com/pricing), which supports up to 100 nodes, allowing you to explore a variety of use cases. # Deploy BLIP with Cog HTTP Prediction Server Source: https://docs.salad.com/container-engine/how-to-guides/ai-machine-learning/deploy-blip-cog *Last Updated: October 10, 2024* [Cog](https://cog.run/) is an open-source tool that helps simplify the work of building inference applications for various AI models. It provides CLI tools, Python modules for prediction and fine-tuning, and an HTTP prediction server using FastAPI. Using [the Cog HTTP prediction server](https://github.com/replicate/cog/blob/main/python/cog/server/http.py), we mainly need to provide two functions in Python: one for downloading/loading the models and another for running the inference. The server handles everything else, such as input/output, logging, health checks, and exception handling. It supports synchronous prediction, streaming output and asynchronous prediction with a webhook; its health-check feature is impressive, providing different running statuses (STARTING, READY, BUSY and FAILED) within the server. The Cog prediction server can be further customized to meet specific needs. For instance, its path operation functions for the health checks and predictions are, by default, declared with `async def`, running in the same main thread. By declaring the predictions function with `def`, a new thread will be spawned to run the prediction when a new request arrives.This setup can prevent long-running synchronous predictions from blocking timely responses to health queries. Another example is IPv6 support: the server is hardcoded to listen on an IPv4 port, we can modify the code to use IPv6 by replacing `0.0.0.0` with `::` when launching its underlying Uvicorn server. The [BLIP](https://arxiv.org/pdf/2201.12086) (Bootstrapping Language-Image Pre-training) supports multiple image-to-text tasks, such as Image Captioning, Visual Question Answering and Image Text Matching. Each task requires a dedicated and fine-tuned BLIP model that is 1\~2 GB in size. We can run inference for the three models of these three tasks simultaneously on a SaladCloud node that has a GPU with 8GB VRAM. [LAVIS](https://github.com/salesforce/LAVIS) (A Library for Language-Vision Intelligence) is the Python deep learning library, and provides the unified access to the pretrained models, datasets and tasks for multimodal applications, including BLIP, CLIP and others. Let’s use BLIP as an example to see how to build a publicly-accessible and scalable inference endpoint using the Cog HTTP prediction server on SaladCloud, capable of handling various image-to-text tasks. # Build the container image The following 4 files are necessary for building the image, and we also provide some test code in [the Github Repo](https://github.com/SaladTechnologies/cog-deploy). ```yml theme={null} build: gpu: true predict: 'predict.py:Predictor' ``` The yaml file defines how to build a Docker image and how to run predictions. In this example, We only use the Cog HTTP prediction server (not its CLI tools), the file is quite simple. When the prediction server is launched, it will read the file, and then set the number of Uvicorn worker processes to 1 (when the GPU is enabled) and run the provided code - predict.py for inference. ``` salesforce-lavis==1.0.2 cog==0.9.8 ``` Based on the PyTorch base image, we only need to install two Python packages and their dependencies for this application. ```Dockerfile theme={null} # Base Image FROM docker.io/pytorch/pytorch:2.3.0-cuda12.1-cudnn8-runtime RUN apt-get update && apt-get install -y curl RUN pip install --upgrade pip WORKDIR /app # Install LAVIS and Cog HTTP prediction server COPY requirements.txt ./requirements.txt RUN pip install -r requirements.txt # Optional, build the downloaded models into the container image. # The models can also be downloaded dynamically when the container is running. # COPY ./torch /root/.cache/torch COPY cog.yaml /app COPY predict.py /app # Modify the installed Cog prediction server to use IPv6 RUN sed -i 's/0.0.0.0/::/g' /opt/conda/lib/python3.10/site-packages/cog/server/http.py # Run the Cog HTTP prediction server CMD ["python", "-m", "cog.server.http"] EXPOSE 5000 ``` You can download the models first and build them into the container image. This way, when the workload is running on SaladCloud, it can start the inference immediately. Alternatively, the models can also be downloaded dynamically when the container is running. This approach has the advantage of smaller image sizes, allowing for faster builds and pushes. For the inbound connection, the containers running on SaladCloud need to listen on an IPv6 port. The Cog HTTP prediction server is currently hardcoded to use an IPv4 port, but this can be easily modified by a `sed` command in the Dockerfile. ```python theme={null} from cog import BasePredictor, Input, Path import time import torch from lavis.models import load_model_and_preprocess from PIL import Image class Predictor(BasePredictor): def setup(self) -> None: ...... def predict( self, image: Path = Input( description="Input image" ), task: str = Input( choices=[ "image_captioning", "visual_question_answering", "image_text_matching" ], default="image_captioning", description="Choose a task." ), question: str = Input( default=None, description="Type question for the input image for visual question answering task." ), caption: str = Input( default=None, description="Type caption for the input image for image text matching task." ), ) -> str: ...... ``` The Predictor Class is implemented with 2 member functions that will be called by the Cog prediction server: setup(), download and load the 3 models into the GPU. predict(), run the inference based on inputs and return the results. # Test the image ``` # Build docker image build -t docker.io/saladtechnologies/sip:0.0.3-blip -f Dockerfile . # Run with GPU docker run --rm --gpus all docker.io/saladtechnologies/sip:0.0.3-blip # Run without GPU docker run --rm docker.io/saladtechnologies/sip:0.0.3-blip # Push to Docker Hub docker push docker.io/saladtechnologies/sip:0.0.3-blip ``` After the container is running, you can log into it and do some tests for health checks and predictions. ![](https://mintcdn.com/salad/8o1ParSgmJGbpSYb/container-engine/images/blip-cog1.png?fit=max\&auto=format\&n=8o1ParSgmJGbpSYb\&q=85\&s=a99aae175e68630fda002da6f7afaf3a) ![](https://mintcdn.com/salad/8o1ParSgmJGbpSYb/container-engine/images/blip-cog2.png?fit=max\&auto=format\&n=8o1ParSgmJGbpSYb\&q=85\&s=4effdda100973f147ed8537819b1e25f) The Cog HTTP prediction server is now using IPv6. The port number is configurable via the environment variable - ‘PORT’. ![](https://mintcdn.com/salad/8o1ParSgmJGbpSYb/container-engine/images/blip-cog3.png?fit=max\&auto=format\&n=8o1ParSgmJGbpSYb\&q=85\&s=119adb042cf6e48c81ea4fb9f3060a0d) # Deploy the image on SaladCloud Create a container group with the following parameters: ```md theme={null} # Image Source saladtechnologies/sip:0.0.3-blip # Replica Count 3 # Resource 2 vCPUs, 8GB Memory Any GPU types with 8 GB or more VRAM # Container Gateway Enabled, Port 5000 # Readiness Probe (Protocol: exec) Enabled Protocol: exec Command: python Argument1: -c Argument2: import requests,sys;sys.exit(0 if 'READY' in requests.get('http://[::1]:5000/health-check').text else -1) Initial Delay Seconds: 60 Period Seconds: 10 Timeout Seconds: 5 Success Threshold: 1 Failure Threshold: 3 # Environment Variables (Optional) COG_LOG_LEVEL, INFO (Default) / DEBUG / WARNING PORT, 5000 (Default) or others ``` The Readiness Probe is used to evaluate whether a container is ready to accept the traffic from the load balancer. The probe with the protocol - exec, will run the given command inside the container, if the command returns an exit code of 0, the container is considered in a healthy state. Any other exit codes indicate the container is not ready yet. A Python script is provided here and run regularly to check whether the models have been loaded successfully and the Cog HTTP prediction server is ready. ![](https://mintcdn.com/salad/8o1ParSgmJGbpSYb/container-engine/images/blip-cog6.png?fit=max\&auto=format\&n=8o1ParSgmJGbpSYb\&q=85\&s=2c3ce7092fa5b4a9b506133a1800fc9a) # Test the inference endpoint After the container group is deployed, an access domain name will be created and can be used to access the application. ![](https://mintcdn.com/salad/8o1ParSgmJGbpSYb/container-engine/images/blip-cog5.png?fit=max\&auto=format\&n=8o1ParSgmJGbpSYb\&q=85\&s=2b7e57b9a9033fd68b73f66fa863e4f9) ```shell theme={null} # image_captioning curl -s -X POST \ -H "Content-Type: application/json" \ -d $'{ "input": { "task": "image_captioning", "image": "https://storage.googleapis.com/sfr-vision-language-research/BLIP/demo.jpg" } }' \ https://salmon-tubers-69f52h0zu3qrrtn6.salad.cloud/predictions # visual_question_answering curl -s -X POST \ -H "Content-Type: application/json" \ -d $'{ "input": { "task": "visual_question_answering", "question": "where is the dog?", "image": "https://storage.googleapis.com/sfr-vision-language-research/BLIP/demo.jpg" } }' \ https://salmon-tubers-69f52h0zu3qrrtn6.salad.cloud/predictions # image_text_matching curl -s -X POST \ -H "Content-Type: application/json" \ -d $'{ "input": { "task": "image_text_matching", "caption": "a dog and a women are sitting at the beach", "image": "https://storage.googleapis.com/sfr-vision-language-research/BLIP/demo.jpg" } }' \ https://salmon-tubers-69f52h0zu3qrrtn6.salad.cloud/predictions ``` # Deploy Image and Video Generation with ComfyUI Source: https://docs.salad.com/container-engine/how-to-guides/ai-machine-learning/deploy-stable-diffusion-comfy A comprehensive guide to deploying ComfyUI-based image and video generation services on SaladCloud *Last Updated: October 7, 2026* This guide covers deploying any ComfyUI workflow as a production API on SaladCloud, including image generation models (Stable Diffusion 1.5, SDXL, SD 3.5, Flux) and video generation models (LTX Video, Hunyuan, CogVideoX, Mochi, Cosmos). ## Overview [ComfyUI](https://github.com/comfyanonymous/ComfyUI) is a powerful, modular inference engine for diffusion models. [ComfyUI API](https://github.com/SaladTechnologies/comfyui-api) wraps ComfyUI to provide: * **Stateless REST API** - Horizontally scalable, returns images/videos in responses or via webhooks * **Multiple storage backends** - S3, Azure Blob, Hugging Face, or HTTP endpoints * **Dynamic model loading** - Download and cache models on-demand via URLs * **Custom workflow endpoints** - Create simplified APIs with TypeScript/JavaScript * **Production features** - Health probes, warmup workflows, execution statistics For full documentation, see the [ComfyUI API GitHub repository](https://github.com/SaladTechnologies/comfyui-api). ## Choosing Your Deployment Pattern ### Container Gateway (Recommended for most image generation) ```mermaid theme={null} flowchart LR Client -->|HTTPS Request| Gateway[Container Gateway] Gateway -->|Load Balance| API[ComfyUI API] subgraph Container[Container Instance] API --> ComfyUI[ComfyUI] ComfyUI --> API end API -.->|Optional| Storage[(Cloud Storage)] API -->|Response| Gateway Gateway -->|Image/URL| Client ``` * Simple setup with synchronous HTTP responses * Images returned directly in the response body * **100-second timeout limit** (Cloudflare hard limit) * Best for: SD 1.5, SDXL, Flux image generation (typically 2-30 seconds) ### Job Queue (Required for video and long-running tasks) * Asynchronous processing with webhooks or polling * **No timeout limit** - handles multi-minute generation * Automatic retries on node interruption * Built-in request buffering and autoscaling * Best for: Video generation, batch processing, complex multi-step workflows See the [Job Queue documentation](/container-engine/explanation/job-processing/job-queues) for setup details, or the [Video Generation Guide](/container-engine/how-to-guides/ai-machine-learning/deploy-video-generation-comfy) for a complete example. ## Hardware Recommendations | Model Type | Min VRAM | Recommended GPU | System RAM | Typical Time | Deployment | | - | - | - | - | - | - | | SD 1.5 | 8GB | RTX 3060 Ti | 12GB | 2-5s | Gateway | | SDXL | 12GB | RTX 4070 Ti | 24GB | 5-15s | Gateway | | SDXL + Refiner | 24GB | RTX 4090 | 30GB | 15-30s | Gateway | | Flux (fp8) | 16GB | RTX 4090 | 24GB | 5-20s | Gateway | | SD 3.5 | 16GB | RTX 4090 | 24GB | 5-15s | Gateway | | Video (short) | 24GB | RTX 4090 | 30GB | 1-5 min | Job Queue | | Video (long) | 24GB+ | RTX 4090/5090 | 32GB+ | 5-30 min | Job Queue | ## Base Docker Images Pre-built images are available from the GitHub Container Registry: ``` ghcr.io/saladtechnologies/comfyui-api: ``` **Tag format:** `comfy-api-torch-cuda-` | Tag | Use Case | | - | - | | `comfy0.7.0-api1.16.1-torch2.8.0-cuda12.8-runtime` | Most image generation workloads | | `comfy0.7.0-api1.16.1-torch2.8.0-cuda12.8-devel` | Video generation (requires full CUDA toolkit) | Browse all available tags on the [GitHub Container Registry](https://github.com/SaladTechnologies/comfyui-api/pkgs/container/comfyui-api/versions). **Key directories in the image:** * Model directory: `/opt/ComfyUI/models` * Custom nodes: `/opt/ComfyUI/custom_nodes` * Workflows directory: `/workflows` (for custom endpoints) ## Building Your Image We recommend using a **manifest file** to download models at container startup rather than baking them into your Docker image. Model registries (like Hugging Face and Civitai) are often faster than our container registry plus decompression time, and this approach keeps your images small and flexible. ### Recommended: Manifest-Based Dockerfile Create a `manifest.yaml` file that specifies your models and custom nodes: ```yaml manifest.yaml theme={null} # Custom nodes to install from the Comfy Registry custom_nodes: - comfyui-impact-pack - comfyui-videohelpersuite # Models to download models: # Downloaded before the server starts accepting requests before_start: - url: https://huggingface.co/Comfy-Org/flux1-schnell/resolve/main/flux1-schnell-fp8.safetensors local_path: /opt/ComfyUI/models/checkpoints/flux1-schnell-fp8.safetensors - url: https://civitai.com/api/download/models/128713 local_path: /opt/ComfyUI/models/checkpoints/dreamshaper_8.safetensors # Optional: Downloaded in the background after startup after_start: - url: https://huggingface.co/some/optional-model.safetensors local_path: /opt/ComfyUI/models/checkpoints/optional-model.safetensors ``` Then create a minimal Dockerfile: ```dockerfile theme={null} FROM ghcr.io/saladtechnologies/comfyui-api:comfy0.7.0-api1.16.1-torch2.8.0-cuda12.8-runtime # Copy manifest for automatic model/node installation at startup COPY manifest.yaml . ENV MANIFEST=manifest.yaml # Optional: Warmup workflow to pre-load models into VRAM COPY warmup_workflow.json . ENV WARMUP_PROMPT_FILE=warmup_workflow.json CMD ["./comfyui-api"] ``` The manifest supports: * **apt packages** - System dependencies * **pip packages** - Python dependencies * **custom_nodes** - From Comfy Registry (by name) or Git URLs * **models.before_start** - Downloaded before accepting requests * **models.after_start** - Downloaded in the background after startup ```mermaid theme={null} flowchart TB Start[Container Starts] --> Manifest[Process Manifest] Manifest --> Apt[Install apt packages] Apt --> Pip[Install pip packages] Pip --> Nodes[Install custom nodes] Nodes --> Models[Download before_start models] Models --> ComfyUI[Start ComfyUI] ComfyUI --> Warmup{Warmup configured?} Warmup -->|Yes| RunWarmup[Run warmup workflow] Warmup -->|No| Ready RunWarmup --> Ready["/ready returns 200"] Ready --> Traffic[Accept traffic] Ready -.-> Background[Download after_start models] ``` ### Manifest URL Sources Models can be downloaded from multiple sources: | Source | URL Format | Notes | | - | - | - | | HTTP/HTTPS | `https://example.com/model.safetensors` | Direct downloads | | Hugging Face | `https://huggingface.co/org/repo/resolve/main/model.safetensors` | Supports gated models with `HF_TOKEN` | | Civitai | `https://civitai.com/api/download/models/12345` | Use API download URLs | | S3 | `s3://bucket/path/model.safetensors` | Requires AWS credentials | | Azure | `https://account.blob.core.windows.net/container/model.safetensors` | Requires Azure credentials | For authenticated sources, set the appropriate environment variables (`HF_TOKEN`, `AWS_ACCESS_KEY_ID`, etc.) or use [per-request credentials](#credentials-for-protected-sources). ### Alternative: Baking Models Into Images If you prefer to include models in your Docker image (useful for air-gapped environments or guaranteed availability): ```dockerfile theme={null} FROM ghcr.io/saladtechnologies/comfyui-api:comfy0.7.0-api1.16.1-torch2.8.0-cuda12.8-runtime # Copy model into the image (increases image size significantly) COPY my-model.safetensors /opt/ComfyUI/models/checkpoints/ # Install custom nodes at build time RUN comfy node registry-install comfyui-impact-pack CMD ["./comfyui-api"] ``` Note: This approach results in larger images and slower cold starts on SaladCloud. ## Dynamic Model Loading In addition to the manifest, you can load models dynamically at runtime. This is useful for: * User-specified models per request * A/B testing different model versions * Multi-tenant deployments ### Model URLs in Workflows Specify a URL instead of a filename in your workflow, and the model will be automatically downloaded and cached: ```json theme={null} { "4": { "inputs": { "ckpt_name": "https://huggingface.co/Comfy-Org/flux1-schnell/resolve/main/flux1-schnell-fp8.safetensors" }, "class_type": "CheckpointLoaderSimple" } } ``` Supported URL schemes: * `https://` - Direct HTTP downloads (including Hugging Face and Azure Blob Storage) * `s3://bucket/path` - S3-compatible storage ### The /download Endpoint Pre-download models before they're needed: ```bash theme={null} # Asynchronous download (returns immediately with 202, default behavior) curl -X POST http://localhost:3000/download \ -H "Content-Type: application/json" \ -d '{ "url": "https://huggingface.co/Comfy-Org/flux1-schnell/resolve/main/flux1-schnell-fp8.safetensors", "model_type": "checkpoints" }' # Synchronous download (blocks until complete) curl -X POST http://localhost:3000/download \ -H "Content-Type: application/json" \ -d '{ "url": "https://huggingface.co/Comfy-Org/flux1-schnell/resolve/main/flux1-schnell-fp8.safetensors", "model_type": "checkpoints", "wait": true }' ``` Parameters: * `url` - The URL to download from * `model_type` - Where to save the model (e.g., `checkpoints`, `loras`, `vae`, `controlnet`) * `filename` - Optional filename override (defaults to URL basename) * `wait` - Set to `true` to wait for download to complete (default: `false`) ### Credentials for Protected Sources Credentials for model downloads and storage backends can be configured globally via environment variables, and optionally overridden per-request. **Global credentials (environment variables):** ```dockerfile theme={null} # Hugging Face (for gated models) ENV HF_TOKEN=hf_xxxxxxxxxxxxx # AWS S3 ENV AWS_ACCESS_KEY_ID=your-access-key ENV AWS_SECRET_ACCESS_KEY=your-secret-key ENV AWS_REGION=us-east-1 # Azure Blob Storage ENV AZURE_STORAGE_CONNECTION_STRING=your-connection-string # Custom HTTP auth header (for any HTTP source) ENV HTTP_AUTH_HEADER_NAME=Authorization ENV HTTP_AUTH_HEADER_VALUE=Bearer your-token ``` **Per-request credentials (override global):** You can also provide credentials in individual requests, which override any global settings: ```json theme={null} { "prompt": { "...": "..." }, "credentials": [ { "url_pattern": "https://huggingface.co/**", "auth": { "type": "bearer", "token": "hf_xxxxxxxxxxxxx" } }, { "url_pattern": "s3://my-private-bucket/**", "auth": { "type": "s3", "access_key_id": "AKIAIOSFODNN7EXAMPLE", "secret_access_key": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY" } } ] } ``` Supported authentication types: `bearer`, `basic`, `header`, `query`, `s3`. ### LRU Caching Limit local storage usage with automatic cache eviction: ```dockerfile theme={null} ENV LRU_CACHE_SIZE_GB=50 ``` When the cache exceeds this size, least-recently-used files are automatically deleted. ## Warmup Configuration The first request to a cold instance is slow because models must be loaded into VRAM. Configure a warmup workflow to pre-load models before accepting traffic: 1. Create a warmup workflow JSON (use reduced steps/resolution for speed) 2. Add it to your Dockerfile: ```dockerfile theme={null} COPY warmup_workflow.json . ENV WARMUP_PROMPT_FILE=warmup_workflow.json ``` The `/ready` probe will return 503 until warmup completes, ensuring the load balancer only routes to warm instances. **Tip:** Use 1-4 steps and small dimensions (256x256) for fast warmups while still loading the model. ## Output Handling ### Base64 Response (Default) Images are returned as base64-encoded strings in the response: ```json theme={null} { "id": "abc123", "images": ["base64encodeddata..."], "filenames": ["ComfyUI_00001.png"], "execution_time_ms": 2500 } ``` Decode with CLI tools: ```bash theme={null} jq -r '.images[0]' response.json | base64 -d > image.png ``` ### Image Format Conversion Convert output to JPEG or WebP with quality control: ```json theme={null} { "prompt": { "...": "..." }, "convert_output": { "format": "jpeg", "options": { "quality": 85, "progressive": true } } } ``` ### Storage Backends Upload outputs directly to cloud storage and receive URLs in the response instead of base64 data. This is especially important for video generation where files are large. Credentials can be configured globally via environment variables (see [Credentials for Protected Sources](#credentials-for-protected-sources)) or provided per-request. **S3-Compatible Storage (AWS, Cloudflare R2, etc.):** ```json theme={null} { "prompt": { "...": "..." }, "s3": { "bucket": "my-bucket", "prefix": "outputs/", "async": false } } ``` Response returns S3 URLs instead of base64: ```json theme={null} { "id": "abc123", "images": ["s3://my-bucket/outputs/abc123_ComfyUI_0.png"], "filenames": ["abc123_ComfyUI_0.png"], "execution_time_ms": 2500 } ``` **Azure Blob Storage:** ```json theme={null} { "prompt": { "...": "..." }, "azure_blob_upload": { "container": "my-container", "blob_prefix": "outputs/", "async": false } } ``` Response returns Azure URLs: ```json theme={null} { "id": "abc123", "images": ["https://your-account.blob.core.windows.net/my-container/outputs/abc123_ComfyUI_0.png"], "filenames": ["abc123_ComfyUI_0.png"] } ``` **Hugging Face:** ```json theme={null} { "prompt": { "...": "..." }, "hf_upload": { "repo": "username/my-outputs", "path_prefix": "generated/" } } ``` **Upload behavior:** * `async: false` (default) - Waits for upload to complete, returns URLs in response * `async: true` - Returns immediately, uploads in background (use with webhooks) See the [ComfyUI API documentation](https://github.com/SaladTechnologies/comfyui-api#modular-storage-backends) for all storage options. ### Webhook Delivery Send results to a webhook URL for async processing: ```json theme={null} { "prompt": { "...": "..." }, "webhook": "https://api.example.com/comfy-complete" } ``` Webhooks follow the [Standard Webhooks](https://www.standardwebhooks.com/) specification with HMAC signature verification. Configure a secret: ```dockerfile theme={null} ENV WEBHOOK_SECRET=your-secret-here ``` ## Custom Workflow Endpoints Create simplified REST endpoints by adding TypeScript/JavaScript files to the `/workflows` directory. This transforms complex ComfyUI node graphs into clean, validated REST APIs with automatic Swagger documentation. ```mermaid theme={null} flowchart LR subgraph Request[Simple API Request] Simple["{prompt, width, height}"] end Simple -->|Validate & Transform| Endpoint["/workflow/txt2img"] Endpoint -->|generateWorkflow| Complex subgraph ComfyUI[ComfyUI Prompt] Complex["Complex Node Graph
(KSampler, VAE, CLIP, etc.)"] end ``` **Why use custom endpoints?** * Hide ComfyUI's node-based complexity from API consumers * Add input validation with helpful error messages * Set sensible defaults for optional parameters * Create task-specific APIs (txt2img, img2img, upscale, etc.) ### Basic Structure Each workflow file must export a `Workflow` object with: * `RequestSchema` - A [Zod](https://zod.dev/) schema defining the input parameters * `generateWorkflow` - A function that transforms input into a ComfyUI prompt * `summary` / `description` - Optional metadata for Swagger docs **Example:** Create `/workflows/txt2img.ts`: ```typescript theme={null} import { z } from 'zod' import config from '../config' const RequestSchema = z.object({ prompt: z.string().describe('The positive prompt for image generation'), negative_prompt: z.string().optional().default('text, watermark').describe('The negative prompt'), width: z.number().int().min(256).max(2048).optional().default(1024).describe('Width of the generated image'), height: z.number().int().min(256).max(2048).optional().default(1024).describe('Height of the generated image'), steps: z.number().int().min(1).max(100).optional().default(20).describe('Number of sampling steps'), cfg_scale: z.number().min(0).max(20).optional().default(7).describe('Classifier-free guidance scale'), seed: z .number() .int() .optional() .default(() => Math.floor(Math.random() * 100000000000)) .describe('Seed for reproducibility'), // Use config to get available models, samplers, schedulers sampler_name: config.samplers.optional().default('euler'), scheduler: config.schedulers.optional().default('normal'), checkpoint: z .string() .optional() .default(config.warmupCkpt || config.models.checkpoints.all[0]), }) type Input = z.infer function generateWorkflow(input: Input) { return { '3': { inputs: { seed: input.seed, steps: input.steps, cfg: input.cfg_scale, sampler_name: input.sampler_name, scheduler: input.scheduler, denoise: 1, model: ['4', 0], positive: ['6', 0], negative: ['7', 0], latent_image: ['5', 0], }, class_type: 'KSampler', }, '4': { inputs: { ckpt_name: input.checkpoint }, class_type: 'CheckpointLoaderSimple', }, '5': { inputs: { width: input.width, height: input.height, batch_size: 1 }, class_type: 'EmptyLatentImage', }, '6': { inputs: { text: input.prompt, clip: ['4', 1] }, class_type: 'CLIPTextEncode', }, '7': { inputs: { text: input.negative_prompt, clip: ['4', 1] }, class_type: 'CLIPTextEncode', }, '8': { inputs: { samples: ['3', 0], vae: ['4', 2] }, class_type: 'VAEDecode', }, '9': { inputs: { filename_prefix: 'output', images: ['8', 0] }, class_type: 'SaveImage', }, } } export default { RequestSchema, generateWorkflow, summary: 'Text to Image', description: 'Generate an image from a text prompt', } ``` ### Directory Structure = URL Paths The directory structure maps directly to endpoint URLs: ``` /workflows ├── txt2img.ts → POST /workflow/txt2img ├── img2img.ts → POST /workflow/img2img └── sdxl/ ├── txt2img.ts → POST /workflow/sdxl/txt2img ├── txt2img-refiner.ts → POST /workflow/sdxl/txt2img-refiner └── img2img.ts → POST /workflow/sdxl/img2img ``` ### The Config Object Import `config` to access runtime information: ```typescript theme={null} import config from '../config' // Available models (scanned from /opt/ComfyUI/models at startup) config.models.checkpoints.all // ['model1.safetensors', 'model2.safetensors'] config.models.loras.all // ['lora1.safetensors', ...] config.models.controlnet.all // [...] // Zod enums for validation config.samplers // z.enum(['euler', 'euler_ancestral', 'heun', ...]) config.schedulers // z.enum(['normal', 'karras', 'exponential', ...]) // Warmup checkpoint (if WARMUP_PROMPT_FILE was set) config.warmupCkpt // 'model-used-in-warmup.safetensors' ``` ### Adding to Your Dockerfile ```dockerfile theme={null} COPY workflows /workflows ``` Workflow files are loaded at runtime via `eval`, so no rebuild is needed when using the pre-built binary. ### Calling Custom Endpoints Custom endpoints wrap your input parameters in an `input` field, and support all the same output options as `/prompt`: ```bash theme={null} curl -X POST http://localhost:3000/workflow/txt2img \ -H "Content-Type: application/json" \ -d '{ "input": { "prompt": "a beautiful sunset over mountains", "width": 1024, "height": 768 }, "s3": { "bucket": "my-bucket", "prefix": "outputs/" } }' ``` The `input` object contains your workflow-specific parameters (defined by `RequestSchema`), while output options like `s3`, `webhook`, and `convert_output` remain at the root level. ### AI-Assisted Workflow Generation The comfyui-api repository includes a script to automatically generate workflow endpoints from ComfyUI JSON exports using Claude: ```bash theme={null} # Requires ANTHROPIC_API_KEY environment variable ./generate-workflow workflow_api.json /workflows/my-workflow.ts ``` See the [comfyui-api documentation](https://github.com/SaladTechnologies/comfyui-api/blob/main/DEVELOPING.md#automating-with-claude-4-sonnet) for details. ### Debugging Enable debug logging to troubleshoot workflow loading: ```dockerfile theme={null} ENV LOG_LEVEL=debug ``` This shows which workflows are loaded, transpilation status, and any errors. For a complete real-world example with video generation, see the [Video Generation Guide](/container-engine/how-to-guides/ai-machine-learning/deploy-video-generation-comfy). ## Local Testing 1. Build your Docker image: ```bash theme={null} docker build -t my-comfyui . ``` 2. Run locally with GPU access: ```bash theme={null} docker run -it --rm --gpus all \ -p 3000:3000 \ -p 8188:8188 \ my-comfyui ``` 3. Access the interfaces: * **API:** [http://localhost:3000](http://localhost:3000) * **Swagger docs:** [http://localhost:3000/docs](http://localhost:3000/docs) * **ComfyUI Web UI:** [http://localhost:8188](http://localhost:8188) 4. Design your workflow in the Web UI, then export it: * Open Settings (gear icon) * Enable "Dev mode Options" * Click "Save (API Format)" to download the workflow JSON 5. Test the API: ```bash theme={null} curl -X POST http://localhost:3000/prompt \ -H "Content-Type: application/json" \ -d '{"prompt": }' \ | jq -r '.images[0]' | base64 -d > output.png ``` ## Deploying to SaladCloud > [!TIP] > > ComfyUI images are large and can take a while to download on a node that hasn't pulled them. To keep each test round > short, see [Cold Starts and Iterating Quickly](/container-engine/how-to-guides/cold-starts-and-iterating-quickly). ### Container Gateway Deployment 1. Push your image to a container registry: ```bash theme={null} docker push your-registry/your-image:tag ``` 2. Create a Container Group via the [Portal](https://portal.salad.com) or [API](/reference/saladcloud-api/container-groups/create-container-group): * Set appropriate hardware (see [Hardware Recommendations](#hardware-recommendations)) * Enable Container Gateway on port **3000** * **Use least-connection load balancing** (recommended for inference workloads) * Configure health probes: * **Startup probe:** `GET /health` * **Readiness probe:** `GET /ready` * Set replicas to **3 minimum** (5+ for production) * Optional: Enable authentication with `Salad-Api-Key` header 3. Wait for deployment: * Image caches to SaladCloud's internal registry * Nodes download and start your container * Warmup workflow runs (if configured) * Instances become "ready" 4. Submit requests to your Access Domain Name. ### Job Queue Deployment For video generation or long-running tasks (anything that might exceed the 100-second gateway timeout), use the Job Queue system. #### How the Job Queue Works ```mermaid theme={null} flowchart LR Client -->|Submit Job| Queue[SaladCloud Job Queue] Queue -->|Distribute| Worker[Queue Worker] subgraph Container[Container Instance] Worker -->|Forward| API[ComfyUI API] API -->|Execute| ComfyUI[ComfyUI] ComfyUI -->|Output| API API -->|Response| Worker end API -->|Upload| Storage[(Cloud Storage)] Worker -->|Result| Queue Queue -->|Poll or Webhook| Client ``` **Flow:** 1. **Submit jobs to the queue** - Your client sends requests to the SaladCloud Job Queue API (not directly to your container) 2. **Queue buffers and distributes** - Jobs are held in the queue and distributed to available container instances 3. **Worker fetches and processes** - The job queue worker binary running in your container fetches jobs and forwards them to comfyui-api on localhost 4. **Results returned to queue** - Outputs are sent back to the queue, where your client can fetch them or receive them via webhook 5. **Automatic retries** - If a node is interrupted (common on SaladCloud), the job is automatically retried on another node (up to 3 times) #### When to Use Job Queues | Use Case | Gateway | Job Queue | | - | - | - | | Image generation (\<30s) | Recommended | Works | | Complex image workflows (30-90s) | Usually OK | Safer | | Video generation (1-30 min) | Won't work | Required | | Batch processing | Not ideal | Recommended | | Production with SLA requirements | Risky | Recommended | #### Setup Steps 1. **Add the job queue worker to your Dockerfile:** ```dockerfile theme={null} # Download and install the job queue worker RUN wget https://github.com/SaladTechnologies/salad-cloud-job-queue-worker/releases/latest/download/salad-http-job-queue-worker_x86_64.tar.gz && \ tar -xvf salad-http-job-queue-worker_x86_64.tar.gz && \ rm salad-http-job-queue-worker_x86_64.tar.gz && \ chmod +x salad-http-job-queue-worker # Run both the worker and comfyui-api CMD ["bash", "-c", "./salad-http-job-queue-worker & ./comfyui-api"] ``` 2. **Create a Job Queue** via the [API](/reference/saladcloud-api/queues/create-queue): ```bash theme={null} curl -X POST "https://api.salad.com/api/public/organizations/{org}/projects/{project}/queues" \ -H "Salad-Api-Key: $SALAD_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "comfyui-jobs", "display_name": "ComfyUI Job Queue", "description": "Queue for ComfyUI image/video generation" }' ``` 3. **Create a Container Group** connected to the queue (do not enable Container Gateway) 4. **Submit jobs** to the queue: ```bash theme={null} curl -X POST "https://api.salad.com/api/public/organizations/{org}/projects/{project}/queues/{queue}/jobs" \ -H "Salad-Api-Key: $SALAD_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "input": { "prompt": {"4": {"inputs": {}, "class_type": "CheckpointLoaderSimple"}}, "s3": { "bucket": "my-bucket", "prefix": "outputs/" } }, "webhook": "https://api.example.com/job-complete" }' ``` 5. **Receive results** via webhook or poll the job status endpoint See the [Job Queue documentation](/container-engine/explanation/job-processing/job-queues) for full API details, and the [Video Generation Guide](/container-engine/how-to-guides/ai-machine-learning/deploy-video-generation-comfy) for a complete implementation example. ## API Reference ### POST /prompt Submit a ComfyUI workflow for execution. **Request:** ```json theme={null} { "id": "optional-request-id", "prompt": {}, "webhook": "https://example.com/callback", "convert_output": { "format": "jpeg", "options": { "quality": 85 } }, "credentials": [], "s3": { "bucket": "my-bucket", "prefix": "outputs/" } } ``` The `prompt` field contains your ComfyUI workflow JSON. See [Output Handling](#output-handling) for storage options. **Response:** ```json theme={null} { "id": "request-id", "images": ["base64..."], "filenames": ["output_00001.png"], "execution_time_ms": 2500, "execution_stats": { "comfy_time_ms": 2300, "preprocessing_ms": 100, "upload_time_ms": 100 } } ``` ### GET /health Returns 200 when the server has started. Use for startup probes. ### GET /ready Returns 200 when ready to serve traffic (warmup complete, not overloaded). Returns 503 otherwise. Use for readiness probes. ### POST /download Download a model to the local cache. ### GET /models List available models by type (checkpoints, loras, etc.). ### POST /interrupt Cancel a running prompt by ID. ## Video Generation ComfyUI API supports video generation models including: * **LTX Video** - Fast, Apache 2.0 licensed * **Hunyuan Video** - High quality, open source * **CogVideoX** - Text and image to video * **Mochi Video** - Research model * **Cosmos 1.0** - NVIDIA's video model **Important:** For video generation, we strongly recommend uploading outputs to cloud storage (S3, Azure, Hugging Face) rather than returning them as base64 strings. Video files are significantly larger than images and can cause memory issues or timeout problems when returned in the response body. Video generation typically takes 1-30 minutes depending on length and quality, so **Job Queues are required**. For a complete video generation tutorial, see the [Video Generation Guide](/container-engine/how-to-guides/ai-machine-learning/deploy-video-generation-comfy). ## Next Steps * [ComfyUI Recipe](/container-engine/reference/recipes/comfyui) - Deploy pre-configured images from the Portal * [Video Generation Guide](/container-engine/how-to-guides/ai-machine-learning/deploy-video-generation-comfy) - Complete video generation tutorial * [Job Queue Documentation](/container-engine/explanation/job-processing/job-queues) - Async processing setup * [ComfyUI API GitHub](https://github.com/SaladTechnologies/comfyui-api) - Full documentation and examples * [Salad Recipes Repository](https://github.com/SaladTechnologies/salad-recipes) - Example Dockerfiles for popular models # Create and Deploy A Video Generation API on SaladCloud Source: https://docs.salad.com/container-engine/how-to-guides/ai-machine-learning/deploy-video-generation-comfy A step-by-step guide to creating and deploying a video generation API on SaladCloud, using ComfyUI and ComfyUI API. *Last Updated: October 7, 2026* This guide will take you step by step through the process of creating and deploying a production ready video-generation service on SaladCloud. We will be using the following technologies: * [ComfyUI](https://github.com/comfyanonymous/ComfyUI/) - A highly modular user interface and inference engine for diffusion models. * [ComfyUI API](https://github.com/SaladTechnologies/comfyui-api) - A RESTful API for ComfyUI. * [SaladCloud](https://salad.com/) - A platform for deploying containerized GPU-accelerated applications at scale. * [Docker](https://www.docker.com/) - A tool for developing, shipping, and running applications in containers. * [LTX Video](https://huggingface.co/Lightricks/LTX-Video) - An open-source Apache 2.0 licensed video generation model capable of both text to video, and image to video generation. * [Typescript](https://www.typescriptlang.org/) - A strongly typed programming language that builds on JavaScript that we can use to write a custom endpoint for our API. * [wget](https://www.gnu.org/software/wget/) - A command-line utility for downloading files from the web. Optional, but useful for downloading model weights. This guide assumes you have a basic understanding of the technologies listed above. If you are new to any of these tools, we recommend you familiarize yourself with them before proceeding. Additionally, you will need a SaladCloud account to deploy your service. It will be helpful, but not strictly necessary to have a GPU available for local development. Any terminal commands in this guide are written for a Unix-like shell, such as bash, and this guide was developed using Ubuntu 22. > [!TIP] > > **Production Tip:** For production video generation, we recommend uploading outputs directly to cloud storage (S3, > Azure Blob, Hugging Face) rather than returning them as base64 strings in the response. Video files are significantly > larger than images and returning them in the response body can cause memory issues. See the [ComfyUI API storage > backends documentation](https://github.com/SaladTechnologies/comfyui-api#modular-storage-backends) for configuration > options. ## Step 1: Set Up Your Development Environment Before we can start building our video generation API, we need to set up our development environment, and create a repository to store our code. We will be using Typescript to write our API, so we need to install Node.js and Typescript. If you don't already have Node.js installed, I recommend using [nvm](https://github.com/nvm-sh/nvm) to install and manage Node.js versions. You will also need Docker installed on your machine to build and run your API, as well as to deploy it to SaladCloud. First, let's create a new directory for our project and initialize the git repo: ```bash theme={null} mkdir video-generation-api cd video-generation-api git init ``` We'll also go ahead and download our model weights to this directory. You may instead link the file from a different directory, if you already have it locally, e.g. in your ComfyUI installation (if you have one). Download the model weights and save them to the `video-generation-api` directory: * [Checkpoint](https://huggingface.co/Lightricks/LTX-Video/blob/main/ltx-video-2b-v0.9.1.safetensors) * [Text Encoder](https://huggingface.co/Comfy-Org/mochi_preview_repackaged/blob/main/split_files/text_encoders/t5xxl_fp16.safetensors) This can be done with the following commands: ```bash theme={null} wget https://huggingface.co/Lightricks/LTX-Video/resolve/main/ltx-video-2b-v0.9.1.safetensors wget https://huggingface.co/Comfy-Org/mochi_preview_repackaged/resolve/main/split_files/text_encoders/t5xxl_fp16.safetensors ``` Next, open your code editor in this directory. Create a new file called `.gitignore` and add the following content: ```plaintext theme={null} *.safetensors node_modules ``` This will prevent you from checking the model weights themselves into version control, as they are quite large. Later in this guide we're going to install javascript modules, and we don't want to check those in either. ## Step 2: Create a Docker Image We'll use a manifest file to download models at container startup rather than baking them into the Docker image. This keeps the image small and takes advantage of fast model registry downloads. Create a file called `manifest.yaml`: ```yaml manifest.yaml theme={null} apt: - libgl1 - libgl1-mesa-glx - libglib2.0-0 custom_nodes: - comfyui-videohelpersuite models: before_start: - url: https://huggingface.co/Lightricks/LTX-Video/resolve/main/ltx-video-2b-v0.9.1.safetensors local_path: /opt/ComfyUI/models/checkpoints/ltx-video-2b-v0.9.1.safetensors - url: https://huggingface.co/Comfy-Org/mochi_preview_repackaged/resolve/main/split_files/text_encoders/t5xxl_fp16.safetensors local_path: /opt/ComfyUI/models/clip/t5xxl_fp16.safetensors ``` Create another new file, and name it `Dockerfile`. This file will contain the instructions for building your Docker image. Add the following content to the file: ```dockerfile theme={null} FROM ghcr.io/saladtechnologies/comfyui-api:comfy0.7.0-api1.16.1-torch2.8.0-cuda12.8-devel COPY manifest.yaml . ENV MANIFEST=manifest.yaml ``` This Dockerfile is based on the [ComfyUI API](https://github.com/SaladTechnologies/comfyui-api) image, which is a pre-built docker image that includes ComfyUI, the ComfyUI API and all dependencies. The tag indicates the version of ComfyUI, ComfyUI API, Torch, and CUDA that the image is built with. The `devel` tag indicates that this image contains the full CUDA toolkit, which is necessary for running the LTX Video model. The manifest file specifies the model weights and custom nodes to install at startup. For now, we're going to build this docker image, and then run it to develop our workflow in ComfyUI. ```bash theme={null} docker build -t video-generation-api . ``` Once the build has completed (this may take a while), you can run the image with the following command: ```bash theme={null} docker run --gpus all --rm -it --name video-gen-api \ -p 8188:8188 -p 3000:3000 \ video-generation-api ``` After 5-10 seconds, you should see a log indicating the success of the ComfyUI API server starting up. You can now go to `http://localhost:8188` in your browser to access the ComfyUI user interface. You can use this interface to develop and test your video generation workflow. ## Step 3: Develop Your Video Generation Workflow ComfyUI uses a node-based interface to compose and execute workflows. Each node represents a step in the workflow and the links between nodes represent the flow of data and resources between them. This workflow graph can be saved as a JSON file, which can be imported into ComfyUI to recreate the workflow. ### Example Workflow For this example, we will create a workflow that generates a video of a cute fluffy husky puppy walking through the snow. The workflow will use the LTX Video model to generate the video.