Skip to main content

[ ![🦜️🔗 Langchain](/img/brand/wordmark.png) ![🦜️🔗
Langchain](/img/brand/wordmark-dark.png) ](/) [ Docs
](/docs/get_started/introduction) [ Use cases ](/docs/use_cases) [
Integrations ](/docs/integrations/platforms/) [ Guides
](/docs/guides/debugging) [ API  ](https://api.python.langchain.com)

More

  * [ People ](/docs/people/)
  * [ Versioning ](/docs/packages)
  * [ Changelog ](/docs/changelog)
  * [ Contributing ](/docs/contributing)
  * [ Templates ](/docs/templates/)
  * [ Cookbooks  ](https://github.com/langchain-ai/langchain/blob/master/cookbook/README.md)
  * [ Tutorials ](/docs/additional_resources/tutorials)
  * [ YouTube ](/docs/additional_resources/youtube)

🦜️🔗

  * [ LangSmith  ](https://smith.langchain.com)
  * [ LangSmith Docs  ](https://docs.smith.langchain.com/)
  * [ LangServe GitHub  ](https://github.com/langchain-ai/langserve)
  * [ Templates GitHub  ](https://github.com/langchain-ai/langchain/tree/master/templates)
  * [ Templates Hub  ](https://templates.langchain.com)
  * [ LangChain Hub  ](https://smith.langchain.com/hub)
  * [ JS/TS Docs  ](https://js.langchain.com)

[ 💬  ](https://chat.langchain.com) [ ](https://github.com/langchain-
ai/langchain)

Search

  * [ Get started ](/docs/get_started)

    * [ Introduction ](/docs/get_started/introduction)
    * [ Installation ](/docs/get_started/installation)
    * [ Quickstart ](/docs/get_started/quickstart)
    * [ Security ](/docs/security)
  * [ LangChain Expression Language ](/docs/expression_language/)

    * [ Get started ](/docs/expression_language/get_started)
    * [ Why use LCEL ](/docs/expression_language/why)
    * [ Interface ](/docs/expression_language/interface)
    * [ Streaming ](/docs/expression_language/streaming)
    * [ How to ](/docs/expression_language/how_to/)

    * [ Cookbook ](/docs/expression_language/cookbook/)

    * [ LangChain Expression Language (LCEL) ](/docs/expression_language/)
  * [ Modules ](/docs/modules/)

    * [ Model I/O ](/docs/modules/model_io/)

    * [ Retrieval ](/docs/modules/data_connection/)

    * [ Agents ](/docs/modules/agents/)

    * [ Chains ](/docs/modules/chains)
    * [ More ](/docs/modules/memory/)

  * [ LangServe ](/docs/langserve)
  * [ LangSmith ](/docs/langsmith/)

  * [ LangGraph ](/docs/langgraph)

  * [ ](/)
  * LangChain Expression Language 

#  LangChain Expression Language (LCEL)

LangChain Expression Language, or LCEL, is a declarative way to easily compose
chains together. LCEL was designed from day 1 to **support putting prototypes
in production, with no code changes** , from the simplest “prompt + LLM” chain
to the most complex chains (we’ve seen folks successfully run LCEL chains with
100s of steps in production). To highlight a few of the reasons you might want
to use LCEL:

**Streaming support** When you build your chains with LCEL you get the best
possible time-to-first-token (time elapsed until the first chunk of output
comes out). For some chains this means eg. we stream tokens straight from an
LLM to a streaming output parser, and you get back parsed, incremental chunks
of output at the same rate as the LLM provider outputs the raw tokens.

**Async support** Any chain built with LCEL can be called both with the
synchronous API (eg. in your Jupyter notebook while prototyping) as well as
with the asynchronous API (eg. in a [ LangServe ](/docs/langsmith) server).
This enables using the same code for prototypes and in production, with great
performance, and the ability to handle many concurrent requests in the same
server.

**Optimized parallel execution** Whenever your LCEL chains have steps that can
be executed in parallel (eg if you fetch documents from multiple retrievers)
we automatically do it, both in the sync and the async interfaces, for the
smallest possible latency.

**Retries and fallbacks** Configure retries and fallbacks for any part of your
LCEL chain. This is a great way to make your chains more reliable at scale.
We’re currently working