MCPcopy Create free account

hub / github.com/canarybyte/veridrop / functions

Functions825 in github.com/canarybyte/veridrop

↓ 59 callersMethod_result
( self, status: DetectorStatus, score: float, details: dict[str, Any] | None =
src/relay_detector/core/detectors_base.py:34
↓ 46 callersFunction_result
(name, score=100.0, status="pass", details=None)
tests/test_comparator.py:13
↓ 29 callersMethodfor_mode
(cls, mode: Mode, **overrides: Any)
src/relay_detector/core/models.py:51
↓ 27 callersMethodadd
(self, other: UsageMetrics)
src/relay_detector/core/models.py:84
↓ 26 callersFunction_int
(value: Any)
src/relay_detector/protocols/openai/detectors/token_billing.py:269
↓ 24 callersFunction_r
( name: str, score: float, weight: float, status: str = "pass", details: dict | None = Non
tests/test_scorer.py:16
↓ 23 callersFunction_resolve_protocol
Pick protocol from explicit --protocol flag or model-name heuristic.
src/relay_detector/cli.py:297
↓ 23 callersFunctionmodel_context_limit
Advertised maximum input context for known models, in tokens. Returns 128_000 as a conservative default for unknown models so we don't accide
src/relay_detector/core/long_context.py:130
↓ 22 callersMethodrun
(self, client, model: str)
src/relay_detector/protocols/openai/detectors/long_context.py:88
↓ 21 callersFunction_details
(r: dict[str, Any] | None)
src/relay_detector/protocols/anthropic/comparator.py:123
↓ 20 callersFunction_compare_one
Build a DetectorComparison for one detector. Either side may be None (e.g. detector skipped on one run). When the relay skipped a detector th
src/relay_detector/protocols/anthropic/comparator.py:422
↓ 20 callersFunctionprobe_relay
Probe a relay's /models endpoint. Always returns a structured dict. Never raises — network and protocol errors are returned as ``ok=false`` w
web/probe.py:65
↓ 18 callersFunction_classify
Map a model id to a protocol bucket, or None if unrecognised. Heuristic only — relays sometimes route the same alias to a different backend t
web/probe.py:33
↓ 18 callersFunction_mock
Patch httpx.AsyncClient to use a mock transport for one call.
tests/test_probe.py:98
↓ 18 callersFunction_patch_async_client
Force probe_relay's httpx.AsyncClient to use this transport.
tests/test_probe.py:110
↓ 18 callersFunctionmake_needles
Three deterministic needles seeded by relay identity. Each Veridrop run gets its own seed (relay domain + timestamp), so needles are unique p
src/relay_detector/core/long_context.py:207
↓ 15 callersMethodrun
(self, model: str)
src/relay_detector/core/runner.py:70
↓ 14 callersMethodchat_completions_create
( self, **body: Any )
src/relay_detector/protocols/openai/client.py:97
↓ 14 callersMethodmessages_create
Non-streaming POST /v1/messages. Returns: (request_body, response_dict, response_headers, latency_ms). Raises AnthropicAPIError on no
src/relay_detector/protocols/anthropic/client.py:118
↓ 13 callersFunction_grade
Return True if the answer hits expected keywords AND avoids anti keywords.
src/relay_detector/protocols/anthropic/detectors/knowledge.py:150
↓ 13 callersFunctioncheck_rate
Return ``(allowed, retry_after_seconds)`` for one hit on this IP. Sliding-window: counts hits in the trailing ``window_s`` seconds. If the co
web/ratelimit.py:21
↓ 13 callersFunctionmodels_match
Lenient match for Gemini OpenAI-compat responses. Relays return the model id in `response.model` in several shapes: - bare alias: `gemini-2.5
src/relay_detector/protocols/gemini/config.py:52
↓ 13 callersMethodskip
(self, reason: str)
src/relay_detector/core/detectors_base.py:53
↓ 12 callersFunction_build_resp
(text: str, prompt_tokens: int = 1000)
tests/test_long_context.py:265
↓ 12 callersFunction_clean_response
(**overrides)
tests/test_passive_detectors.py:14
↓ 12 callersFunction_evaluate
(text: str, sig: dict)
src/relay_detector/protocols/anthropic/detectors/behavioral_signature.py:96
↓ 12 callersFunction_good_headers
()
tests/test_passive_detectors.py:29
↓ 12 callersFunction_int
(value: Any)
src/relay_detector/protocols/anthropic/detectors/token_usage.py:254
↓ 12 callersFunction_load_font
(size: int, bold: bool = False)
web/image_report.py:36
↓ 11 callersFunctionlookup_model
Match the user-supplied model ID against known aliases (double-prefix). Accepts both alias (`claude-opus-4-7`) and snapshot (`claude-haiku-4-
src/relay_detector/protocols/anthropic/config.py:164
↓ 10 callersFunctionadd_issue
(severity: str, code: str, message: str)
src/relay_detector/protocols/gemini/detectors/protocol.py:95
↓ 10 callersMethodchat_completions_create
( self, **body: Any )
src/relay_detector/protocols/gemini/client.py:94
↓ 10 callersMethodobserve
( self, request: dict[str, Any], response: dict[str, Any], headers: httpx.Head
src/relay_detector/protocols/gemini/detectors/protocol.py:40
↓ 9 callersFunction_chat_payload
( *, model: str = "gpt-4o-mini", content: str = "pong", finish_reason: str = "stop", tool_
tests/test_openai_phase2.py:34
↓ 9 callersFunction_looks_rate_limited
Conservative rate-limit detection — false positives here would let a real truncation slip through as "rate_limited", so prefer explicit TPM /
src/relay_detector/protocols/openai/detectors/long_context.py:73
↓ 9 callersFunctioncompute_total
Weighted average over results that are not skipped. Per DESIGN.md §5.2: effective_weight = Σ d.weight for d.status != "skip" tota
src/relay_detector/core/scorer.py:72
↓ 9 callersMethodfinalize
(self)
src/relay_detector/protocols/gemini/detectors/protocol.py:59
↓ 9 callersFunctionint_value
(value: Any)
src/relay_detector/protocols/gemini/detectors/utils.py:48
↓ 9 callersFunctionverdict_for
(score: float)
src/relay_detector/core/scorer.py:11
↓ 8 callersFunction_range
(values)
src/relay_detector/protocols/openai/detectors/token_billing.py:497
↓ 8 callersFunctionassemble_haystack
Build a haystack of approximately target_tokens with needles embedded at their target positions. `protocol` selects the tokenizer-family-spec
src/relay_detector/core/long_context.py:285
↓ 8 callersMethodmessages_create
(self, **body)
tests/test_active_detectors.py:390
↓ 8 callersFunctionpick_default_model
(available: list[str])
src/relay_detector/protocols/anthropic/__init__.py:38
↓ 8 callersFunctionvalidate_chat_completion
( payload: dict[str, Any], request_model: str | None = None, )
src/relay_detector/protocols/openai/protocol_templates.py:226
↓ 7 callersFunction_build_resp
Anthropic Messages API response shape: content blocks + usage.
tests/test_anthropic_long_context.py:27
↓ 7 callersFunction_chat_response
( text: str = "pong", *, model: str = "gemini-2.5-flash", prompt_tokens: int = 8, completi
tests/test_gemini_phase3.py:38
↓ 7 callersMethod_probe_tier
Run one tier: build haystack, send, score recall. Haystack is sized to leave ~QUESTION_BUFFER tokens of headroom for the question its
src/relay_detector/protocols/openai/detectors/long_context.py:223
↓ 7 callersMethodapplies_to
(self, model: str)
src/relay_detector/protocols/anthropic/detectors/thinking_signature.py:61
↓ 7 callersFunctionevaluate_recalls
For each needle, did the model reproduce its `answer` in the response? Case-insensitive substring match — the answers are unique IDs (e.g. 'A
src/relay_detector/core/long_context.py:271
↓ 7 callersFunctionsetPill
(level, text)
web/static/app.js:251
↓ 7 callersFunctiontiers_for_model
Adaptive tiers covering low/mid/high of model's context window. For a 1M model returns ~(32k, 500k, 950k); for a 200k model returns ~(32k, 10
src/relay_detector/core/long_context.py:155
↓ 6 callersFunction_chat_payload
(**overrides)
tests/test_openai_protocol_templates.py:43
↓ 6 callersFunction_extract_model_ids
Pull model id strings from any of the common response shapes. OpenAI: {"data": [{"id": "..."} ...], "object": "list"} Anthropic: {"data":
web/probe.py:184
↓ 6 callersFunction_max_severity
(*items: Severity)
src/relay_detector/protocols/anthropic/comparator.py:36
↓ 6 callersMethod_record
(self, label: str, example: str)
src/relay_detector/protocols/anthropic/detectors/message_id.py:74
↓ 6 callersFunction_truncate
(s: str, n: int)
src/relay_detector/cli.py:604
↓ 6 callersMethodfinalize
(self)
src/relay_detector/protocols/anthropic/detectors/message_id.py:78
↓ 6 callersFunctionmessage_text
Extract assistant message text from a non-stream Chat Completions response.
src/relay_detector/protocols/gemini/detectors/utils.py:13
↓ 6 callersFunctionnormalize_gemini_base_url
Normalize a Gemini OpenAI-compat base URL. Preserve explicit prefixes such as `/v1` and `/v1beta/openai`. If the user enters only a host root
src/relay_detector/protocols/gemini/client.py:39
↓ 6 callersFunctionsummary_text
(score: float, verdict: Verdict)
src/relay_detector/core/scorer.py:62
↓ 5 callersFunction_applies
(q: dict, model: str)
src/relay_detector/protocols/anthropic/detectors/knowledge.py:115
↓ 5 callersFunction_dict_keys
(value: Any)
src/relay_detector/protocols/openai/baseline.py:507
↓ 5 callersFunction_err
( message: str, base_url: str, *, status: int | None, auth_ok: bool = True, )
web/probe.py:269
↓ 5 callersFunction_fmt
(v)
src/relay_detector/cli.py:169
↓ 5 callersFunction_format_count
(n: int | float | None)
web/image_report.py:225
↓ 5 callersFunction_in_range
(value: int | None, range_info: Any)
src/relay_detector/protocols/openai/detectors/token_billing.py:457
↓ 5 callersFunction_normalize_base_url
Normalize Anthropic-compatible base URLs to the API root. Users often paste OpenAI-style relay roots ending in `/v1`. This client posts to `/
src/relay_detector/protocols/anthropic/client.py:60
↓ 5 callersFunctionbuild_detectors
(mode: Mode | None = None)
src/relay_detector/protocols/gemini/__init__.py:73
↓ 5 callersFunctionbuild_runner
( client: GeminiClient, detectors: list[BaseDetector], config: ExecutionConfig, )
src/relay_detector/protocols/gemini/__init__.py:82
↓ 5 callersFunctioneffective_verdict
Verdict capped by critical findings. A relay scoring 75 with NO critical issues is genuinely "passed". A relay scoring 75 with critical issue
src/relay_detector/core/scorer.py:45
↓ 5 callersFunctionestimate_cost_usd
Rough USD estimate for sending target_tokens of input. Hard-coded per-model price tiers — accurate enough for "is this $0.05 or $5?" guidance
src/relay_detector/core/long_context.py:336
↓ 5 callersFunctionfatal_run_error
Return a run-level error when upstream quota/billing blocks detection. These are not model-quality failures. Scoring them as ordinary detector
src/relay_detector/core/scorer.py:107
↓ 5 callersFunctionfinish_reason
(resp: dict[str, Any])
src/relay_detector/protocols/gemini/detectors/utils.py:25
↓ 5 callersFunctionhas_critical_issues
True if any detector reported one or more critical-severity issues. Detectors surface critical issues via either: - `details.critical_issue_c
src/relay_detector/core/scorer.py:19
↓ 5 callersMethodobserve
( self, request: dict[str, Any], response: dict[str, Any], headers: httpx.Head
src/relay_detector/protocols/anthropic/detectors/message_id.py:37
↓ 4 callersFunction_check_nonneg_int
( value: Any, path: str, issues: list[ProtocolIssue], )
src/relay_detector/protocols/openai/protocol_templates.py:350
↓ 4 callersFunction_delta_range
(model: str)
src/relay_detector/protocols/anthropic/detectors/token_usage.py:222
↓ 4 callersFunction_excerpt
(text: str, n: int = 160)
web/probe.py:353
↓ 4 callersFunction_int
(value: Any)
src/relay_detector/protocols/openai/detectors/integrity.py:182
↓ 4 callersFunction_normalize_model_id
Canonicalize model ID separators so users typing `claude-sonnet-4.5` match the official `claude-sonnet-4-5` form. Without this the strict pref
src/relay_detector/protocols/anthropic/config.py:155
↓ 4 callersFunction_prefix
(value: Any)
src/relay_detector/protocols/openai/baseline.py:519
↓ 4 callersFunction_preflight_or_422
Run model-alive preflight; raise HTTPException 422 with structured detail if the model is dead so the frontend can offer a one-click swap to t
web/server.py:280
↓ 4 callersFunction_usage
(resp: dict[str, Any])
src/relay_detector/protocols/openai/detectors/token_billing.py:198
↓ 4 callersMethodchat_completions_stream
( self, **body: Any )
src/relay_detector/protocols/gemini/client.py:105
↓ 4 callersMethodchat_completions_stream
( self, **body: Any )
src/relay_detector/protocols/openai/client.py:117
↓ 4 callersFunctioncompare
( baseline: dict[str, Any], relay: dict[str, Any], baseline_path: str = "", relay_path: str =
src/relay_detector/protocols/anthropic/comparator.py:492
↓ 4 callersFunctionmake_client
(base_url: str, api_key: str, timeout: float)
src/relay_detector/protocols/gemini/__init__.py:78
↓ 4 callersFunctionmask_api_key
Mask API key for display: 'sk-y7xUabc...0h' -> 'sk-y7xU••••••0h'.
src/relay_detector/core/models.py:143
↓ 4 callersMethodmessages_create
( self, **body: Any )
src/relay_detector/protocols/anthropic/client.py:329
↓ 4 callersMethodmessages_stream
Streaming POST /v1/messages, yields (event, elapsed_ms_since_request_start). Caller is responsible for the entire SSE lifecycle. We do NOT ac
src/relay_detector/protocols/anthropic/client.py:163
↓ 4 callersFunctionprobe_model_alive
Return ``(alive, error_text_or_None)``. ``alive=False`` means the upstream rejected the call — error_text holds the upstream message (truncat
web/probe.py:386
↓ 4 callersFunctionsanitize_openai_headers
Keep only diagnostic headers; never persist auth/cookie headers.
src/relay_detector/protocols/openai/baseline.py:283
↓ 4 callersFunctionsetOpen
(open)
web/static/app.js:9
↓ 4 callersFunctionsupported_endpoints
(model: dict[str, Any])
scripts/bai_api_probe.py:147
↓ 4 callersFunctionvalidate_responses_api
( payload: dict[str, Any], request_model: str | None = None, )
src/relay_detector/protocols/openai/protocol_templates.py:172
↓ 3 callersFunction_arithmetic_ok
(u: dict[str, Any])
src/relay_detector/protocols/gemini/detectors/token_usage.py:165
↓ 3 callersFunction_check_id
( value: Any, prefix: str, path: str, issues: list[ProtocolIssue], )
src/relay_detector/protocols/openai/protocol_templates.py:312
↓ 3 callersFunction_is_nonneg_int
(v: Any)
src/relay_detector/protocols/anthropic/detectors/protocol.py:122
↓ 3 callersFunction_parse_numbered_answers
(text: str, n: int)
src/relay_detector/protocols/anthropic/detectors/knowledge.py:138
↓ 3 callersFunction_prefix
(value: Any)
src/relay_detector/protocols/openai/protocol_templates.py:1003
next →1–100 of 825, ranked by callers