Skip to content

Commit

Permalink
Adds icons for Google Gemini models and custom model icons for L… (#3218
Browse files Browse the repository at this point in the history
)

* Add description for Google Gemini models and custom model icons for LiteLLM (OpenAI) proxied models

* Adds Vertex AI aliases for Claude

---------

Co-authored-by: Emerson Gomes <[email protected]>
  • Loading branch information
emerzon and Emerson Gomes authored Nov 26, 2024
1 parent 284e375 commit 0553062
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 3 deletions.
1 change: 1 addition & 0 deletions web/public/Gemini.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 10 additions & 2 deletions web/src/app/admin/configuration/llm/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
AzureIcon,
CPUIcon,
OpenAIIcon,
GeminiIcon,
OpenSourceIcon,
} from "@/components/icons/icons";
import { FaRobot } from "react-icons/fa";
Expand Down Expand Up @@ -67,10 +68,17 @@ export interface LLMProviderDescriptor {
display_model_names: string[] | null;
}

export const getProviderIcon = (providerName: string) => {
export const getProviderIcon = (providerName: string, modelName?: string) => {
switch (providerName) {
case "openai":
return OpenAIIcon;
// Special cases for openai based on modelName
if (modelName?.toLowerCase().includes("gemini")) {
return GeminiIcon;
}
if (modelName?.toLowerCase().includes("claude")) {
return AnthropicIcon;
}
return OpenAIIcon; // Default for openai
case "anthropic":
return AnthropicIcon;
case "bedrock":
Expand Down
6 changes: 6 additions & 0 deletions web/src/components/icons/icons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import Image, { StaticImageData } from "next/image";
import jiraSVG from "../../../public/Jira.svg";
import confluenceSVG from "../../../public/Confluence.svg";
import openAISVG from "../../../public/Openai.svg";
import geminiSVG from "../../../public/Gemini.svg";
import openSourceIcon from "../../../public/OpenSource.png";
import litellmIcon from "../../../public/LiteLLM.jpg";

Expand Down Expand Up @@ -1096,6 +1097,11 @@ export const OpenAIIcon = ({
className = defaultTailwindCSS,
}: IconProps) => <LogoIcon size={size} className={className} src={openAISVG} />;

export const GeminiIcon = ({
size = 16,
className = defaultTailwindCSS,
}: IconProps) => <LogoIcon size={size} className={className} src={geminiSVG} />;

export const VoyageIcon = ({
size = 16,
className = defaultTailwindCSS,
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/llm/LLMList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const LlmList: React.FC<LlmListProps> = ({
llmProvider.provider,
modelName
),
icon: getProviderIcon(llmProvider.provider),
icon: getProviderIcon(llmProvider.provider, modelName),
});
}
}
Expand Down
10 changes: 10 additions & 0 deletions web/src/lib/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,16 @@ const MODEL_DISPLAY_NAMES: { [key: string]: string } = {
"claude-instant-1.2": "Claude Instant 1.2",
"claude-3-5-sonnet-20240620": "Claude 3.5 Sonnet",
"claude-3-5-sonnet-20241022": "Claude 3.5 Sonnet (New)",
"claude-3-5-sonnet-v2@20241022": "Claude 3.5 Sonnet (New)",
"claude-3.5-sonnet-v2@20241022": "Claude 3.5 Sonnet (New)",

// Google Models
"gemini-1.5-pro": "Gemini 1.5 Pro",
"gemini-1.5-flash": "Gemini 1.5 Flash",
"gemini-1.5-pro-001": "Gemini 1.5 Pro",
"gemini-1.5-flash-001": "Gemini 1.5 Flash",
"gemini-1.5-pro-002": "Gemini 1.5 Pro (v2)",
"gemini-1.5-flash-002": "Gemini 1.5 Flash (v2)",

// Bedrock models
"meta.llama3-1-70b-instruct-v1:0": "Llama 3.1 70B",
Expand Down
7 changes: 7 additions & 0 deletions web/src/lib/llm/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,13 @@ const MODEL_NAMES_SUPPORTING_IMAGE_INPUT = [
"anthropic.claude-3-haiku-20240307-v1:0",
"anthropic.claude-3-5-sonnet-20240620-v1:0",
"anthropic.claude-3-5-sonnet-20241022-v2:0",
// google gemini model names
"gemini-1.5-pro",
"gemini-1.5-flash",
"gemini-1.5-pro-001",
"gemini-1.5-flash-001",
"gemini-1.5-pro-002",
"gemini-1.5-flash-002",
];

export function checkLLMSupportsImageInput(model: string) {
Expand Down

0 comments on commit 0553062

Please sign in to comment.