Using PromptLayer with LangChain

You can now use PromptLayer with LangChain. Two lines and you’ll be ready to start tracking your prompts.

Using PromptLayer with LangChain

EDIT: The following is a deprecated way to use PromptLayer with LangChain. For more updated instructions, go to https://docs.promptlayer.com

We're super excited to announce a brand new integration with LangChain, a popular Python library aimed at helping in the development of LLM applications. LangChain provides a ton of helpful features such as chains, agents, and memory.

Using PromptLayer with LangChain is easy.

Load API Keys 🔑

To get the party started, load your API keys just like you normally would.

Just change one import 🧙‍♂️

Now, instead of importing OpenAI from langchain.llms, grab it from promptlayer.langchain.llms.

Here's an example:

Results 🎉

The results can be viewed on our dashboard at www.promptlayer.com. With this integration, you'll be able to take advantage of LangChain's features and supercharge your development speed.

That's it! Happy prompting.


PromptLayer is available now 🍰 We would love to hear your feedback and feature requests. Say hi anytime at hello@magniv.io 👋

Learn more on our docs.