Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

chore(ui): make knip trustworthy and enforce dead-code in CI (#32727)

ryan-crabbe-berrie2eee364381e
diff --git a/.github/workflows/test-litellm-ui-build.yml b/.github/workflows/test-litellm-ui-build.yml
index ce8d8cb9c95..67bec6715f0 100644
--- a/.github/workflows/test-litellm-ui-build.yml
+++ b/.github/workflows/test-litellm-ui-build.yml
@@ -112,3 +112,7 @@ jobs:
run: |
npx eslint . -f json -o "$RUNNER_TEMP/lint-report.json" || true
node scripts/check-lint-budgets.mjs "$RUNNER_TEMP/lint-report.json" eslint-budgets.json --check eslint-metrics.json
+
+ - name: Check for dead code (knip)
+ if: ${{ !cancelled() && steps.changed.outputs.has_files == 'true' }}
+ run: npm run knip
diff --git a/ui/litellm-dashboard/knip.json b/ui/litellm-dashboard/knip.json
index 58fa202a39a..afed6b0f90e 100644
--- a/ui/litellm-dashboard/knip.json
+++ b/ui/litellm-dashboard/knip.json
@@ -1,6 +1,6 @@
{
"$schema": "https://unpkg.com/knip@5/schema.json",
- "entry": ["scripts/**/*.{ts,mjs}"],
+ "entry": ["scripts/**/*.{ts,mjs}", "src/components/ui/**/*.{ts,tsx}"],
"project": ["src/**/*.{ts,tsx}", "tests/**/*.{ts,tsx}", "scripts/**/*.{ts,mjs}", "e2e_tests/**/*.ts"],
"ignore": ["src/lib/http/schema.d.ts"],
"ignoreDependencies": [
@@ -11,7 +11,30 @@
"tw-animate-css"
],
"playwright": {
- "config": "e2e_tests/playwright.config.ts",
+ "config": [
+ "e2e_tests/playwright.config.ts",
+ "e2e_tests/serverRootPath.config.ts",
+ "e2e_tests/migration.serverRootPath.config.ts"
+ ],
"entry": ["e2e_tests/**/*.spec.ts", "e2e_tests/**/*.setup.ts", "e2e_tests/globalSetup.ts"]
+ },
+ "vitest": {
+ "config": ["vitest.config.ts"]
+ },
+ "rules": {
+ "files": "error",
+ "dependencies": "error",
+ "devDependencies": "error",
+ "optionalPeerDependencies": "error",
+ "unlisted": "error",
+ "binaries": "error",
+ "unresolved": "error",
+ "exports": "warn",
+ "nsExports": "warn",
+ "types": "warn",
+ "nsTypes": "warn",
+ "enumMembers": "warn",
+ "classMembers": "warn",
+ "duplicates": "warn"
}
}
diff --git a/ui/litellm-dashboard/package-lock.json b/ui/litellm-dashboard/package-lock.json
index 56c0a4f9500..49fdb38c47b 100644
--- a/ui/litellm-dashboard/package-lock.json
+++ b/ui/litellm-dashboard/package-lock.json
@@ -9,6 +9,7 @@
"version": "0.1.0",
"dependencies": {
"@ant-design/cssinjs": "1.24.0",
+ "@ant-design/icons": "5.6.1",
"@anthropic-ai/sdk": "0.92.0",
"@base-ui/react": "^1.6.0",
"@headlessui/tailwindcss": "0.2.2",
diff --git a/ui/litellm-dashboard/package.json b/ui/litellm-dashboard/package.json
index 1747a40da56..ab01ec70cea 100644
--- a/ui/litellm-dashboard/package.json
+++ b/ui/litellm-dashboard/package.json
@@ -25,6 +25,7 @@
},
"dependencies": {
"@ant-design/cssinjs": "1.24.0",
+ "@ant-design/icons": "5.6.1",
"@anthropic-ai/sdk": "0.92.0",
"@base-ui/react": "^1.6.0",
"@headlessui/tailwindcss": "0.2.2",