# generate_langgraph_json

> **Function** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/client/launch/server/generate_langgraph_json)

Generate a `langgraph.json` config file for `langgraph dev`.

Registers the interactive `agent` graph and dcode's custom HTTP operations,
which opt into LangGraph's route-auth layer (`enable_custom_route_auth`) so a
deployment that configures auth gates them. Production runs `noop` auth and
relies on the loopback bind, so that gate is inert there -- see
`auth_path` below and THREAT_MODEL.md TB10. `/offload` is served by that
backend boundary rather than exposed as another client-addressable graph.

## Signature

```python
generate_langgraph_json(
    output_dir: str | Path,
    *,
    graph_ref: str = _DCODE_GRAPH_REF,
    env_file: str | None = None,
    checkpointer_path: str | None = None,
    auth_path: str | None = None,
) -> Path
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `output_dir` | `str \| Path` | Yes | Directory to write the config file. |
| `graph_ref` | `str` | No | Python "module:attribute" reference to the graph, where the attribute is a graph factory (e.g. `make_graph`) or a graph object. Custom graphs omit the built-in offload service, so `/offload` is unsupported when one is supplied. (default: `_DCODE_GRAPH_REF`) |
| `env_file` | `str \| None` | No | Optional path to an env file. (default: `None`) |
| `checkpointer_path` | `str \| None` | No | Import path to an async context manager that yields a `BaseCheckpointSaver`. When set, the server persists checkpoint data to disk instead of in-memory. (default: `None`) |
| `auth_path` | `str \| None` | No | Import path to a LangGraph `Auth` instance, emitted as the config's `auth.path`. Production servers run with `LANGGRAPH_AUTH_TYPE=noop` and no auth backend; this exists so tests can prove `enable_custom_route_auth` gates the operation routes when a deployment *does* configure one. (default: `None`) |

## Returns

`Path`

Path to the generated config file.

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/caaa7e7c12d214afa5cf0a1afed8eb6232aa6f7b/libs/code/deepagents_code/client/launch/server.py#L200)