inference-server

Iniciar e testar o servidor de inferência prime-rl. Use quando solicitado a executar inferência, iniciar vLLM, testar um modelo ou iniciar o servidor de inferência.

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

Mais skills de huggingface

cpu-kernels
huggingface
Fornece orientação para escrever, otimizar e fazer benchmarking de kernels de CPU em C++ com intrínsecos SIMD (AVX2/AVX512) para o ecossistema de kernels do Hugging Face. Inclui…
official
generate-openenv-env
huggingface
Gere ambientes OpenEnv a partir de um caso de uso concreto (por exemplo, "gere um env para a biblioteca textarena"). Use quando for solicitado a projetar ou implementar um novo…
official
hf-mcp
huggingface
Use o Hugging Face Hub por meio das ferramentas do servidor MCP. Pesquise modelos, datasets, Spaces, papers. Obtenha detalhes de repositórios, busque documentação, execute jobs de computação e use Gradio…
official
trl-training
huggingface
Treine e ajuste modelos de linguagem transformer usando TRL (Transformers Reinforcement Learning). Suporta treinamento de SFT, DPO, GRPO, KTO, RLOO e Modelo de Recompensa…
official
deploy-hf
huggingface
Implante um ambiente OpenEnv no Hugging Face Spaces. Use quando for solicitado a implantar, enviar para o Hugging Face ou atualizar um espaço.
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
Validar alterações antes de enviar um pull request. Executar verificações abrangentes incluindo lint, testes, revisão de alinhamento e análise de RFC. Usar antes de criar um…
official
example-skill
huggingface
Skill de fixture de exemplo para testes de ação smoke
official