# get_server_runtime

> **Function** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/server_graph/get_server_runtime)

Return resources shared by the graph and dcode operation routes.

Builds once and caches. A construction failure is converted into a
startup-error marker (scraped by the parent app process) before
`sys.exit(1)`, which is right for the `langgraph.json` graph factory at
startup. Callers in request scope must contain that exit -- `SystemExit` is a
`BaseException` -- as `offload_api._execute_offload` does, mapping it to a 503
rather than killing the server mid-request.

## Signature

```python
get_server_runtime() -> ServerRuntime
```

## Returns

`ServerRuntime`

The cached server runtime.

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/e4c1ffe9ee63d7854147de490ca27495ef157a7b/libs/code/deepagents_code/server_graph.py#L1055)