feat: add gemini-flash-2.5 model to billing and constants, update low quality models in selector

This commit is contained in:
LE Quoc Dat 2025-05-21 20:21:34 +02:00
parent 65e6ee0ef8
commit 3be3bb1178
3 changed files with 13 additions and 11 deletions

View File

@ -25,6 +25,7 @@ MODEL_NAME_ALIASES = {
"sonnet-3.7": "anthropic/claude-3-7-sonnet-latest",
# "gpt-4.1": "openai/gpt-4.1-2025-04-14", # Commented out in constants.py
"gpt-4o": "openai/gpt-4o",
"gemini-flash-2.5": "openrouter/google/gemini-2.5-flash-preview-05-20",
# "gpt-4-turbo": "openai/gpt-4-turbo", # Commented out in constants.py
# "gpt-4": "openai/gpt-4", # Commented out in constants.py
# "gemini-flash-2.5": "openrouter/google/gemini-2.5-flash-preview", # Commented out in constants.py
@ -49,6 +50,7 @@ MODEL_NAME_ALIASES = {
"qwen/qwen3-235b-a22b": "openrouter/qwen/qwen3-235b-a22b",
# "xai/grok-3-mini-fast-beta": "xai/grok-3-mini-fast-beta", # Commented out in constants.py
"openrouter/google/gemini-2.5-flash-preview-05-20": "openrouter/google/gemini-2.5-flash-preview-05-20",
}
SUBSCRIPTION_TIERS = {

View File

@ -10,7 +10,7 @@ MODEL_ACCESS_TIERS = {
"openai/gpt-4o",
# "openai/gpt-4-turbo",
# "xai/grok-3-fast-latest",
# "openrouter/google/gemini-2.5-flash-preview",
"openrouter/google/gemini-2.5-flash-preview-05-20", # Added
# "openai/gpt-4",
"anthropic/claude-3-7-sonnet-latest",
# "openai/gpt-4.1-2025-04-14",
@ -23,7 +23,7 @@ MODEL_ACCESS_TIERS = {
"openai/gpt-4o",
# "openai/gpt-4-turbo",
# "xai/grok-3-fast-latest",
# "openrouter/google/gemini-2.5-flash-preview",
"openrouter/google/gemini-2.5-flash-preview-05-20", # Added
# "openai/gpt-4",
"anthropic/claude-3-7-sonnet-latest",
# "openai/gpt-4.1-2025-04-14",
@ -36,7 +36,7 @@ MODEL_ACCESS_TIERS = {
"openai/gpt-4o",
# "openai/gpt-4-turbo",
# "xai/grok-3-fast-latest",
# "openrouter/google/gemini-2.5-flash-preview",
"openrouter/google/gemini-2.5-flash-preview-05-20", # Added
# "openai/gpt-4",
"anthropic/claude-3-7-sonnet-latest",
# "openai/gpt-4.1-2025-04-14",
@ -49,7 +49,7 @@ MODEL_ACCESS_TIERS = {
"openai/gpt-4o",
# "openai/gpt-4-turbo",
# "xai/grok-3-fast-latest",
# "openrouter/google/gemini-2.5-flash-preview",
"openrouter/google/gemini-2.5-flash-preview-05-20", # Added
# "openai/gpt-4",
"anthropic/claude-3-7-sonnet-latest",
# "openai/gpt-4.1-2025-04-14",
@ -62,7 +62,7 @@ MODEL_ACCESS_TIERS = {
"openai/gpt-4o",
# "openai/gpt-4-turbo",
# "xai/grok-3-fast-latest",
# "openrouter/google/gemini-2.5-flash-preview",
"openrouter/google/gemini-2.5-flash-preview-05-20", # Added
# "openai/gpt-4",
"anthropic/claude-3-7-sonnet-latest",
# "openai/gpt-4.1-2025-04-14",
@ -75,7 +75,7 @@ MODEL_ACCESS_TIERS = {
"openai/gpt-4o",
# "openai/gpt-4-turbo",
# "xai/grok-3-fast-latest",
# "openrouter/google/gemini-2.5-flash-preview",
"openrouter/google/gemini-2.5-flash-preview-05-20", # Added
# "openai/gpt-4",
"anthropic/claude-3-7-sonnet-latest",
# "openai/gpt-4.1-2025-04-14",
@ -88,7 +88,7 @@ MODEL_ACCESS_TIERS = {
"openai/gpt-4o",
# "openai/gpt-4-turbo",
# "xai/grok-3-fast-latest",
# "openrouter/google/gemini-2.5-flash-preview",
"openrouter/google/gemini-2.5-flash-preview-05-20", # Added
# "openai/gpt-4",
"anthropic/claude-3-7-sonnet-latest",
# "openai/gpt-4.1-2025-04-14",

View File

@ -23,7 +23,7 @@ import { cn } from '@/lib/utils';
import { Badge } from '@/components/ui/badge';
import { useRouter } from 'next/navigation';
const LOW_QUALITY_MODELS = ['deepseek', 'grok-3-mini', 'qwen3'];
const LOW_QUALITY_MODELS = ['deepseek', 'grok-3-mini', 'qwen3', 'gemini-flash-2.5'];
interface ModelSelectorProps {
selectedModel: string;
@ -70,9 +70,9 @@ export const ModelSelector: React.FC<ModelSelectorProps> = ({
}
}
const deepseekModel = modelOptions.find(m => m.id === 'deepseek');
if (deepseekModel && canAccessModel(deepseekModel.id)) {
return deepseekModel.id;
const defaultFreeModel = modelOptions.find(m => m.id === DEFAULT_FREE_MODEL_ID);
if (defaultFreeModel && canAccessModel(defaultFreeModel.id)) {
return defaultFreeModel.id;
}
const firstAvailable = modelOptions.find(m => canAccessModel(m.id));