> This page is for NeMo-RL, version último (default).
> For other versions, use one of these documentation indexes:
> - último (default): https://es.nvidia-localization.ferndocs.com/es/nemo/rl/latest/llms.txt
> - 0.3.0: https://es.nvidia-localization.ferndocs.com/es/nemo/rl/0-3-0/llms.txt
> - 0.2.1: https://es.nvidia-localization.ferndocs.com/es/nemo/rl/0-2-1/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://es.nvidia-localization.ferndocs.com/es/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://es.nvidia-localization.ferndocs.com/es/_mcp/server.

# nemo_rl.models.generation.vllm.vllm_worker_async

## Contenido del Módulo

### Clases

| Nombre                                                                                             | Descripción |
| -------------------------------------------------------------------------------------------------- | ----------- |
| [`VllmAsyncGenerationWorker`](#nemorlmodelsgenerationvllmvllmworkerasyncvllmasyncgenerationworker) | Ninguno     |

### API

```python
class nemo_rl.models.generation.vllm.vllm_worker_async.VllmAsyncGenerationWorker
```

**Bases**: `nemo_rl.models.generation.vllm.vllm_worker.BaseVllmGenerationWorker`

```python
_create_engine(llm_kwargs: dict[str, typing.Any]) -> None
```

```python
post_init_async()
```

```python
init_collective_async(
    rank_prefix: int,
    ip: str,
    port: int,
    world_size: int
) -> None
```

```python
generate_async(
    data: nemo_rl.distributed.batched_data_dict.BatchedDataDict[nemo_rl.models.generation.interfaces.GenerationDatumSpec],
    greedy: bool = False
) -> typing.AsyncGenerator[tuple[int, nemo_rl.distributed.batched_data_dict.BatchedDataDict[nemo_rl.models.generation.interfaces.GenerationOutputSpec]], None]
```

Genera un lote de datos utilizando el AsyncLLMEngine de vLLM, produciendo resultados a medida que están listos.

Argumentos:
data: BatchedDataDict con input_ids y input_lengths
greedy: Si se debe usar decodificación voraz en lugar de muestreo

Produce:
Tupla de (índice_original, BatchedDataDict que se ajusta a GenerationOutputSpec para la secuencia única)

```python
generate_text_async(
    data: nemo_rl.distributed.batched_data_dict.BatchedDataDict[nemo_rl.models.generation.interfaces.GenerationDatumSpec],
    greedy: bool = False
) -> typing.AsyncGenerator[tuple[int, nemo_rl.distributed.batched_data_dict.BatchedDataDict[nemo_rl.models.generation.interfaces.GenerationOutputSpec]], None]
```

Genera respuestas de texto de forma asíncrona, produciendo resultados a medida que están listos.

Argumentos:
data: BatchedDataDict que contiene indicaciones con cadenas de texto
greedy: Si se debe usar decodificación voraz en lugar de muestreo

Produce:
Tupla de (índice_original, BatchedDataDict que contiene una única respuesta de texto)

```python
report_device_id_async() -> list[str]
```

Versión asíncrona de report_device_id.

```python
prepare_refit_info_async(state_dict_info: dict[str, typing.Any]) -> None
```

Versión asíncrona de prepare_refit_info.

```python
update_weights_from_ipc_handles_async(ipc_handles: dict[str, typing.Any]) -> bool
```

Versión asíncrona de update_weights_from_ipc_handles.

Argumentos:
ipc_handles (dict): Diccionario que mapea UUID de dispositivos (str) a identificadores IPC de parámetros.

Devuelve:
bool: Verdadero si los pesos se actualizaron con éxito, Falso en caso contrario.

```python
update_weights_from_collective_async() -> bool
```

Versión asíncrona de update_weights_from_collective.

```python
reset_prefix_cache_async()
```

Versión asíncrona de reset_prefix_cache.

```python
sleep_async()
```

Versión asíncrona de sleep.

```python
wake_up_async(**kwargs)
```

Versión asíncrona de wake_up.

```python
shutdown() -> bool
```

Limpiar recursos de vLLM.