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]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
Add ability to add embedding model for milvus
yuneng-jiang0eba87917937
diff --git a/ui/litellm-dashboard/src/components/vector_store_management/VectorStoreForm.tsx b/ui/litellm-dashboard/src/components/vector_store_management/VectorStoreForm.tsxindex d1cd3c5e443..8be879b2239 100644--- a/ui/litellm-dashboard/src/components/vector_store_management/VectorStoreForm.tsx+++ b/ui/litellm-dashboard/src/components/vector_store_management/VectorStoreForm.tsx@@ -1,4 +1,4 @@-import React, { useState } from "react";+import React, { useState, useEffect } from "react";import { TextInput, Button as TremorButton } from "@tremor/react";import { Modal, Form, Select, Tooltip, Input, Alert } from "antd";import { InfoCircleOutlined } from "@ant-design/icons";@@ -10,6 +10,7 @@ import {getProviderSpecificFields,VectorStoreFieldConfig,} from "../vector_store_providers";+import { fetchAvailableModels, ModelGroup } from "../playground/llm_calls/fetch_models";import NotificationsManager from "../molecules/notifications_manager";interface VectorStoreFormProps {@@ -30,6 +31,24 @@ const VectorStoreForm: React.FC<VectorStoreFormProps> = ({const [form] = Form.useForm();const [metadataJson, setMetadataJson] = useState("{}");const [selectedProvider, setSelectedProvider] = useState("bedrock");+ const [modelInfo, setModelInfo] = useState<ModelGroup[]>([]);++ useEffect(() => {+ if (!accessToken) return;++ const loadModels = async () => {+ try {+ const uniqueModels = await fetchAvailableModels(accessToken);+ if (uniqueModels.length > 0) {+ setModelInfo(uniqueModels);+ }+ } catch (error) {+ console.error("Error fetching model info:", error);+ }+ };++ loadModels();+ }, [accessToken]);const handleCreate = async (formValues: any) => {if (!accessToken) return;@@ -207,23 +226,62 @@ const VectorStoreForm: React.FC<VectorStoreFormProps> = ({</Form.Item>{/* Provider-specific fields */}- {getProviderSpecificFields(selectedProvider).map((field: VectorStoreFieldConfig) => (- <Form.Item- key={field.name}- label={- <span>- {field.label}{" "}- <Tooltip title={field.tooltip}>- <InfoCircleOutlined style={{ marginLeft: "4px" }} />- </Tooltip>- </span>- }- name={field.name}- rules={field.required ? [{ required: true, message: `Please input the ${field.label.toLowerCase()}` }] : []}- >- <TextInput type={field.type || "text"} placeholder={field.placeholder} />- </Form.Item>- ))}+ {getProviderSpecificFields(selectedProvider).map((field: VectorStoreFieldConfig) => {+ if (field.type === "select") {+ const embeddingModels = modelInfo+ .filter((option: ModelGroup) => option.mode === "embedding")+ .map((option: ModelGroup) => ({+ value: option.model_group,+ label: option.model_group,+ }));++ return (+ <Form.Item+ key={field.name}+ label={+ <span>+ {field.label}{" "}+ <Tooltip title={field.tooltip}>+ <InfoCircleOutlined style={{ marginLeft: "4px" }} />+ </Tooltip>+ </span>+ }+ name={field.name}+ rules={+ field.required ? [{ required: true, message: `Please select the ${field.label.toLowerCase()}` }] : []+ }+ >+ <Select+ placeholder={field.placeholder}+ showSearch={true}+ filterOption={(input, option) => (option?.label ?? "").toLowerCase().includes(input.toLowerCase())}+ options={embeddingModels}+ style={{ width: "100%" }}+ />+ </Form.Item>+ );+ }++ return (+ <Form.Item+ key={field.name}+ label={+ <span>+ {field.label}{" "}+ <Tooltip title={field.tooltip}>+ <InfoCircleOutlined style={{ marginLeft: "4px" }} />+ </Tooltip>+ </span>+ }+ name={field.name}+ rules={+ field.required ? [{ required: true, message: `Please input the ${field.label.toLowerCase()}` }] : []+ }+ >+ <TextInput type={field.type || "text"} placeholder={field.placeholder} />+ </Form.Item>+ );+ })}<Form.Itemlabel={diff --git a/ui/litellm-dashboard/src/components/vector_store_providers.tsx b/ui/litellm-dashboard/src/components/vector_store_providers.tsxindex 68c5c3745c3..3dcf8eed87a 100644--- a/ui/litellm-dashboard/src/components/vector_store_providers.tsx+++ b/ui/litellm-dashboard/src/components/vector_store_providers.tsx@@ -34,7 +34,7 @@ export interface VectorStoreFieldConfig {tooltip: string;placeholder?: string;required: boolean;- type?: "text" | "password";+ type?: "text" | "password" | "select";}// Provider-specific field configurations@@ -105,6 +105,14 @@ export const vectorStoreProviderFields: Record<string, VectorStoreFieldConfig[]>required: true,type: "text",},+ {+ name: "embedding_model",+ label: "Embedding Model",+ tooltip: "Select the embedding model to use",+ placeholder: "text-embedding-3-small",+ required: true,+ type: "select",+ },],};