inference-server

Inicia y prueba el servidor de inferencia prime-rl. Úsalo cuando se te pida ejecutar inferencia, iniciar vLLM, probar un modelo o lanzar el servidor de inferencia.

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

Más skills de 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
Crear y gestionar conjuntos de datos en Hugging Face Hub. Permite inicializar repositorios, definir configuraciones/indicaciones del sistema, transmitir actualizaciones de filas y realizar consultas/transformaciones de conjuntos de datos basadas en SQL. Diseñado para funcionar junto con el servidor HF MCP para flujos de trabajo integrales de conjuntos de datos.
official
Hugging Face Evaluation
huggingface
Agregar y gestionar resultados de evaluación en tarjetas de modelo de Hugging Face. Permite extraer tablas de evaluación del contenido README, importar puntuaciones desde la API de Artificial Analysis y ejecutar evaluaciones de modelo personalizadas con vLLM/lighteval. Funciona con el formato de metadatos model-index.
official
Hugging Face Jobs
huggingface
Ejecuta cualquier carga de trabajo en la infraestructura de Hugging Face Jobs. Incluye scripts UV, trabajos basados en Docker, selección de hardware, estimación de costos, autenticación con tokens, gestión de secretos, configuración de tiempo de espera y persistencia de resultados. Diseñado para cargas de trabajo de cómputo de propósito general, incluyendo procesamiento de datos, inferencia, experimentos, trabajos por lotes y cualquier tarea basada en Python.
official
Hugging Face Model Trainer
huggingface
Entrena o ajusta modelos de lenguaje usando TRL (Transformer Reinforcement Learning) en la infraestructura de trabajos de Hugging Face. Cubre los métodos de entrenamiento SFT, DPO, GRPO y modelado de recompensas, además de la conversión a GGUF para implementación local. Incluye orientación sobre preparación de conjuntos de datos, selección de hardware, estimación de costos y persistencia del modelo.
official
Hugging Face Paper Publisher
huggingface
Publica y gestiona artículos de investigación en Hugging Face Hub. Permite crear páginas de artículos, vincularlos a modelos/conjuntos de datos, reclamar autoría y generar artículos de investigación profesionales basados en Markdown.
official
Hugging Face Tool Builder
huggingface
Construye scripts y herramientas reutilizables usando la API de Hugging Face. Útil al encadenar o combinar llamadas a la API, o cuando las tareas se repetirán o automatizarán. Crea scripts reutilizables de línea de comandos para obtener, enriquecer o procesar datos de Hugging Face Hub.
official
Hugging Face Trackio
huggingface
Seguimiento y visualización de experimentos de entrenamiento de ML con Trackio. Úsalo para registrar métricas durante el entrenamiento (API de Python) o para recuperar/analizar métricas registradas (CLI). Admite visualización en tablero en tiempo real, sincronización con HF Space y salida JSON para automatización.
official