Skip to main content

veritell-langchain

LLM evaluation and AI validation for LangChain applications.

Veritell-LangChain is a Python SDK that integrates Veritell’s AI risk and output validation API into LangChain workflows.

It enables structured evaluation of:

  • Hallucination risk
  • Bias detection
  • Safety concerns
  • Model reliability scoring

This package is designed for engineers building production AI systems who need measurable quality assurance before deployment.

🚀 Installation

pip install veritell-langchain

For development:

pip install -e .[dev]

🔐 Get Access (Free Beta)

To use the SDK, you need:

  • A Veritell account
  • An API key

Join the beta and create an API key:

Store your key as an environment variable:

macOS / Linux:

export VERITELL_API_KEY="<your_api_key>"

Windows PowerShell:

$env:VERITELL_API_KEY="<your_api_key>"

⚡ Quick Start (Streaming Evaluation)

By default, evaluate_stream() will generate the primary response using primary_model and then evaluate it with the judge models.

from veritell_langchain import VeritellEvaluator

# Uses VERITELL_API_KEY automatically
v = VeritellEvaluator(base_url="https://veritell.ai/api")

for event in v.evaluate_stream(
    prompt="Explain the benefits of renewable energy.",
    primary_model="gpt-4o-mini",
    judges=["gpt-4o-mini", "grok-3-mini-latest"],
):
    print(event.event_type, event.data)

Optional: evaluate your own model output (recommended for production)

If you already ran a model in your LangChain app and want Veritell to evaluate that exact output, pass model_output=.... In this mode, Veritell will treat your provided text as the primary output (it won’t re-generate it).

from veritell_langchain import VeritellEvaluator

v = VeritellEvaluator(base_url="https://veritell.ai/api")

prompt = "Explain the benefits of renewable energy."
chain_output = "Renewable energy reduces emissions and improves energy security."

for event in v.evaluate_stream(
    prompt=prompt,
    primary_model="gpt-4o-mini",
    judges=["gpt-4o-mini", "grok-3-mini-latest"],
    model_output=chain_output,
):
    print(event.event_type, event.data)

Streaming responses are returned as NDJSON events.

🧠 What This Package Enables

Veritell-LangChain adds structured LLM evaluation to your workflow.

Use it to:

  • Detect hallucinations in LLM outputs
  • Identify bias patterns
  • Evaluate safety and compliance risk
  • Generate structured risk scores
  • Integrate AI validation into CI/CD pipelines
  • Add AI quality assurance before production

It acts as a validation layer between experimentation and enterprise deployment.

🔄 Recommended LangChain Integration Pattern

This package does not automatically hook into LangChain callbacks (yet).

Recommended MVP workflow:

  1. Run your LangChain chain or agent
  2. Capture the prompt and model output
  3. Send both to Veritell for evaluation
  4. Review structured risk results in the dashboard

Example:

from veritell_langchain import VeritellEvaluator

prompt = "Explain the benefits of renewable energy."

# Example model output (replace with your chain result)
prediction = "Renewable energy reduces emissions and improves energy security."

v = VeritellEvaluator(base_url="https://veritell.ai/api")

for event in v.evaluate_stream(
    prompt=prompt,
    primary_model="gpt-4o-mini",
    judges=["gpt-4o-mini", "grok-3-mini-latest"],
    model_output=prediction,
):
    print(event.event_type, event.data)

View evaluation runs in the dashboard:

⚙ Configuration

Environment variables:

  • VERITELL_API_KEY (required)
  • VERITELL_API_BASE_URL (optional)
  • VERITELL_TIMEOUT (optional, seconds)

Authentication uses:

  • X-Api-Key: <VERITELL_API_KEY>

🧪 Production Example

If you installed from PyPI, the simplest way to run a “production” example is to copy/paste this snippet into your own project (it’s the same code as the repo example):

import os
from veritell_langchain import VeritellEvaluator

api_key = os.getenv("VERITELL_API_KEY")
if not api_key:
    raise RuntimeError("VERITELL_API_KEY is not set")

v = VeritellEvaluator(api_key=api_key, base_url="https://veritell.ai/api")

for event in v.evaluate_stream(
    prompt="Explain the benefits of using renewable energy sources.",
    primary_model="gpt-4o-mini",
    judges=["gpt-4o-mini"],
    model_output="Renewables reduce emissions and improve energy security.",
):
    print(event.event_type, event.data)

If you want the exact file, it lives in the source repository as:

  • examples/real_usage_prod.py

🎯 When to Use Veritell-LangChain

Use this package if you are:

  • Building LangChain agents in production
  • Evaluating LLM outputs for reliability
  • Implementing AI testing workflows
  • Deploying AI in regulated industries
  • Adding structured AI governance controls
  • Performing hallucination or bias detection

If you are searching for:

  • LangChain evaluation tool
  • LLM hallucination detection Python
  • AI validation library
  • LLM testing framework
  • Responsible AI Python package

This SDK is designed for those use cases.

📄 License

Apache-2.0

Metadata

Release files for veritell-langchain 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for veritell-langchain 0.1.6
File Size Uploaded Provenance Actions
veritell_langchain-0.1.6.tar.gz 29.5 kB Without provenance Details for veritell_langchain-0.1.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for veritell-langchain 0.1.6
File Interpreter ABI Platform Actions
veritell_langchain-0.1.6-py3-none-any.whl Python 3 none any Details for veritell_langchain-0.1.6-py3-none-any.whl

Total release size: 52.2 kB

Release files / veritell_langchain-0.1.6.tar.gz

Download URL veritell_langchain-0.1.6.tar.gz
Size 29.5 kB
Tags Source
SHA-256 checksum
How to use checksums
e799a03e93a001193182c00b699e3357f1b425f2b2d7b05e62613484b73e3070
BLAKE2b-256 checksum
How to use checksums
fd3d093cb72dc3ed42333c672a6efb70753881fd306910cf006b6c2fd3cf28cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0

Release files / veritell_langchain-0.1.6-py3-none-any.whl

Download URL veritell_langchain-0.1.6-py3-none-any.whl
Size 22.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
298ae7c56ec6b537e4e27c2d749daf7ca0ecf2057953fc83dfe1a45880b7af83
BLAKE2b-256 checksum
How to use checksums
508a7f5cba023154e4b4b615ac54dc729324bdd8905160cde33df67f50a45c80
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0

Security for veritell-langchain 0.1.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.6 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page