diff --git a/webui/src/components/BackendBadge.tsx b/webui/src/components/BackendBadge.tsx new file mode 100644 index 0000000..a50cb4d --- /dev/null +++ b/webui/src/components/BackendBadge.tsx @@ -0,0 +1,65 @@ +import React from "react"; +import { Badge } from "@/components/ui/badge"; +import { BackendType, type BackendTypeValue } from "@/types/instance"; +import { Cpu, Zap, Server } from "lucide-react"; + +interface BackendBadgeProps { + backend?: BackendTypeValue; +} + +const BackendBadge: React.FC = ({ backend }) => { + if (!backend) { + return null; + } + + const getIcon = () => { + switch (backend) { + case BackendType.LLAMA_CPP: + return ; + case BackendType.MLX_LM: + return ; + case BackendType.VLLM: + return ; + default: + return ; + } + }; + + const getText = () => { + switch (backend) { + case BackendType.LLAMA_CPP: + return "llama.cpp"; + case BackendType.MLX_LM: + return "MLX"; + case BackendType.VLLM: + return "vLLM"; + default: + return backend; + } + }; + + const getVariant = () => { + switch (backend) { + case BackendType.LLAMA_CPP: + return "secondary"; + case BackendType.MLX_LM: + return "outline"; + case BackendType.VLLM: + return "default"; + default: + return "secondary"; + } + }; + + return ( + + {getIcon()} + {getText()} + + ); +}; + +export default BackendBadge; \ No newline at end of file diff --git a/webui/src/components/InstanceCard.tsx b/webui/src/components/InstanceCard.tsx index b17714c..940181e 100644 --- a/webui/src/components/InstanceCard.tsx +++ b/webui/src/components/InstanceCard.tsx @@ -5,6 +5,7 @@ import type { Instance } from "@/types/instance"; import { Edit, FileText, Play, Square, Trash2 } from "lucide-react"; import LogsDialog from "@/components/LogDialog"; import HealthBadge from "@/components/HealthBadge"; +import BackendBadge from "@/components/BackendBadge"; import { useState } from "react"; import { useInstanceHealth } from "@/hooks/useInstanceHealth"; @@ -58,7 +59,10 @@ function InstanceCard({
{instance.name} - {running && } +
+ + {running && } +