FastAPI Patterns
Hand-rolling a FastAPI app around a chain or graph gives you control LangServe doesn't: custom auth, arbitrary request/response shapes, and full ownership of streaming.
Hand-rolling a FastAPI app around a chain or graph gives you control LangServe doesn't: custom auth, arbitrary request/response shapes, and full ownership of streaming.
langserve wraps a Runnable in a FastAPI app and gives you /invoke, /batch, /stream, and /stream_events endpoints, plus request/response schemas derived from the chain's input/output types — for free, with no route code of your own.