hf-inference
Use this sub-skill for direct Transformers-based inference, interactive chat, speculative sampling, and prompt-template handling.
Use it when
- the user mentions
inference_hf.py,gradio_demo.py,speculative_sample.py, or the attention patch helpers - the task is about
--interactive,--with_prompt,--negative_prompt,--guidance_scale, or--speculative_sampling - the task needs CPU-only inference, 4-bit/8-bit loading, NTK scaling, or FlashAttention acceleration
- the user wants a chat UI rather than an HTTP server
Workflow
- Read
references/workflows.mdfor the supported CLI flag combinations. - Check
assets/prompts/andassets/tokenizer/if the task is about prompt wrapping or tokenizer compatibility. - Use
scripts/inference/inference_hf.pyfor single-turn or file-based generation. - Use
scripts/inference/gradio_demo.pyfor multi-turn chat or a browser UI. - Read
references/troubleshooting.mdif a run fails on tokenizer paths, draft models, optional acceleration helpers, or CPU/GPU constraints.
Bundled runtime files
scripts/inference/inference_hf.pyscripts/inference/gradio_demo.pyscripts/inference/speculative_sample.pyscripts/inference/flash_attn_patch_for_inference.pyscripts/attn_and_long_ctx_patches.py- root asset
../../assets/prompts/alpaca-2.txt - root asset
../../assets/prompts/alpaca-2-long.txt - root asset
../../assets/tokenizer/
What to read first
references/workflows.mdfor the supported CLI modes and prompt behaviorreferences/troubleshooting.mdfor optional acceleration and model-loading failures../../references/prompt-and-tokenizer.mdwhen the task is specifically about prompt text or tokenizer files
Routing notes
- Use this sub-skill for local generation and chat UX.
- Use the API-serving sub-skill when the task becomes an HTTP server instead of a direct generation CLI.
- The optional vLLM code path inside the inference CLI is still an inference concern, but the dedicated server sub-skill is usually the better choice when the user wants deployment rather than local generation.
