nemo_gym.client.server_client
nemo_gym.client.server_client
ServerClient, which finds Gym servers through the head server and calls them, and server URLs.
Module Contents
Classes
Functions
Data
NEMO_GYM_MODEL_SERVER_BASE_URL_ENV_VAR_NAME
NEMO_GYM_MODEL_SERVER_NAME_ENV_VAR_NAME
API
Bases: BaseModel
Return a connectable host for a server bind address.
Wildcard addresses are valid for binding a server but are not valid
advertised client targets. In particular, proxy-aware HTTP clients can
route 0.0.0.0 through an external proxy instead of reaching the
local server.
Read the optional header property of harnesses using this model server.
The property lives on the harness package so model workers need not import an agent’s app or install its runtime dependencies.
Return whether the global checkpoint: block enables partial-rollout checkpointing.
Args: server_name: str The name of the server you are trying to call. url_path: str The URL path in the server you are trying to call e.g. “/v1/responses”.
Build a client from the fully resolved global config.
Gym-launched server processes reuse the config injected by their parent. Other processes fetch the config from the head server.
Args: server_name: str The name of the server you are trying to call. url_path: str The URL path in the server you are trying to call e.g. “/v1/responses”.
Call another server. _control sends the call over the reserved control pool.
Return a connectable client host for a server bind address.
Append the rollout prefix and, while traces export, the current span’s trace context to a model-server root URL.
Every caller hands the result to a client Gym does not instrument (a harness in a sandbox, a
third-party client library), which is why the trace context travels in the URL here; Gym’s own
clients send the traceparent header instead and use url_path_for_run.
The span named is the one current when the URL is built, so pass trace_context=False for a
URL that is built once and reused across rollouts (a cached client): otherwise every later
rollout’s calls would be parented to the first one’s span.
Return the leading model-server path prefix for a rollout, if available.
Return /ng-trace/<traceparent> for the current span, or "" while traces are off or no span is current.
TraceContextPathMiddleware on the receiving Gym server turns it back into the header.