Skip to content

Conversation

@idola9
Copy link
Contributor

@idola9 idola9 commented Nov 19, 2025

Title

Use LiteLLM key alias as fallback Noma applicationId in NomaGuardrail

Relevant issues

N/A

Pre-Submission checklist

image
  • I have Added testing in the tests/litellm/ directory, Adding at least 1 test is a hard requirement - see details
  • I have added a screenshot of my new test passing locally
  • My PR passes all unit tests on make test-unit
  • My PR's scope is as isolated as possible, it only solves 1 specific problem

Type

🆕 New Feature

Changes

  • Update Noma applicationId resolution in NomaGuardrail:
    • Stop defaulting NOMA_APPLICATION_ID to "litellm" inside init; instead, store a separate default_application_id = "litellm" and keep self.application_id strictly to the explicit argument or environment value.
    • When building the Noma payload, expand the applicationId fallback chain to:
      • extra_data.get("application_id") (if set), then
      • request_data["metadata"]["headers"]["x-noma-application-id"] (if present), then
      • self.application_id (guardrail-level configuration), then
      • user_auth.key_alias (the LiteLLM key alias), then
      • self.default_application_id ("litellm").
  • This allows each LiteLLM key alias to be used as a distinct Noma applicationId by default, while preserving "litellm" as a final fallback when no other identifier is available.

@vercel
Copy link

vercel bot commented Nov 19, 2025

@idola9 is attempting to deploy a commit to the CLERKIEAI Team on Vercel.

A member of the Team first needs to authorize it.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@krrishdholakia krrishdholakia merged commit e1005cb into BerriAI:main Nov 20, 2025
2 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants