๐Ÿ”ฅ Hot Topics

LangServe: Deploy Your LLM Chain to Production in 15 Minutes

FastAPI wrapper for LangChain. From local script to production endpoint with auth, monitoring, and streaming. Includes AWS Lambda deployment.

๐Ÿ“… June 30, 2026 ๐Ÿ“Š Level: intermediate ๐Ÿ“ฆ GitHub: langchain-ai/langserve

Sponsored

LangServe: Deploy Your LLM Chain to Production in 15 Minutes

LangServe wraps your LangChain runnables as a production REST API. Built on FastAPI, includes auth, batching, streaming, and a playground UI.

Your first LangServe endpoint

# app.py
from langchain_openai import ChatOpenAI
from langchain_core.prompts import ChatPromptTemplate
from langserve import add_routes

from fastapi import FastAPI
app = FastAPI(title="My LLM")

model = ChatOpenAI(model="gpt-4o-mini")
prompt = ChatPromptTemplate.from_template("Tell me a joke about {topic}")
chain = prompt | model

add_routes(app, chain, path="/joke")

# Run: uvicorn app:app --host 0.0.0.0 --port 8000

Thatโ€™s it. You now have:

Auth (add API key)

from langserve import add_routes
from fastapi import Depends, HTTPException
from fastapi.security import APIKeyHeader

API_KEY = "your-secret-key"
header = APIKeyHeader(name="X-API-Key")

def auth(api_key: str = Depends(header)):
    if api_key != API_KEY:
        raise HTTPException(status_code=401)

add_routes(app, chain, path="/joke", dependencies=[Depends(auth)])

Monitoring (LangSmith)

import os
os.environ["LANGCHAIN_TRACING_V2"] = "true"
os.environ["LANGCHAIN_API_KEY"] = "lsv2pt_..."
# All calls now traced in LangSmith dashboard

AWS Lambda deployment

# Install Mangum (ASGI โ†’ Lambda bridge)
pip install mangum
# lambda_handler.py
from mangum import Mangum
from app import app
handler = Mangum(app, lifespan="off")

Bundle with sam or cdk and deploy.

Sources

๐Ÿ“ฆ ๅผ€ๆบ้กน็›ฎ

ๆœฌๆ•™็จ‹ๅŸบไบŽๅผ€ๆบ้กน็›ฎ langchain-ai/langserve ๆ•ด็†ใ€‚

โญ View on GitHub โ†’

๐Ÿ“š Sources

Sponsored

๐Ÿ› ๏ธ Related Tools & Resources

Mechanical Keyboards โ†’
For coding & writing tutorials
USB-C Hubs โ†’
Multi-monitor dev setup
Noise-Cancelling Headphones โ†’
Focus while learning
Laptop Stands โ†’
Ergonomics for long tutorials