feat: add Qohash Nexus guardrail hook - #24927
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryThis PR adds a new Qohash Qostodian Nexus guardrail integration to LiteLLM, following the established Key changes:
Confidence Score: 5/5Safe to merge — no P0/P1 issues remain; all previously flagged concerns have been resolved. All prior review findings (logo key mismatch, unused imports) are addressed. The integration follows established patterns, tests are fully mocked, and the dynamic registry discovery will pick up the new hook without touching the central registry file. No backwards-incompatible changes introduced. No files require special attention.
|
| Filename | Overview |
|---|---|
| litellm/proxy/guardrails/guardrail_hooks/qohash/qohash.py | Core integration class extending GenericGuardrailAPI; correctly merges built-in identifier headers with caller-supplied headers, and overrides apply_guardrail to satisfy the unified-detection check in proxy/utils.py. |
| litellm/proxy/guardrails/guardrail_hooks/qohash/init.py | Initializer factory and registry dicts; follows the dynamic-discovery contract so guardrail_registry.py picks them up automatically. Missing unreachable_fallback forwarding compared to the generic hook, but fail_closed is a safe default for a security product. |
| litellm/types/proxy/guardrails/guardrail_hooks/qohash.py | Minimal config model adding api_base field; ui_friendly_name() returns "Qostodian Nexus" matching the guardrailLogoMap key after the logo-mismatch fix. |
| litellm/types/guardrails.py | QOSTODIAN_NEXUS added to SupportedGuardrailIntegrations enum and QostodianNexusConfigModel mixed into LitellmParams; api_base field is compatible with BaseLitellmParams's existing api_base definition. |
| tests/test_litellm/proxy/guardrails/test_qostodian_nexus_guardrail.py | 17 unit tests covering init, registries, config model, env vars, unified-detection logic, and header merging; all tests are properly mocked with no real network calls. |
| ui/litellm-dashboard/src/components/guardrails/guardrail_info_helpers.tsx | Added QostodianNexus to guardrail_provider_map and guardrailLogoMap with key "Qostodian Nexus" matching ui_friendly_name(); previously reported logo mismatch is now resolved. |
| docs/my-website/docs/proxy/guardrails/qohash_qostodian_nexus.md | Comprehensive docs covering quick-start, all four decision types with curl examples, identifier headers, security guidance, and deployment modes. |
Reviews (2): Last reviewed commit: "Update litellm/proxy/guardrails/guardrai..." | Re-trigger Greptile
| "Prompt Security": `${asset_logos_folder}prompt_security.png`, | ||
| "LiteLLM Content Filter": `${asset_logos_folder}litellm_logo.jpg`, | ||
| "Akto": `${asset_logos_folder}akto.svg`, | ||
| "Qohash Qostodian Nexus": `${asset_logos_folder}qohash.jpg`, |
There was a problem hiding this comment.
Logo will never display — display name mismatch
The guardrailLogoMap key "Qohash Qostodian Nexus" does not match the value returned by QostodianNexusConfigModel.ui_friendly_name(), which is "Qostodian Nexus".
The UI logo-lookup path (used in both add_guardrail_form.tsx and edit_guardrail_form.tsx) is:
populateGuardrailProviderspopulatesDynamicGuardrailProviders["QostodianNexus"] = ui_friendly_name→"Qostodian Nexus"getGuardrailLogoAndNamedoeslogo = guardrailLogoMap[displayName]→guardrailLogoMap["Qostodian Nexus"]→undefined
So the logo is silently dropped. Either the guardrailLogoMap key must match ui_friendly_name() exactly, or the Python method must be changed to match.
| "Qohash Qostodian Nexus": `${asset_logos_folder}qohash.jpg`, | |
| "Qostodian Nexus": `${asset_logos_folder}qohash.jpg`, |
There was a problem hiding this comment.
Perfect! Confirmed. The logo map key now matches ui_friendly_name():
- Python:
ui_friendly_name()returns"Qostodian Nexus" - TypeScript:
guardrailLogoMap["Qostodian Nexus"]now exists
The logo will display correctly in the UI.
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
c312dcd
into
BerriAI:litellm_oss_staging_04_01_2026
* feat: added Qohash Nexus guardrail hook * fix: ui_friendly_name of Qostodian Nexus * Update litellm/proxy/guardrails/guardrail_hooks/qohash/qohash.py Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * Update litellm/proxy/guardrails/guardrail_hooks/qohash/qohash.py Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* feat: added Qohash Nexus guardrail hook * fix: ui_friendly_name of Qostodian Nexus * Update litellm/proxy/guardrails/guardrail_hooks/qohash/qohash.py Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * Update litellm/proxy/guardrails/guardrail_hooks/qohash/qohash.py Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* feat: added Qohash Nexus guardrail hook * fix: ui_friendly_name of Qostodian Nexus * Update litellm/proxy/guardrails/guardrail_hooks/qohash/qohash.py Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * Update litellm/proxy/guardrails/guardrail_hooks/qohash/qohash.py Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* feat: added Qohash Nexus guardrail hook * fix: ui_friendly_name of Qostodian Nexus * Update litellm/proxy/guardrails/guardrail_hooks/qohash/qohash.py Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * Update litellm/proxy/guardrails/guardrail_hooks/qohash/qohash.py Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Relevant issues
N/A: New integration for Qohash Qostodian Nexus guardrail.
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
tests/test_litellm/directory, Adding at least 1 test is a hard requirement - see detailsmake test-unit@greptileaiand received a Confidence Score of at least 4/5 before requesting a maintainer reviewDelays in PR merge?
If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).
CI (LiteLLM team)
Branch creation CI run
Link:
CI run for the last commit
Link:
Merge / cherry-pick CI run
Links:
Type
🆕 New Feature
🐛 Bug Fix
🧹 Refactoring
📖 Documentation
🚄 Infrastructure
✅ Test
Changes
Add Qohash Qostodian Nexus as a guardrail integration for LiteLLM proxy.
http://nexus:8800, overridable via QOSTODIAN_NEXUS_API_BASE env var).
QostodianNexusConfigModelwith api_base field.QOSTODIAN_NEXUStoSupportedGuardrailIntegrationsenum, guardrail initializer registry, and class registry.