Skip to content
Back to skills

Inference And Serving

ASecurity

"Use this sub-skill for LlamaFactory inference, ChatModel usage,

  • 247 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 8, 2026
businesspythonfastapitestingapibackend

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 6 files and shows the line behind each finding

Scanned September 8, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill inference-and-serving --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Inference And Serving?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Inference And Serving
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-inference-and-serving-arex-skill/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-inference-and-serving-arex-skill)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: inference-and-serving
description: "Use this sub-skill for LlamaFactory inference, ChatModel usage,
  chat/webchat/api commands, OpenAI-compatible serving, backend selection,
  streaming, score evaluation, API auth, and batch vLLM prediction workflows."
disable-model-invocation: true
metadata:
  disco-role: operating
license: Apache 2.0
---

# Inference and Serving

Use this sub-skill when an agent needs to run or debug LlamaFactory inference and serving flows for version `0.9.6.dev0` source behavior.

## Route Here For

- Using `ChatModel` from Python for `chat`, `stream_chat`, `get_scores`, and their async variants.
- Launching `llamafactory-cli chat`, `lmf chat`, `llamafactory-cli webchat`, `llamafactory-cli api`, or `lmf api`.
- Calling the OpenAI-compatible FastAPI server endpoints `/v1/models`, `/v1/chat/completions`, and `/v1/score/evaluation`.
- Choosing `infer_backend: huggingface`, `infer_backend: vllm`, or `infer_backend: sglang` for inference configs.
- Diagnosing streaming SSE, API key, score-vs-chat endpoint, and missing backend package failures.
- Planning safe batch prediction with vLLM and optional BLEU/ROUGE-style metric output.

## Boundaries

- Route model, tokenizer, quantization, adapter merge, and export failures to the `model-loading-and-export` sub-skill.
- Route template, prompt formatting, multimodal placeholder, dataset, and preprocessing issues to `data-and-templates` unless the failure is specific to API request payload handling.
- Route non-API LlamaBoard/Web UI install, browser, port, and operational issues to `webui-and-ops`.
- Keep runtime instructions self-contained; do not depend on repository checkout scripts or examples.

## Fast Path

1. Pick an inference config YAML with `model_name_or_path`, `template`, and `infer_backend`; the default architecture is v0 unless `USE_V1=1` is explicitly set.
2. For local interactive testing, run `llamafactory-cli chat CONFIG.yaml` or `lmf chat CONFIG.yaml`.
3. For OpenAI-compatible serving, run `API_PORT=8000 llamafactory-cli api CONFIG.yaml` and call `http://HOST:PORT/v1/...` endpoints.
4. Use `API_KEY` only when bearer-token auth is desired; clients must send `Authorization: Bearer $API_KEY` when it is set.
5. Prefer `infer_backend: huggingface` for broad compatibility and score evaluation; use `vllm` or `sglang` for faster generation when those optional packages and GPU resources are available.

## Bundled References

- `references/chat-and-api.md` covers `ChatModel`, CLI commands, API routes, request shapes, streaming, auth, env vars, and native verification candidates.
- `references/backend-selection.md` compares Hugging Face, vLLM, and SGLang inference backends and includes batch vLLM metric flow notes.
- `references/troubleshooting.md` maps common serving failures to likely causes and fixes.

## Bundled Scripts

- `scripts/openai_api_smoke.py` is a standalone OpenAI-compatible smoke client for model listing, chat, optional streaming, optional score evaluation, and API-key verification.
- `scripts/vllm_batch_infer.py` is a safe wrapper that prints or optionally runs a LlamaFactory batch vLLM command only when the caller supplies concrete model/config arguments.

Files in this skill

  • SKILL.md3.1 KB
  • references/backend-selection.md6.3 KB
  • references/chat-and-api.md6.5 KB
  • references/troubleshooting.md5.9 KB
  • scripts/openai_api_smoke.py5.9 KB
  • scripts/vllm_batch_infer.py7.1 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.