Prompt Management for LangChain Apps

LangChain gives you the chain. Endprompt manages the prompts inside it. Version, update, and roll back your LangChain prompts without touching code or redeploying.

Prompt Management for LangChain Apps

LangChain's ChatPromptTemplate gives you a clean way to define prompts with variable substitution. But the template strings themselves are still in your code. Change the system message, adjust the wording, swap the model — it's a code change, a commit, and a deploy.

Endprompt moves the prompt out of your chain and into versioned, observable endpoints. Your LangChain app passes in the inputs. Endprompt handles the rest.


The problem with prompts in LangChain apps

A typical LangChain setup using LCEL looks like this:

from langchain_core.prompts import ChatPromptTemplate
from langchain_openai import ChatOpenAI

prompt = ChatPromptTemplate.from_messages([
    ("system", "You are a helpful assistant that summarises content concisely."),
    ("human", "Summarise the following in 3 bullet points:\n\n{content}"),
])

model = ChatOpenAI(model="gpt-4o")
chain = prompt | model
result = chain.invoke({"content": content})

ChatPromptTemplate is a useful abstraction — but the system message and the prompt template are still hardcoded strings. Every time the wording needs to change, someone edits the file, commits, and redeploys. There's no version history for the prompt itself, no rollback if something breaks, and no visibility into what the rendered prompt actually looked like when a production request went wrong.


How Endprompt integrates with LangChain

You define the endpoint in the Endprompt dashboard: input schema, system prompt, user prompt template (using Liquid templating), and model. Endprompt executes the LLM call and returns the result.

Your chain becomes a simple API call:

import os
import requests

response = requests.post(
    f"{os.environ['ENDPROMPT_BASE_URL']}/api/v1/summarise",
    headers={
        "x-api-key": os.environ["ENDPROMPT_API_KEY"],
    },
    json={"content": content},
    timeout=60,
)

data = response.json()

The system message, the prompt template, the model, the temperature — all of it now lives in Endprompt. Your code passes in the inputs and gets back a result. The chain is gone. The prompt is infrastructure.


Environment variables

ENDPROMPT_API_KEY=ep_live_xxxxxxxxxxxxxxxxxxxx
ENDPROMPT_BASE_URL=https://your-tenant.api.endprompt.ai

Your Endprompt API key is under API Keys in the dashboard sidebar. Never expose it in client-side code or commit it to your repository.


Key benefits for LangChain teams

Prompts out of code Your system messages and prompt templates move to the Endprompt dashboard. No more hardcoded strings in your chains. No more deploys to change AI behaviour.

Full version history Every prompt change is versioned. See what changed and when. Compare versions side by side.

Instant rollback Promoted a new prompt version and outputs degraded? Roll back in one click. No hotfix deploy required.

Full observability Every request is logged: the rendered prompt, model response, latency, and cost. Replay any request from the dashboard to debug production issues.

Cost tracking per feature Track LLM spend per endpoint — not just at the model level. Know exactly what each AI feature in your LangChain app costs.

Non-technical iteration Domain experts can update prompt behaviour directly in the Endprompt dashboard — no engineering involvement, no PR, no redeploy.

Smart caching Enable caching per endpoint in the dashboard — no code changes required. Up to 67% cost reduction on repeated queries for stable, deterministic outputs.


Setup steps

  1. Create an endpoint in the Endprompt dashboard — define your input fields, write your system and user prompts using Liquid templating (e.g. {{ inputs.content }}), and choose your model.
  2. Copy your Endprompt API key from API Keys in the sidebar and add it to your environment variables alongside your tenant base URL.
  3. Replace your LangChain chain with a requests.post call to your Endprompt endpoint, passing your input fields in the request body.
  4. Iterate from the dashboard — update prompts, swap models, adjust parameters. Your code never changes.

Try it free

14-day free trial, no card required.

Start free trial · Read the quickstart docs


Related: Prompt Management API · Prompt Versioning · How to Manage Prompts in Production