PromptLayer는 prompt engineering을 위한 플랫폼입니다. 또한 요청을 시각화하고, prompt 버전을 관리하며, 사용량을 추적하는 LLM observability 기능을 제공합니다. PromptLayer는 LangChain과 직접 통합되는 LLM을 제공하지만(예: PromptLayerOpenAI), callback을 사용하는 것이 PromptLayer를 LangChain과 통합하는 권장 방법입니다.

Installation and Setup

PromptLayer를 사용하려면 다음이 필요합니다:
  • PromptLayer 계정 생성
  • API token을 생성하고 환경 변수로 설정 (PROMPTLAYER_API_KEY)
Python package 설치:
pip install promptlayer

Callback

사용 예제를 참조하세요.
import promptlayer  # Don't forget this import!
from langchain.callbacks import PromptLayerCallbackHandler

LLM

사용 예제를 참조하세요.
from langchain_community.llms import PromptLayerOpenAI

Chat Models

사용 예제를 참조하세요.
from langchain_community.chat_models import PromptLayerChatOpenAI

Connect these docs programmatically to Claude, VSCode, and more via MCP for real-time answers.
I