inference-server
bởi huggingface
Khởi động và kiểm tra máy chủ suy luận prime-rl. Sử dụng khi được yêu cầu chạy suy luận, khởi động vLLM, kiểm tra mô hình hoặc khởi chạy máy chủ suy luận.
npx skills add https://github.com/huggingface/prime-rl --skill inference-serverInference Server
Starting the server
Always use the inference entry point — never vllm serve or python -m vllm.entrypoints.openai.api_server directly. The entry point runs setup_vllm_env() which configures environment variables (LoRA, multiprocessing) before vLLM is imported.
# With a TOML config
uv run inference @ path/to/config.toml
# With CLI overrides
uv run inference --model.name Qwen/Qwen3-0.6B --model.max_model_len 2048 --model.enforce_eager
# Combined
uv run inference @ path/to/config.toml --server.port 8001 --gpu-memory-utilization 0.5
SLURM scheduling
The inference entrypoint supports optional SLURM scheduling, following the same patterns as SFT and RL.
Single-node SLURM
# inference_slurm.toml
output_dir = "/shared/outputs/my-inference"
[model]
name = "Qwen/Qwen3-8B"
[parallel]
tp = 8
[slurm]
job_name = "my-inference"
partition = "cluster"
uv run inference @ inference_slurm.toml
Multi-node SLURM (independent vLLM replicas)
Each node runs an independent vLLM instance. No cross-node parallelism — TP and DP must fit within a single node's GPUs.
# inference_multinode.toml
output_dir = "/shared/outputs/my-inference"
[model]
name = "PrimeIntellect/INTELLECT-3-RL-600"
[parallel]
tp = 8
dp = 1
[deployment]
type = "multi_node"
num_nodes = 4
gpus_per_node = 8
[slurm]
job_name = "my-inference"
partition = "cluster"
Dry run
Add dry_run = true to generate the sbatch script without submitting:
uv run inference @ config.toml --dry-run true
Custom endpoints
The server extends vLLM with:
/v1/chat/completions/tokens— accepts token IDs as prompt input (used by multi-turn RL rollouts)/update_weights— hot-reload model weights from the trainer/load_lora_adapter— load LoRA adapters at runtime/init_broadcaster— initialize weight broadcast for distributed training
Testing the server
curl http://localhost:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "Qwen/Qwen3-0.6B",
"messages": [{"role": "user", "content": "Hi"}],
"max_tokens": 50
}'
Key files
src/prime_rl/entrypoints/inference.py— entrypoint with local/SLURM routingsrc/prime_rl/inference/server.py— vLLM env setupsrc/prime_rl/configs/inference.py—InferenceConfigand all sub-configssrc/prime_rl/inference/vllm/server.py— FastAPI routes and vLLM monkey-patchessrc/prime_rl/templates/inference.sbatch.j2— SLURM template (handles both single and multi-node)configs/debug/infer.toml— minimal debug config
Thêm skills từ huggingface
Hugging Face Cli
huggingface
Execute Hugging Face Hub operations using the `hf` CLI. Use when the user needs to download models/datasets/spaces, upload files to Hub repositories, create repos, manage local cache, or run compute jobs on HF infrastructure. Covers authentication, file transfers, repository creation, cache operations, and cloud compute.
official
Hugging Face Datasets
huggingface
Tạo và quản lý tập dữ liệu trên Hugging Face Hub. Hỗ trợ khởi tạo kho lưu trữ, định nghĩa cấu hình/lời nhắc hệ thống, cập nhật hàng dữ liệu theo luồng, và truy vấn/chuyển đổi tập dữ liệu dựa trên SQL. Được thiết kế để hoạt động cùng với máy chủ HF MCP cho các quy trình làm việc tập dữ liệu toàn diện.
official
Hugging Face Evaluation
huggingface
Add and manage evaluation results in Hugging Face model cards. Supports extracting eval tables from README content, importing scores from Artificial Analysis API, and running custom model evaluations with vLLM/lighteval. Works with the model-index metadata format.
official
Hugging Face Jobs
huggingface
Chạy bất kỳ khối lượng công việc nào trên cơ sở hạ tầng Hugging Face Jobs. Bao gồm các tập lệnh UV, công việc dựa trên Docker, lựa chọn phần cứng, ước tính chi phí, xác thực bằng token, quản lý bí mật, cấu hình thời gian chờ và lưu trữ kết quả. Được thiết kế cho các khối lượng công việc tính toán đa năng bao gồm xử lý dữ liệu, suy luận, thử nghiệm, công việc hàng loạt và bất kỳ tác vụ nào dựa trên Python.
official
Hugging Face Model Trainer
huggingface
Train or fine-tune language models using TRL (Transformer Reinforcement Learning) on Hugging Face Jobs infrastructure. Covers SFT, DPO, GRPO and reward modeling training methods, plus GGUF conversion for local deployment. Includes guidance on dataset preparation, hardware selection, cost estimation, and model persistence.
official
Hugging Face Paper Publisher
huggingface
Xuất bản và quản lý các bài báo nghiên cứu trên Hugging Face Hub. Hỗ trợ tạo trang bài báo, liên kết bài báo với mô hình/bộ dữ liệu, xác nhận quyền tác giả và tạo các bài viết nghiên cứu chuyên nghiệp dựa trên markdown.
official
Hugging Face Tool Builder
huggingface
Build reusable scripts and tools using the Hugging Face API. Useful when chaining or combining API calls, or when tasks will be repeated/automated. Creates reusable command line scripts to fetch, enrich, or process data from Hugging Face Hub.
official
Hugging Face Trackio
huggingface
Track and visualize ML training experiments with Trackio. Use when logging metrics during training (Python API) or retrieving/analyzing logged metrics (CLI). Supports real-time dashboard visualization, HF Space syncing, and JSON output for automation.
official