> This page is for version 0.7.0.
> For other versions, use one of these documentation indexes:
> - Main (default): https://docs.nvidia.com/nemo/gym/main/llms.txt
> - 0.7.0: https://docs.nvidia.com/nemo/gym/v0.7.0/llms.txt
> - 0.6.0: https://docs.nvidia.com/nemo/gym/v0.6.0/llms.txt
> - 0.5.1: https://docs.nvidia.com/nemo/gym/v0.5.1/llms.txt
> - 0.5.0: https://docs.nvidia.com/nemo/gym/v0.5.0/llms.txt
> - 0.4.0: https://docs.nvidia.com/nemo/gym/v0.4.0/llms.txt
> - 0.3.0: https://docs.nvidia.com/nemo/gym/v0.3.0/llms.txt
> - 0.2.1: https://docs.nvidia.com/nemo/gym/v0.2.1/llms.txt

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

# nemo_gym.server_runtime.entrypoint_flags

Reading literal class flags, such as `ray_enabled`, from a server entrypoint's source without importing it.

## Module Contents

### Functions

| Name                                                                                                       | Description                                                                                               |
| ---------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
| [`_declared_class_flag`](#nemo_gym-server_runtime-entrypoint_flags-_declared_class_flag)                   | The literal boolean assigned to `name` in a class body, annotated or not, or None when there is none.     |
| [`_parse_entrypoint`](#nemo_gym-server_runtime-entrypoint_flags-_parse_entrypoint)                         | -                                                                                                         |
| [`_run_webserver_class_names`](#nemo_gym-server_runtime-entrypoint_flags-_run_webserver_class_names)       | -                                                                                                         |
| [`entrypoint_class_flag`](#nemo_gym-server_runtime-entrypoint_flags-entrypoint_class_flag)                 | The boolean class attribute `name` declared by the server an entrypoint starts, read from source.         |
| [`entrypoint_server_class_names`](#nemo_gym-server_runtime-entrypoint_flags-entrypoint_server_class_names) | The names of the classes an entrypoint calls `run_webserver()` on, read from source; empty if unreadable. |

### API

```python
nemo_gym.server_runtime.entrypoint_flags._declared_class_flag(
    class_node: ast.ClassDef,
    name: str
) -> bool | None
```

The literal boolean assigned to `name` in a class body, annotated or not, or None when there is none.

```python
nemo_gym.server_runtime.entrypoint_flags._parse_entrypoint(
    entrypoint_fpath: pathlib.Path
) -> ast.Module | None
```

```python
nemo_gym.server_runtime.entrypoint_flags._run_webserver_class_names(
    tree: ast.Module
) -> set[str]
```

```python
nemo_gym.server_runtime.entrypoint_flags.entrypoint_class_flag(
    entrypoint_fpath: pathlib.Path,
    name: str
) -> bool | None
```

The boolean class attribute `name` declared by the server an entrypoint starts, read from source.

Gym settles some things before any server exists, and each server runs in its own venv, so this reads the
source instead of importing it. It finds the classes the entrypoint calls `run_webserver()` on and checks
their literal `name` declarations (`name = True` or `name: ClassVar[bool] = True` in the class body).

Returns True when any of them declares True, False when all of them declare False, and None when that can't
be settled from the source alone, such as an inherited declaration, a class imported from another module, or
an unreadable entrypoint.

```python
nemo_gym.server_runtime.entrypoint_flags.entrypoint_server_class_names(
    entrypoint_fpath: pathlib.Path
) -> set[str]
```

The names of the classes an entrypoint calls `run_webserver()` on, read from source; empty if unreadable.