AGENT SKILL

litgpt

Use LitGPT to run local LLM inference, chat, finetuning, pretraining, checkpoint conversion, evaluation, and LitServe deployment with safe checks and workflow routing.

License 许可
Apache-2.0
最近更新
2026-09-03
Stars
★ 351
Forks
27

01 前言 Front Matter

name
litgpt
license
Apache 2.0
metadata
{ "disco-role": "operating" }
description
Use LitGPT to run local LLM inference, chat, finetuning, pretraining, checkpoint conversion, evaluation, and LitServe deployment with safe checks and workflow routing.
disable-model-invocation
true

02 资源文件 5

03 SKILL.md 正文

LitGPT Repo Skill

Use this skill when a user asks about LitGPT, the litgpt CLI, the litgpt Python package, local LLM generation, finetuning, pretraining, checkpoint conversion, evaluation, or serving. This root skill routes tasks to focused sub-skills and keeps long workflows self-contained.

Install And Import Baseline

Public installation patterns:

pip install litgpt
pip install 'litgpt[extra]'

Use the base package for core CLI/API inspection and local checkpoint workflows. Use litgpt[extra] only when the user needs optional surfaces such as evaluation harness support, LitServe, dataset helpers, logging integrations, quantization, or tokenizer/model conversion extras.

Run the bundled environment check before relying on optional routes:

python scripts/check_litgpt_environment.py --json

Minimal import check:

from litgpt import Config, GPT, LLM, Tokenizer
print(Config.from_name("pythia-14m").name)

Route By Task

  • sub-skills/inference-chat/: local generation, chat REPLs, Python LLM.load / LLM.generate, prompt styles, sampling, quantized inference, sequential/tensor-parallel generation, and offline generation planning.
  • sub-skills/training-data/: finetune_lora, QLoRA, full finetuning, adapter/adapter_v2, pretraining, continued pretraining, JSON/JSONL SFT data, built-in data modules, config recipes, training args, resume/logging, and OOM-safe command construction.
  • sub-skills/checkpoint-conversion/: download, validate, HF-to-LitGPT conversion, LitGPT-to-HF conversion, pretrained checkpoint export, LoRA merge, model config lookup, tokenizer/config layout, and checkpoint directory classification.
  • sub-skills/evaluation-serving/: evaluate, LM Evaluation Harness task planning, result files, serve, LitServe simple/streaming/OpenAI-compatible endpoints, curl examples, and optional dependency checks.

Common Routing Patterns

  • If the user has a model name but no local files, start with sub-skills/checkpoint-conversion/ for litgpt download and format decisions.
  • If the user has a local checkpoint and wants text output, start with sub-skills/inference-chat/ after a checkpoint layout check.
  • If the user has training data or wants LoRA/QLoRA/full finetuning, start with sub-skills/training-data/, then return to checkpoint conversion for LoRA merge or to inference/evaluation for downstream use.
  • If the user asks for benchmarks, lm_eval, HTTP endpoints, OpenAI-compatible requests, or streaming APIs, start with sub-skills/evaluation-serving/.
  • If multiple workflows apply, validate checkpoint layout first, validate data second, and only then run expensive model loading, training, evaluation, or serving.

Shared References

  • references/capability-map.md: workflow-to-sub-skill routing, optional dependency ownership, and safe native verification candidates.
  • references/troubleshooting.md: cross-cutting install/import, optional dependency, hardware, download, CLI config, data, checkpoint, and path failures.
  • references/repo-provenance.md: source repository snapshot and refresh baseline for detecting stale skill content.
  • references/repo-routing-metadata.json: structured routing metadata consumed by DisCo import tooling.

Shared Script

  • scripts/check_litgpt_environment.py: safe environment and optional dependency probe. It imports metadata and optional packages only; it does not download models, load weights, train, evaluate, or start a server.

Safety Defaults

  • Treat downloads, checkpoint conversion, training, evaluation, and serving as potentially expensive; ask before running them unless the user has already authorized a bounded run.
  • Prefer help commands, bundled checkers, static layout validation, --print_config, tiny fixtures, and dry planning before running GPU/model workflows.
  • Never expose access tokens in commands. Prefer environment variables or the user's secured credential mechanism.
  • Avoid assuming CUDA, bitsandbytes, lm_eval, LitServe, Thunder, XLA, or logger integrations are installed. Check optional dependencies first.
  • Runtime guidance in this skill is self-contained. Do not depend on the original source checkout for docs, tests, examples, or helper scripts.

04 同仓库更多 Skills

VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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).

★ 351