inference-server

द्वारा huggingface

प्राइम-आरएल इन्फरेंस सर्वर को शुरू और परीक्षण करें। जब इन्फरेंस चलाने, vLLM शुरू करने, मॉडल का परीक्षण करने या इन्फरेंस सर्वर लॉन्च करने के लिए कहा जाए तो इसका उपयोग करें।

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

huggingface की और Skills

cpu-kernels
huggingface
C++ CPU कर्नेल लिखने, अनुकूलित करने और बेंचमार्क करने के लिए मार्गदर्शन प्रदान करता है, जिसमें Hugging Face कर्नेल इकोसिस्टम के लिए SIMD इंट्रिन्सिक्स (AVX2/AVX512) शामिल हैं। इसमें…
official
generate-openenv-env
huggingface
एक ठोस उपयोग मामले से OpenEnv वातावरण उत्पन्न करें (उदाहरण के लिए, "लाइब्रेरी textarena के लिए एक env उत्पन्न करें")। जब किसी नए को डिज़ाइन या कार्यान्वित करने के लिए कहा जाए तो इसका उपयोग करें…
official
hf-mcp
huggingface
Hugging Face Hub का उपयोग MCP सर्वर टूल्स के माध्यम से करें। मॉडल, डेटासेट, Spaces, पेपर्स खोजें। रिपॉजिटरी विवरण प्राप्त करें, दस्तावेज़ीकरण लाएं, कंप्यूट जॉब चलाएं, और Gradio का उपयोग करें…
official
trl-training
huggingface
ट्रांसफॉर्मर भाषा मॉडल को TRL (ट्रांसफॉर्मर्स रीइन्फोर्समेंट लर्निंग) का उपयोग करके प्रशिक्षित और फाइन-ट्यून करें। SFT, DPO, GRPO, KTO, RLOO और रिवॉर्ड मॉडल प्रशिक्षण का समर्थन करता है…
official
deploy-hf
huggingface
OpenEnv वातावरण को Hugging Face Spaces पर तैनात करें। जब तैनात करने, Hugging Face पर पुश करने, या स्पेस अपडेट करने के लिए कहा जाए तो इसका उपयोग करें।
official
hf-space-recovery
huggingface
Diagnose and recover failing or stuck Hugging Face Space deployments for OpenEnv environments. Use when deploying envs from `envs/` to the Hub (`openenv`…
official
pre-submit-pr
huggingface
पुल रिक्वेस्ट सबमिट करने से पहले बदलावों को मान्य करें। लिंट, टेस्ट, संरेखण समीक्षा और आरएफसी विश्लेषण सहित व्यापक जांच चलाएं। इसका उपयोग बनाने से पहले करें...
official
example-skill
huggingface
एक्शन स्मोक टेस्ट के लिए उदाहरण फिक्स्चर स्किल
official