[Feat] LiteLLM Tag/Policy Management (#9813)
All checks were successful
Read Version from pyproject.toml / read-version (push) Successful in 15s
Helm unit test / unit-test (push) Successful in 21s

* rendering tags on UI

* use /models for building tags

* CRUD endpoints for Tag management

* fix tag management

* working api for LIST tags

* working tag management

* refactor UI components

* fixes ui tag management

* clean up ui tag management

* fix tag management ui

* fix show allowed llms

* e2e tag controls

* stash change for rendering tags on UI

* ui working tag selector on Test Key page

* fixes for tag management

* clean up tag info

* fix code quality

* test for tag management

* ui clarify what tag routing is
This commit is contained in:
Ishaan Jaff 2025-04-07 21:54:24 -07:00 committed by GitHub
parent ac9f03beae
commit ff3a6830a4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 1595 additions and 9 deletions

View file

@ -31,6 +31,7 @@ import { litellmModeMapping, ModelMode, EndpointType, getEndpointType } from "./
import { Prism as SyntaxHighlighter } from "react-syntax-highlighter";
import { coy } from 'react-syntax-highlighter/dist/esm/styles/prism';
import EndpointSelector from "./chat_ui/EndpointSelector";
import TagSelector from "./tag_management/TagSelector";
import { determineEndpointType } from "./chat_ui/EndpointUtils";
import {
SendOutlined,
@ -40,7 +41,8 @@ import {
RobotOutlined,
UserOutlined,
DeleteOutlined,
LoadingOutlined
LoadingOutlined,
TagsOutlined
} from "@ant-design/icons";
interface ChatUIProps {
@ -73,6 +75,7 @@ const ChatUI: React.FC<ChatUIProps> = ({
const [endpointType, setEndpointType] = useState<string>(EndpointType.CHAT);
const [isLoading, setIsLoading] = useState<boolean>(false);
const abortControllerRef = useRef<AbortController | null>(null);
const [selectedTags, setSelectedTags] = useState<string[]>([]);
const chatEndRef = useRef<HTMLDivElement>(null);
@ -202,6 +205,7 @@ const ChatUI: React.FC<ChatUIProps> = ({
(chunk, model) => updateTextUI("assistant", chunk, model),
selectedModel,
effectiveApiKey,
selectedTags,
signal
);
} else if (endpointType === EndpointType.IMAGE) {
@ -211,6 +215,7 @@ const ChatUI: React.FC<ChatUIProps> = ({
(imageUrl, model) => updateImageUI(imageUrl, model),
selectedModel,
effectiveApiKey,
selectedTags,
signal
);
}
@ -343,6 +348,18 @@ const ChatUI: React.FC<ChatUIProps> = ({
endpointType={endpointType}
onEndpointChange={handleEndpointChange}
className="mb-4"
/>
</div>
<div>
<Text className="font-medium block mb-2 text-gray-700 flex items-center">
<TagsOutlined className="mr-2" /> Tags
</Text>
<TagSelector
value={selectedTags}
onChange={setSelectedTags}
className="mb-4"
accessToken={accessToken || ""}
/>
</div>