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

# Function global_context

> Return the process-global runtime context state handle.

Generated from `cargo doc --no-deps -p nemo-relay -p nemo-relay-adaptive -p nemo-relay-ffi`.

<pre />

Return the process-global runtime context state handle.

This lazily initializes the shared [`NemoRelayContextState`](/reference/api/rust-library-reference/nemo-relay/api/runtime/state/struct-nemorelaycontextstate) on first use and returns a cloned [`Arc`](https://doc.rust-lang.org/1.93.0/alloc/sync/struct.Arc.html) handle to the same underlying [`RwLock`](https://doc.rust-lang.org/1.93.0/std/sync/poison/rwlock/struct.RwLock.html) on every subsequent call.

## Returns

An [`Arc`](https://doc.rust-lang.org/1.93.0/alloc/sync/struct.Arc.html) pointing at the singleton [`RwLock`](https://doc.rust-lang.org/1.93.0/std/sync/poison/rwlock/struct.RwLock.html) that stores the runtime context state for the current process.

## Notes

All callers share the same underlying state. Mutations made through one handle are visible through every other handle returned by this function.