Skip to content

Commit fac93e7

Browse files
authored
[VPC ChatCompletions] Allow bypassing model validation (#96)
1 parent 1b43e21 commit fac93e7

File tree

5 files changed

+18
-5
lines changed

5 files changed

+18
-5
lines changed

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [1.1.16] - 2025-07-15
11+
12+
### Changed
13+
14+
- Add internal setting to bypass model validation check (for custom/VPC models)
15+
1016
## [1.1.15] - 2025-07-14
1117

1218
### Changed
@@ -244,7 +250,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
244250
- Release of the Cleanlab TLM Python client.
245251

246252

247-
[Unreleased]: https://github.com/cleanlab/cleanlab-tlm/compare/v1.1.15...HEAD
253+
[Unreleased]: https://github.com/cleanlab/cleanlab-tlm/compare/v1.1.16...HEAD
254+
[1.1.16]: https://github.com/cleanlab/cleanlab-tlm/compare/v1.1.15...v1.1.16
248255
[1.1.15]: https://github.com/cleanlab/cleanlab-tlm/compare/v1.1.14...v1.1.15
249256
[1.1.14]: https://github.com/cleanlab/cleanlab-tlm/compare/v1.1.13...v1.1.14
250257
[1.1.13]: https://github.com/cleanlab/cleanlab-tlm/compare/v1.1.12...v1.1.13

src/cleanlab_tlm/__about__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# SPDX-License-Identifier: MIT
2-
__version__ = "1.1.15"
2+
__version__ = "1.1.16"

src/cleanlab_tlm/internal/base.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ def __init__(
4040
options: Optional[TLMOptions] = None,
4141
timeout: Optional[float] = None,
4242
verbose: Optional[bool] = None,
43+
allow_custom_model: bool = False,
4344
) -> None:
4445
"""
4546
Initialize base TLM functionality.
@@ -63,7 +64,7 @@ def __init__(
6364
self._return_log = False
6465

6566
options_dict = options or {}
66-
validate_tlm_options(options_dict, support_custom_eval_criteria)
67+
validate_tlm_options(options_dict, support_custom_eval_criteria, allow_custom_model)
6768
if "log" in options_dict and len(options_dict["log"]) > 0:
6869
self._return_log = True
6970

src/cleanlab_tlm/internal/validation.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,11 @@ def validate_tlm_prompt_response(prompt: Union[str, Sequence[str]], response: Un
6666
)
6767

6868

69-
def validate_tlm_options(options: Any, support_custom_eval_criteria: bool = True) -> None:
69+
def validate_tlm_options(
70+
options: Any,
71+
support_custom_eval_criteria: bool = True,
72+
allow_custom_model: bool = False,
73+
) -> None:
7074
from cleanlab_tlm.tlm import TLMOptions
7175

7276
if SKIP_VALIDATE_TLM_OPTIONS:
@@ -98,7 +102,7 @@ def validate_tlm_options(options: Any, support_custom_eval_criteria: bool = True
98102
)
99103

100104
elif option == "model":
101-
if val not in _VALID_TLM_MODELS:
105+
if not allow_custom_model and val not in _VALID_TLM_MODELS:
102106
raise ValidationError(f"{val} is not a supported model, valid models include: {_VALID_TLM_MODELS}")
103107

104108
elif option == "num_candidate_responses":

src/cleanlab_tlm/utils/vpc/chat_completions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ def __init__(
6060
options=options,
6161
timeout=timeout,
6262
verbose=False,
63+
allow_custom_model=True,
6364
)
6465

6566
def score(

0 commit comments

Comments
 (0)