api-serving
Use this sub-skill when the task is to expose Chinese-LLaMA-Alpaca-2 through an HTTP service, especially an OpenAI-compatible completion or chat endpoint.
Use it when
- the user mentions
openai_api_server.py,openai_api_protocol.py, FastAPI, Uvicorn, or SSE streaming - the task is about
/v1/completions,/v1/chat/completions,/v1/models, request validation, or response schemas - the user asks how to serve a base model plus optional LoRA adapter
- the task is about optional vLLM serving constraints
Workflow
- Read
references/workflows.mdfor endpoint, server, and request-schema details. - Use
scripts/openai_server_demo/openai_api_server.pyfor the non-vLLM FastAPI server. - Use the vLLM script only after installing the optional vLLM/FastChat stack.
- Confirm model path, tokenizer path, LoRA path, quantization, and CPU/GPU flags before launch.
- Read
references/troubleshooting.mdfor model-name, optional dependency, and serving-runtime failures.
Bundled runtime files
scripts/openai_server_demo/openai_api_server.pyscripts/openai_server_demo/openai_api_protocol.pyscripts/openai_server_demo/openai_api_server_vllm.py(optional dependency path)scripts/openai_server_demo/openai_api_protocol_vllm.py(optional dependency path)scripts/attn_and_long_ctx_patches.py
What to read first
references/workflows.mdfor endpoint shape and server flagsreferences/troubleshooting.mdfor optional vLLM, LoRA, quantization, and model-name issues
Routing notes
- Use this sub-skill for HTTP service behavior and request/response schemas.
- Use
hf-inferencefor direct local generation with no server. - Use
local-integrationsfor llama.cpp server wrappers rather than the FastAPI server.
