Skip to main content
LangChain’s ChatOpenAI takes a base_url, so Mesh needs no adapter, no shim, and no LangChain-specific package. Tool binding, structured output, streaming, and LangGraph all work unchanged.

Install

Connect

That is the whole integration. model="auto" hands model choice to Mesh’s auto-router; pass a catalog id such as openai/gpt-4o-mini to pin one.

Tool calling

Define tools with the @tool decorator — LangChain derives the JSON schema from the signature and docstring, and emits the standard tools payload that Mesh forwards:
The model Mesh served is on the response: first.response_metadata["model_name"]. With model="auto" this is how you see which model handled the request.

LangGraph

LangGraph takes the same llm object, so a prebuilt ReAct agent needs nothing Mesh-specific:
Pass callable tools to create_react_agent, not a raw JSON tool schema. A bare schema dict is accepted without error, but the graph has no function to execute, so the run finishes with empty content instead of an answer. A @tool-decorated function works; a plain dict silently does not.

Caveats

Everything in Caveats that apply to every framework applies here — in particular, pin a non-thinking model if you depend on multi-turn tool reasoning.