sdk-api-server
Use SkyPilot's Python SDK, async SDK, API server lifecycle commands, request IDs, remote login, compatibility checks, and dashboard deployment guidance.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- sdk-api-server
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Use SkyPilot's Python SDK, async SDK, API server lifecycle commands, request IDs, remote login, compatibility checks, and dashboard deployment guidance.
- disable-model-invocation
- true
02 资源文件 3
- 参考文档references/sdk-api-reference.md9.2 KB
- 参考文档references/troubleshooting.md6.2 KB
- 脚本scripts/inspect_sdk_surface.py3.7 KB
03 SKILL.md 正文
SDK API Server
Use this sub-skill when the user wants to drive SkyPilot programmatically or manage the API server: Python SDK equivalents of CLI workflows, async SDK usage, request IDs and sky.get(), sky.stream_and_get(), sky api start/stop/status/login/logout/info/logs/cancel, remote API server compatibility, dashboard access, API versioning, or API server deployment/debugging.
Do not use this sub-skill for detailed task YAML schema authoring, CLI cluster operations, managed jobs semantics, SkyServe service recipes, cloud credential setup, storage/provider troubleshooting, or repository contribution rules. Route those to the sibling sub-skills.
Read First
- For SDK request patterns, API server commands, async wrappers, and compatibility rules, read references/sdk-api-reference.md.
- For request ID, server health, remote login, dashboard, deployment, and version mismatch failures, read references/troubleshooting.md.
- For a safe installed-package probe that does not start an API server, run scripts/inspect_sdk_surface.py.
- For task construction details, route to the
task-yamlsub-skill. - For operational CLI workflows after code is converted, route to
cluster-operations,managed-jobs, orserving. - For cloud/Kubernetes credentials, storage, or resource selection failures, route to
infrastructure-storage. - For modifying SkyPilot server code, API schemas, protobufs, or dashboard build artifacts, route to
repo-development.
Operating Principles
- Treat most synchronous SDK calls as request submitters: they return a
RequestId, not the final result. Callsky.get(request_id)for structured results orsky.stream_and_get(request_id)when the user needs live logs and the result. - Convert CLI task inputs to
sky.Task.from_yaml(...)orsky.Task(...)plussky.Resources(...); keep YAML schema decisions intask-yamland keep cluster/job/service behavior in the owning operational sub-skill. - Start a local API server only when the user asks or the SDK call needs one; the inspection helper in this sub-skill intentionally imports and prints signatures only.
- Use
sky.api_login(endpoint=...)orsky api login -e ...before remote operations, and preferSKYPILOT_API_SERVER_ENDPOINTonly for temporary endpoint override in one environment. - Before adding or using newer SDK/API features against a remote server, check
sky.api_info()and version-gated behavior; old servers may ignore newer fields or raiseAPINotSupportedError. - For dashboard troubleshooting in a source checkout, rebuild the dashboard before restarting the API server; for Helm/Kubernetes upgrades, preserve deployed values with
--reuse-valuesand protect database/credential settings.
Common SDK Flow
import sky
task = sky.Task.from_yaml('task.yaml')
request_id = sky.launch(task, cluster_name='demo', dryrun=True)
job_id, handle = sky.get(request_id)
status_request_id = sky.status(['demo'])
clusters = sky.get(status_request_id)
For async code, import sky.client.sdk_async; convenience wrappers such as status() and launch() await the submitted request and return final results by default:
from sky.client import sdk_async as sky_async
clusters = await sky_async.status(['demo'])
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).