--- id: cleanlab-tlm version: "1.1.39" license: MIT license_treatment: permissive maintenance: aging --- # cleanlab-tlm — Python client library for Cleanlab Trustworthy Language Model License: permissive · Maintenance: aging · Downloads: 163.7K/mo ## What it is and what it does Cleanlab TLM is a Python client for a remote trustworthiness-scoring service that evaluates LLM outputs in real-time. It wraps HTTP calls to Cleanlab's API to assign a confidence score (0–1) to any LLM response, flagging likely hallucinations or incorrect answers by comparing the response against the prompt. The package can either score responses you've already generated from another LLM, or generate and score responses itself by calling a model (GPT, Claude, etc.) on your behalf. The service is designed for production use in RAG systems, agents, and data-extraction pipelines where incorrect LLM outputs carry real cost. It depends on aiohttp, requests, pandas, tqdm, and a few utility libraries—all standard, low-friction dependencies. You must obtain and configure a free API key before use, and all scoring happens remotely on Cleanlab's servers, not locally. Use it for: - Score responses from your own LLM pipeline before returning them to users, filtering out low-confidence outputs. - Build a RAG system that flags uncertain retrieval-augmented answers and triggers fallback logic or human review. - Evaluate data-extraction or tagging tasks where hallucinated field values would corrupt downstream processes. - Monitor agent outputs in real-time to detect when an agent has generated an unreliable response. - Benchmark the quality of different LLM models or prompts by comparing their trustworthiness score distributions. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Cleanlab TLM scores the trustworthiness of LLM responses in real-time, detecting hallucinations and incorrect outputs by evaluating every response against the original prompt. Yes, if you need real-time hallucination detection for production LLM systems and can accept a remote API dependency. The package is stable, has low install friction, and covers a genuine gap in local hallucination detection. However, the aging maintenance signal (only 24 stars, no recent activity beyond the last commit date) and reliance on an external API key and service mean you should verify the API's stability and cost structure for your use case before committing to it at scale. ## Install pip install cleanlab-tlm uv add cleanlab-tlm poetry add cleanlab-tlm ## Installing cleanlab-tlm Before you install: Low friction install with standard dependencies. The package is marked Production/Stable and supports Python 3.9 through 3.12. Last commit was recent (2025-12-09), but the project shows aging maintenance signals with only 24 repository stars. License in practice: MIT license permits unrestricted use, modification, and distribution with minimal restrictions—suitable for commercial and open-source projects alike. Quickstart: pip install cleanlab-tlm from cleanlab_tlm import TLM tlm = TLM(options={"log": ["explanation"]}) result = tlm.get_trustworthiness_score( prompt="What's the third month of the year alphabetically?", response="August" ) print(result["trustworthiness_score"]) Requires a free API key from https://tlm.cleanlab.ai/ set as the CLEANLAB_TLM_API_KEY environment variable. Verify before relying: - Actual latency and throughput characteristics for production-scale deployments. - Whether the API key tier affects rate limits or feature availability. - Specific LLM models and frameworks the package has been tested with. - Cost structure for API usage beyond the free tier. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: aging - Downloads: 163.7K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags llm hallucination detection, trustworthiness scoring for language models, llm response evaluation, real-time llm output verification, hallucination detector api, uncertainty estimation for llms, rag response quality scoring, llm-safety, api-client, hallucination-detection [View on SkillFed](https://skillfed.io/packages/cleanlab-tlm) · [View on PyPI](https://pypi.org/project/cleanlab-tlm/)