Serve models with SGLang on Polyaxon
SGLang owns model loading, batching, parallelism, cache behavior, and the OpenAI-compatible API. Polyaxon owns placement, secrets, service lifecycle, access, logs, and the connection to evaluation workloads.
Outcome
A tracked SGLang service with a fixed model revision, explicit GPU request, model cache connection, and testable endpoint.
Service responsibilities
Polyaxon schedules
The service component fixes the image, model, port, accelerator request, connections, and health boundary.
The runtime serves
The inference engine loads the model and exposes its native or OpenAI-compatible API.
Clients validate
Smoke tests and evaluation operations exercise the endpoint while Polyaxon retains the deployment context.
Prerequisites
- A validated SGLang image compatible with the selected model and accelerator.
- A model cache and a scoped Hugging Face token connection for gated weights.
- Enough aggregate device memory for the chosen precision, context length, and parallelism.
Deploy and validate
- 1
Define the SGLang service
Expose the SGLang port through the Polyaxon service runtime and keep runtime flags in the component revision.
version: 1.1kind: componentname: sglang-serverrun: kind: service ports: [30000] rewritePath: true connections: [hf-token, model-cache] container: image: lmsysorg/sglang:v0.5.18 command: ["python3", "-m", "sglang.launch_server"] args: ["--model-path", "Qwen/Qwen3.6-27B", "--host", "0.0.0.0", "--port", "30000", "--tp", "4", "--reasoning-parser", "qwen3"] resources: limits: nvidia.com/gpu: "4"SGLang publishes this release tag. Pin its digest and confirm model and GPU compatibility before production.
- 2
Submit the operation
Run the component through the target Polyaxon project, queue, preset, and approval path.
polyaxon run -f sglang.yaml - 3
Call the OpenAI-compatible endpoint
Resolve the Polyaxon service URL and send a small request before running quality or load evaluations.
SERVICE_URL=$(polyaxon ops service --external --url)curl "$SERVICE_URL/v1/models"
Production checklist
Troubleshooting
The service never becomes ready
Inspect model download, credentials, disk space, GPU memory, runtime flags, port binding, and readiness behavior.
Requests fail through the URL
Verify the service port, rewrite-path setting, authentication header, ingress, network policy, and API path.
Latency degrades under load
Measure queueing, batch settings, context length, KV cache pressure, replica saturation, and storage or network contention.
Sources
Official platform, library, model, and Polyaxon references used by this guide.
Polyaxon SGLang integration
A source-reviewed SGLang component and endpoint workflow.
SGLang documentation
Current server, model, parallelism, and deployment behavior.
Install SGLang with Docker
Published image names, release tags, and server command.
Polyaxon service runtime
Service ports, replicas, connections, volumes, and external access.
Polyaxon model serving
Patterns for deploying APIs, loading models, and operating inference workloads.