Choose an application runtime
Distinguish External API, Load Balancer, and Queue, and keep runtime separate from user experience.
Three runtime choices
External API is hosted outside GridNexa. Load Balancer and Queue are endpoint semantics for platform-hosted releases. Choose based on protocol, duration, and worker lifecycle—not on whether the app has a UI.
external_api GridNexa -> your HTTPS endpoint
load_balancer GridNexa -> a healthy HTTP worker
queue GridNexa task -> runtime lease -> your handlerExternal API
Use this when you already operate a production HTTPS service, GPUs, and scaling. GridNexa handles listing, authentication, pricing, forwarding, and usage records; you own external availability.
- Provide a reachable HTTPS endpoint.
- Accept the documented JSON body and identity headers.
- Limit response size and honor platform timeouts.
- Configure runtime endpoints and user-facing experience URLs separately.
Load Balancer
Use Load Balancer for low-latency synchronous requests, streaming HTTP, or custom business paths. The container runs a normal HTTP server.
- Listen on the declared container port.
- Implement a lightweight, side-effect-free health check.
- Map stable operations to HTTP methods and paths in the manifest.
- For app-level 202 jobs, expose a declared read-only status operation.
Queue Worker
Use Queue for video generation, batch work, and unpredictable runtimes. The worker registers, heartbeats, leases jobs, and reports progress, output, and usage through gridnexa-runtime.
- Ship the business handler in the image.
- The worker communicates through the Runtime API and does not require a host business port.
- Readiness comes from runtime registration and heartbeat, not /ping.
- The platform injects a runtime token for worker communication with the Runtime API.
from gridnexa_runtime import Worker
def handler(job):
operation = job["operation"]
payload = job["input"]
if operation == "generate":
return {"output": generate(payload)}
raise ValueError(f"Unsupported operation: {operation}")
Worker(handler=handler).run()Runtime and experience settings
Platform Gradio, external link/embed, and API-only describe how users access an app. Load Balancer and Queue describe how work executes. These settings are configured separately.
The current v1 publishing wizard can still require platform experience data. API-only is a target product mode, so documentation and UI distinguish current and planned support.
How to choose
Choose from request behavior rather than technology preference.
- Existing self-hosted production service: External API.
- Low latency, streaming, or custom paths: Load Balancer.
- Queueing, leases, retries, cancellation, or long execution: Queue.
- Separate independent resource or scaling boundaries into runtime profiles.