Back to feed
Dev.to
Dev.to
6/23/2026
Running a LangGraph ReAct Agent in Production: OpenAI-Compatible API + Multi-Model Gateway + One-Line Tracing

Running a LangGraph ReAct Agent in Production: OpenAI-Compatible API + Multi-Model Gateway + One-Line Tracing

Short summary

This tutorial shows how to deploy a production LangGraph ReAct agent that exposes an OpenAI-compatible API, allowing any OpenAI client to use your custom agent unchanged. The architecture routes all model calls through a gateway (e.g., LiteLLM) so you can swap from hosted APIs to self-hosted vLLM with just a config change. Full request tracing integrates via a single Langfuse callback, enabling complete visibility into agent reasoning, tool calls, and LLM interactions—all in ~150 lines of Python.

  • Deploy LangGraph agents with OpenAI-compatible API for seamless integration with existing chat UIs and clients
  • Route model calls through a gateway to swap between hosted APIs and self-hosted vLLM without code changes
  • Add production tracing in one line via Langfuse callback for full visibility into agent reasoning and tool execution

Generated with AI, which can make mistakes.

Is this a good recommendation for you?

Comments

Failed to load comments. Please try again.

Explore more