LLM Frameworks
Langchain
Langtrace and Langchain Integration Guide
Langtrace integrates directly with Langchain, offering detailed, real-time insights into performance metrics such as cost, token usage, accuracy, and latency.
Setup
- Install Langtrace’s SDK and initialize the SDK in your code.
Note: You’ll need API key from Langtrace. Sign up for Langtrace if you haven’t done so already.
Python
Typescript
- Setup environment variables:
Shell
Usage
Generate a simple output with your deployment’s model:
Create a vector store index and query it
Retrieve and generate using the relevant snippets of the document.
Format our document ,setup a rag chain and query
You can now view your traces on the Langtrace dashboard
Want to see more supported methods? Checkout the sample code in the Langtrace Langchain Python Example