inference-server

Start and test the prime-rl inference server. Use when asked to run inference, start vLLM, test a model, or launch the inference server.

npx skills add https://github.com/huggingface/prime-rl --skill inference-server

Inference 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 routing
  • src/prime_rl/inference/server.py — vLLM env setup
  • src/prime_rl/configs/inference.pyInferenceConfig and all sub-configs
  • src/prime_rl/inference/vllm/server.py — FastAPI routes and vLLM monkey-patches
  • src/prime_rl/templates/inference.sbatch.j2 — SLURM template (handles both single and multi-node)
  • configs/debug/infer.toml — minimal debug config

Lebih banyak skill dari 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
Buat dan kelola dataset di Hugging Face Hub. Mendukung inisialisasi repositori, mendefinisikan konfigurasi/prompt sistem, pembaruan baris secara streaming, serta kueri/transformasi dataset berbasis SQL. Dirancang untuk bekerja bersama server HF MCP guna mendukung alur kerja dataset yang komprehensif.
official
Hugging Face Evaluation
huggingface
Tambahkan dan kelola hasil evaluasi di kartu model Hugging Face. Mendukung ekstraksi tabel evaluasi dari konten README, mengimpor skor dari Artificial Analysis API, dan menjalankan evaluasi model kustom dengan vLLM/lighteval. Bekerja dengan format metadata model-index.
official
Hugging Face Jobs
huggingface
Jalankan beban kerja apa pun di infrastruktur Hugging Face Jobs. Mencakup skrip UV, pekerjaan berbasis Docker, pemilihan perangkat keras, estimasi biaya, autentikasi dengan token, manajemen rahasia, konfigurasi batas waktu, dan persistensi hasil. Dirancang untuk beban kerja komputasi tujuan umum termasuk pemrosesan data, inferensi, eksperimen, pekerjaan batch, dan tugas berbasis Python apa pun.
official
Hugging Face Model Trainer
huggingface
Latih atau sesuaikan model bahasa menggunakan TRL (Transformer Reinforcement Learning) pada infrastruktur Hugging Face Jobs. Mencakup metode pelatihan SFT, DPO, GRPO, dan pemodelan reward, serta konversi GGUF untuk penerapan lokal. Termasuk panduan persiapan dataset, pemilihan perangkat keras, estimasi biaya, dan persistensi model.
official
Hugging Face Paper Publisher
huggingface
Publikasikan dan kelola makalah penelitian di Hugging Face Hub. Mendukung pembuatan halaman makalah, menautkan makalah ke model/dataset, mengklaim kepengarangan, dan menghasilkan artikel penelitian berbasis markdown profesional.
official
Hugging Face Tool Builder
huggingface
Bangun skrip dan alat yang dapat digunakan kembali menggunakan API Hugging Face. Berguna saat merangkai atau menggabungkan panggilan API, atau saat tugas akan diulang/diotomatiskan. Membuat skrip baris perintah yang dapat digunakan kembali untuk mengambil, memperkaya, atau memproses data dari Hugging Face Hub.
official
Hugging Face Trackio
huggingface
Lacak dan visualisasikan eksperimen pelatihan ML dengan Trackio. Gunakan saat mencatat metrik selama pelatihan (API Python) atau mengambil/menganalisis metrik yang tercatat (CLI). Mendukung visualisasi dasbor waktu nyata, sinkronisasi HF Space, dan keluaran JSON untuk otomatisasi.
official