Python client library for developers to integrate Cleanlab Codex into RAG systems
Project description
Cleanlab Codex - Closing the AI Knowledge Gap
Codex enables you to seamlessly leverage knowledge from Subject Matter Experts (SMEs) to improve your RAG/Agentic applications.
The cleanlab-codex library provides a simple interface to integrate Codex's capabilities into your RAG application.
See immediate impact with just a few lines of code!
Demo
Install the package:
pip install cleanlab-codex
Integrating Codex into your RAG application is as simple as:
from cleanlab_codex import Validator
validator = Validator(codex_access_key=...) # optional configurations can improve accuracy/latency
# Your existing RAG code:
context = rag_retrieve_context(user_query)
prompt = rag_form_prompt(user_query, retrieved_context)
response = rag_generate_response(prompt)
# Detect bad responses and remediate with Cleanlab
results = validator.validate(query=query, context=context, response=response,
form_prompt=rag_form_prompt)
final_response = (
results["expert_answer"] # Codex's answer
if results["is_bad_response"] and results["expert_answer"]
else response # Your RAG system's initial response
)
Why Codex?
- Detect Knowledge Gaps and Hallucinations: Codex identifies knowledge gaps and incorrect/untrustworthy responses in your AI application, to help you know which questions require expert input.
- Save SME time: Codex ensures that SMEs see the most critical knowledge gaps first.
- Easy Integration: Integrate Codex into any RAG/Agentic application with just a few lines of code.
- Immediate Impact: SME answers instantly improve your AI, without any additional Engineering/technical work.
Documentation
Comprehensive documentation along with tutorials and examples can be found here.
License
cleanlab-codex is distributed under the terms of the MIT license.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cleanlab_codex-1.0.21.tar.gz.
File metadata
- Download URL: cleanlab_codex-1.0.21.tar.gz
- Upload date:
- Size: 21.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5e84f62f5ba48e3169a822b3bfc0447cba62de2d3089ac2891d1f19e224639a8
|
|
| MD5 |
6935a830c4dc439628d64fa8a7b09435
|
|
| BLAKE2b-256 |
20ae1a030c8498a1ffdbd49186b46868885f8d0d4f3d283015c263ab8797cfbc
|
Provenance
The following attestation bundles were made for cleanlab_codex-1.0.21.tar.gz:
Publisher:
release.yml on cleanlab/cleanlab-codex
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cleanlab_codex-1.0.21.tar.gz -
Subject digest:
5e84f62f5ba48e3169a822b3bfc0447cba62de2d3089ac2891d1f19e224639a8 - Sigstore transparency entry: 246016120
- Sigstore integration time:
-
Permalink:
cleanlab/cleanlab-codex@e33123f4f25ee6527e479b2a44cbb44df1a05bfe -
Branch / Tag:
refs/tags/v1.0.21 - Owner: https://github.com/cleanlab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@e33123f4f25ee6527e479b2a44cbb44df1a05bfe -
Trigger Event:
push
-
Statement type:
File details
Details for the file cleanlab_codex-1.0.21-py3-none-any.whl.
File metadata
- Download URL: cleanlab_codex-1.0.21-py3-none-any.whl
- Upload date:
- Size: 16.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ea3f5920b5da18cb9c4fa66c7f7ad0f3916992b93f6ca9b1bec8bb6cb0085a66
|
|
| MD5 |
4d0ff12f3c58a968e4f392cb848a2b27
|
|
| BLAKE2b-256 |
05d39934d5e6bfb2b6a887f6b6fcd66e7c36d4d3e688f8041913795c87bf1992
|
Provenance
The following attestation bundles were made for cleanlab_codex-1.0.21-py3-none-any.whl:
Publisher:
release.yml on cleanlab/cleanlab-codex
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cleanlab_codex-1.0.21-py3-none-any.whl -
Subject digest:
ea3f5920b5da18cb9c4fa66c7f7ad0f3916992b93f6ca9b1bec8bb6cb0085a66 - Sigstore transparency entry: 246016121
- Sigstore integration time:
-
Permalink:
cleanlab/cleanlab-codex@e33123f4f25ee6527e479b2a44cbb44df1a05bfe -
Branch / Tag:
refs/tags/v1.0.21 - Owner: https://github.com/cleanlab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@e33123f4f25ee6527e479b2a44cbb44df1a05bfe -
Trigger Event:
push
-
Statement type: