Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryThis PR adds a "reusable credentials" feature to the LiteLLM dashboard, allowing users to select existing credentials from a dropdown when editing model settings, rather than only via the JSON params textarea.
Issues found:
Note: The PR checklist indicates tests in Confidence Score: 3/5
|
| Filename | Overview |
|---|---|
| ui/litellm-dashboard/src/components/model_info_view.tsx | Adds credential list fetching, a searchable "Existing Credentials" dropdown in edit mode, and ensures litellm_credential_name is stripped from the JSON textarea. One issue: the "None" option uses value: undefined which may not work reliably with Ant Design Select. |
| ui/litellm-dashboard/src/components/add_model/handle_add_model_submit.tsx | Correctly strips litellm_credential_name from parsed litellm_extra_params JSON so the form selector value takes precedence. Clean, minimal change. |
| ui/litellm-dashboard/src/components/model_info_view.test.tsx | Adds tests for the new "Existing Credentials" field visibility in edit mode and verifies that litellm_credential_name from JSON textarea is overridden by the selector. Mocks properly updated. |
| ui/litellm-dashboard/src/components/add_model/handle_add_model_submit.test.tsx | Adds a test case verifying that litellm_credential_name injected via litellm_extra_params JSON is ignored in favor of the form-level field value. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[User opens Model Info View] --> B[Fetch credentials list via credentialListCall]
A --> C[Load model data]
B --> D[Populate Existing Credentials dropdown]
C --> E[Strip litellm_credential_name from litellm_extra_params JSON]
E --> F[Set litellm_credential_name as dedicated form field]
G[User edits model] --> H{User modifies litellm_extra_params JSON?}
H -->|Yes| I[Strip litellm_credential_name from parsed JSON]
H -->|No| J[Keep existing values]
G --> K{User selects credential from dropdown?}
K -->|Yes| L[Set litellm_credential_name from selector]
K -->|No / Cleared| M[Delete litellm_credential_name from params]
I --> N[Save: Selector value always wins over JSON value]
J --> N
L --> N
M --> N
N --> O[Send modelPatchUpdateCall]
Last reviewed commit: 18bc0d4
| (option?.label ?? "").toLowerCase().includes(input.toLowerCase()) | ||
| } | ||
| options={[ | ||
| { value: undefined, label: "None" }, |
There was a problem hiding this comment.
undefined is not a valid Select option value
Ant Design's <Select> treats undefined as "no value" / uncontrolled state, so this option may not be selectable or may behave inconsistently (e.g., selecting "None" might not update the form field). Since allowClear is already enabled on this <Select>, users can clear the field via the clear button. Consider using null or an empty string instead so the option is reliably selectable:
| { value: undefined, label: "None" }, | |
| { value: "", label: "None" }, |
Then in handleModelUpdate, check with if (values.litellm_credential_name) which already treats "" as falsy, so the downstream logic remains correct.
Relevant issues
reusable-credentials.mp4
Edit: Moved to below tags

Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
tests/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 reviewCI (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