Skip to main content

Python SDK for LangTrace

Project description

What is Langtrace?

Langtrace stands as a developer-centric, open-source solution, fully compatible with OpenTelemetry. It enables developers to effortlessly trace, monitor, and debug their LLM applications, offering robust support for automatic instrumentation.

Supported LLM Modules

Langtrace supports a comprehensive range of LLMs, VectorDBs, and frameworks, ensuring wide coverage for your development needs:

LLMs

  1. OpenAI
  2. Anthropic
  3. Azure OpenAI

VectorDBs

  1. Pinecone
  2. Chromadb

Frameworks

  1. LangChain
  2. LlamaIndex
  3. Haystack

We are actively working to extend our support to additional libraries!

Getting Started

To begin utilizing Langtrace, follow these straightforward steps:

  1. Install the package using pip install langtrace-python-sdk.
  2. Incorporate Langtrace into your project with from langtrace_python_sdk import langtrace.
    • This import should precede any other LLM module imports (such as OpenAI, LlamaIndex, etc.) to ensure proper functionality.
  3. Initialize Langtrace by adding langtrace.init({ write_to_remote_url: false}) to your code.
  4. Congratulations, you've completed the basic setup! You will now begin to see traces from your LLM modules logged directly to the console.

Exporting Traces to Langtrace

To configure trace exporting, you have two options:

You'll need both a Langtrace api_key and a remote_url, which can be acquired by logging into your Langtrace account.

  1. Direct Initialization: Utilize langtrace.init(batch=True, api_key=<YOUR_API_KEY>, remote_url=<YOUR_REMOTE_URL>).
  2. Environment Variables: Set API_KEY and URL, then add LangTrace.init(batch=True) at the beginning of your file.

Langtrace Cloud

Currently under development 🚧

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

langtrace_python_sdk-1.2.6.tar.gz (44.8 kB view details)

Uploaded Source

Built Distribution

langtrace_python_sdk-1.2.6-py3-none-any.whl (66.0 kB view details)

Uploaded Python 3

File details

Details for the file langtrace_python_sdk-1.2.6.tar.gz.

File metadata

  • Download URL: langtrace_python_sdk-1.2.6.tar.gz
  • Upload date:
  • Size: 44.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.19

File hashes

Hashes for langtrace_python_sdk-1.2.6.tar.gz
Algorithm Hash digest
SHA256 1cac61d9c0f4f2e041d79b0189046826e2841be7389e0c224acfe7671f4b0e4f
MD5 d5e9156f8fa8623c90b10d7e5ad9d033
BLAKE2b-256 ec6c53898ede4b774cf972fc5a1d6364624fc7922202754b2b9eb6a5aac1ac16

See more details on using hashes here.

File details

Details for the file langtrace_python_sdk-1.2.6-py3-none-any.whl.

File metadata

File hashes

Hashes for langtrace_python_sdk-1.2.6-py3-none-any.whl
Algorithm Hash digest
SHA256 69b59130b2bc60a4ae03e1ebe00219bf4d5703c0ec21e06bdc2bca8fba651e07
MD5 2af1704d6fc6970e31e0b593338242e5
BLAKE2b-256 4833944bbe431bd34c259b3a5827e94170a7a2dc53b4df7572da491e72dfc2d4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page