mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-25 05:54:53 +00:00
fix(proxy): default MCP trust scoring off and normalize DO 0-100 scores
Ship proxy_config with trust scoring disabled by default and map Dominion Observatory percent scores (including 1.0) to 0-1 without treating low raw values as fully trusted. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
ab3744a8cc
commit
c70ac67971
3 changed files with 6 additions and 5 deletions
|
|
@ -162,8 +162,6 @@ def normalize_trust_score(raw_score: object) -> Optional[float]:
|
|||
score = float(raw_score)
|
||||
if score < 0:
|
||||
return None
|
||||
if score <= 1.0:
|
||||
return score
|
||||
return min(score / 100.0, 1.0)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ litellm_settings:
|
|||
similarity_threshold: 0.3
|
||||
|
||||
mcp_trust_scoring:
|
||||
enabled: true
|
||||
enabled: false
|
||||
min_trust_score: 0.5
|
||||
cache_ttl_seconds: 3600
|
||||
fail_open: true
|
||||
|
|
|
|||
|
|
@ -109,11 +109,14 @@ def _isolated_client(
|
|||
)
|
||||
|
||||
|
||||
def test_normalize_trust_score_accepts_fraction_and_percent() -> None:
|
||||
assert normalize_trust_score(0.85) == 0.85
|
||||
def test_normalize_trust_score_maps_do_percent_scale_to_fraction() -> None:
|
||||
assert normalize_trust_score(85) == 0.85
|
||||
normalized = normalize_trust_score(92.5)
|
||||
assert normalized is not None
|
||||
assert abs(normalized - 0.925) < 1e-9
|
||||
low_trust = normalize_trust_score(1.0)
|
||||
assert low_trust is not None
|
||||
assert abs(low_trust - 0.01) < 1e-9
|
||||
|
||||
|
||||
def test_parse_trust_response_found_server() -> None:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue