leptonai
Use the LeptonAI Python SDK and lep CLI for NVIDIA DGX Cloud Lepton workspaces, endpoint calls, workloads, storage, secrets, ingress routing, and safe cloud-operation planning.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- leptonai
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Use the LeptonAI Python SDK and lep CLI for NVIDIA DGX Cloud Lepton workspaces, endpoint calls, workloads, storage, secrets, ingress routing, and safe cloud-operation planning.
- disable-model-invocation
- true
02 资源文件 7
- 参考文档references/package-overview.md5.0 KB
- 参考文档references/repo-provenance.md2.8 KB
- 参考文档references/repo-routing-metadata.json497 B
- 参考文档references/troubleshooting.md4.9 KB
- 参考文档references/workload-taxonomy.md2.9 KB
- 脚本scripts/inspect_leptonai.py5.6 KB
- 脚本scripts/leptonai_smoke_check.py5.9 KB
03 SKILL.md 正文
LeptonAI
Use this repo skill when the task involves the leptonai Python package, the lep CLI, or NVIDIA DGX Cloud Lepton workspace operations: endpoints, jobs, dev pods, Ray clusters, fine-tuning jobs, storage, secrets, ingress, logs, or Python endpoint clients.
Do not run live Lepton cloud mutations just because this skill is loaded. Creating, updating, stopping, deleting, uploading, downloading, setting ingress endpoints, creating secrets, or opening pod ssh requires explicit user confirmation for the single target after a read-first plan.
First checks
Install for normal use:
pip install -U leptonai
lep --help
For a source checkout or contributor context:
pip install -e .
# add tests only when needed for repo-native validation
pip install -e .[test]
Minimal Python import smoke:
import leptonai
from leptonai.client import Client, local
print(leptonai.__version__)
print(local(8080))
Safe bundled checks that do not contact Lepton:
python scripts/leptonai_smoke_check.py --groups endpoint workspace job pod ingress storage
python scripts/inspect_leptonai.py
Route by task
| User task | Read next |
|---|---|
Discover lep, list command groups, classify read-only vs mutating commands, handle hidden aliases or abbreviations, scope outputs/logs |
sub-skills/cli-operations/SKILL.md |
Log in, choose/switch workspaces, inspect auth state safely, build APIClient, troubleshoot 401/403/404/token/URL issues |
sub-skills/workspace-and-auth/SKILL.md |
Call a deployed endpoint from Python, inspect OpenAPI-derived Client paths, build SDK scripts with v2 API resources or Pydantic specs |
sub-skills/sdk-client/SKILL.md |
| Operate endpoints/deployments, dev pods, jobs, Ray clusters, fine-tunes, templates, resource shapes, logs, events, nodes | sub-skills/workload-management/SKILL.md |
| Plan storage/file transfer, secrets, ingress/canary routing, IP allowlists, tokens, mount/env/secret validation | sub-skills/storage-secrets-ingress/SKILL.md |
| Check package version, Python support, entry points, and refresh baseline | references/package-overview.md and references/repo-provenance.md |
| Diagnose install/import, CLI availability, version warnings, credentials, network, or stale skill concerns | references/troubleshooting.md |
Safety defaults
- Prefer help and read-only commands before any mutation:
lep --help,lep <group> --help,lep workspace list/status/id/url,lep endpoint list/status,lep job list/get,lep ingress get, orlep storage ls. - Expand hidden aliases and abbreviations to full names in plans. Prefer
lep endpointover hidden legacylep deployment, and preferlep storageover hiddenlep fileunless a user explicitly needs compatibility. - Redact tokens and secret values. Avoid
lep workspace tokenunless the user explicitly asks to retrieve the raw token as the task. - Treat
create,update,stop,start,restart,remove,delete,rm,rmdir,upload,downloadto sensitive local paths,ingress set-endpoints, andpod sshas mutating or high-impact. - For mutations, read current state first, show exact command, workspace, target resource/path/domain, observed state, and one-sentence impact; ask for explicit confirmation for that target only.
- Live Lepton operations require authenticated workspace context and may incur cost, alter traffic, expose endpoints, or delete cloud data.
Important boundaries
- Local GPU hardware is not required to use the SDK/CLI package. Lepton workloads may request GPU resource shapes in the remote workspace, but that is a cloud-capacity decision, not a local CUDA install requirement.
Client(...)for a real URL/workspace endpoint fetches OpenAPI metadata and makes network calls. Useno_check=Trueonly when intentionally deferring that check.APIClient()and its resource methods are live workspace API clients. Do not instantiate or call them for mutation unless the workspace/auth route has established context and the user has approved the operation.- This generated skill is self-contained. If the current package source, CLI commands, or tests differ from references/repo-provenance.md, refresh the skill rather than relying on stale routes.
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).