serving
Configure and operate SkyPilot SkyServe services, replicas, readiness probes, updates, logs, and LLM serving recipes.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- serving
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Configure and operate SkyPilot SkyServe services, replicas, readiness probes, updates, logs, and LLM serving recipes.
- disable-model-invocation
- true
02 资源文件 3
- 参考文档references/serve-workflows.md9.8 KB
- 参考文档references/troubleshooting.md10.4 KB
- 脚本scripts/validate_service_yaml.py11.0 KB
03 SKILL.md 正文
SkyServe Serving
Use this sub-skill when the user wants to deploy, update, inspect, debug, or tear down a SkyPilot SkyServe service. It owns service YAML structure, readiness probes, exposed service ports, replica and autoscaling policy, load balancing policy, rolling and blue-green updates, service status/log/down commands, and LLM-serving adaptations for vLLM, SGLang, TGI, FastChat, Ray Serve, or generic HTTP servers.
Do not use this sub-skill for generic task YAML details, cloud credentials, Kubernetes/Slurm/SSH setup, storage/file-mount troubleshooting, interactive cluster operations, managed jobs, or API server mechanics. Route those to sibling sub-skills.
Read First
- For SkyServe service YAML patterns, CLI workflows, SDK equivalents, rollout plans, and LLM recipes, read references/serve-workflows.md.
- For readiness failures, wrong ports, stuck replicas, autoscaler behavior, update issues, log selection, cleanup, beta caveats, and LLM startup failures, read references/troubleshooting.md.
- For parser-only YAML checks, run scripts/validate_service_yaml.py; it does not launch services, start controllers, contact clouds, or open network sockets.
- For task fields such as
resources,setup,run,envs,secrets,workdir,file_mounts, andvolumes, use ../task-yaml/SKILL.md. - For provider credentials, GPU availability, Kubernetes, Slurm, SSH, object storage, and volume failures, use ../infrastructure-storage/SKILL.md.
- For Python SDK request handling, remote API server login, and API server lifecycle, use ../sdk-api-server/SKILL.md.
Operating Principles
- Treat a SkyServe YAML as a normal SkyPilot task plus a top-level
service:section; first ensure the replica process starts an HTTP endpoint on0.0.0.0and that the declaredresources.portsexposes the same ingress port. - Prefer
sky serve up --service-name <name> service.yamlfor first deployment,sky serve update <name> service.yaml --mode rollingfor compatible changes, and--mode blue_greenwhen traffic should switch only after enough new replicas become ready. - Use
sky serve status <name> -vandsky serve logsbefore changing YAML when replicas are stuck; status states distinguish controller initialization, provisioning, startup, readiness, preemption, cleanup, and no-replica autoscale-to-zero states. - Keep service names explicit for repeatable operations, especially update/down/log commands; generated names are convenient for demos but poor for automation.
- Add an explicit cleanup command in every plan:
sky serve down <name>for one service,sky serve down <name> --replica-id <id>for a single bad replica, orsky serve down <name> --purgeonly for failed services where resource leaks have been considered. - Remember SkyServe is beta; it is useful for internal serving, R&D, batch inference, and scarce-GPU availability experiments, but do not present it as a mature external production serving layer without caveats.
Fast Router
- New HTTP service YAML: validate with
python scripts/validate_service_yaml.py service.yaml --summary, then plansky serve up --service-name <name> service.yaml. - vLLM/SGLang/TGI service: choose the framework readiness endpoint (
/v1/modelsfor OpenAI-compatible vLLM,/healthfor SGLang/TGI), alignresources.portswith the server--port, add model download/GPU notes, and pass tokens throughsecretsor CLI--secretrather than inline plaintext. - Multiple replica or autoscaling request: use
service.replicasfor fixed count, orservice.replica_policywithmin_replicas,max_replicas, andtarget_qps_per_replicafor autoscaling. - Multiple exposed replica ports: set
resources.portsto the list and setservice.portsto the single ingress port for the load balancer. - Update/rollback request: preserve the last known-good YAML, use
sky serve update <name> <new.yaml> --mode rollingor--mode blue_green, and roll back by updating the service with the previous YAML. - Stuck service or failed request: inspect
sky serve status <name> -v,sky serve logs <name> <replica-id> --tail 200 --no-follow,sky serve logs --controller <name> --tail 200 --no-follow, andsky serve logs --load-balancer <name> --tail 200 --no-follow.
Safety Checklist
Before suggesting a command that mutates cloud resources, confirm:
- The user has accepted that
sky serve up,update, anddowncan create, replace, or delete cloud/Kubernetes resources. - The service YAML includes a
service:section and a replica HTTP endpoint reachable on the exposed port. - The readiness probe path starts with
/, uses the correct HTTP method expectation, and allows enoughinitial_delay_secondsfor model download and warmup. service.portsis set when multipleresources.portsare exposed, and it matches the application ingress port.- Secrets such as Hugging Face tokens, API keys, and auth tokens are provided through
secrets/--secret, not hard-coded into shared YAML. - GPU and model choices are realistic for the requested framework, model size, tensor parallelism, disk size, and download time.
Safe Validation
From this sub-skill directory, run:
python scripts/validate_service_yaml.py path/to/service.yaml --summary
The helper loads the YAML, validates the top-level service: block with SkyServe's parser, validates the surrounding Task when possible, checks common service/replica port pitfalls, and prints a concise summary. It is not a launch dry run and does not require cloud credentials.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).