Skip to content
71 changes: 54 additions & 17 deletions src/main/presenter/configPresenter/modelDefaultSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@ export const defaultModelsSettings: DefaultModelSetting[] = [
},

// Gemini 系列模型
// ref: https://ai.google.dev/gemini-api/docs/models
{
id: 'gemini-2.5-pro',
name: 'Gemini 2.5 Pro',
Expand All @@ -360,40 +361,87 @@ export const defaultModelsSettings: DefaultModelSetting[] = [
reasoning: true,
thinkingBudget: -1 // 动态思维
},
{
id: 'models/gemini-2.5-flash-lite',
name: 'Gemini 2.5 Flash-Lite',
temperature: 0.7,
maxTokens: 65535,
contextLength: 1048576,
match: ['models/gemini-2.5-flash-lite', 'gemini-2.5-flash-lite'],
vision: true,
functionCall: true,
reasoning: true,
thinkingBudget: -1 // 动态思维
},
{
id: 'models/gemini-2.5-flash-lite',
name: 'Gemini 2.5 Flash-Lite',
temperature: 0.7,
maxTokens: 65535,
contextLength: 1048576,
match: ['models/gemini-2.5-flash-lite', 'gemini-2.5-flash-lite'],
vision: true,
functionCall: true,
reasoning: true,
thinkingBudget: -1 // 动态思维
},
Comment on lines +365 to +387
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Duplicate model entry: models/gemini-2.5-flash-lite appears twice

The second block is an exact duplicate and will cause UI duplication and config ambiguity.

   {
     id: 'models/gemini-2.5-flash-lite',
     name: 'Gemini 2.5 Flash-Lite',
     temperature: 0.7,
     maxTokens: 65535,
     contextLength: 1048576,
     match: ['models/gemini-2.5-flash-lite', 'gemini-2.5-flash-lite'],
     vision: true,
     functionCall: true,
     reasoning: true,
     thinkingBudget: -1 // 动态思维
   },
-  {
-    id: 'models/gemini-2.5-flash-lite',
-    name: 'Gemini 2.5 Flash-Lite',
-    temperature: 0.7,
-    maxTokens: 65535,
-    contextLength: 1048576,
-    match: ['models/gemini-2.5-flash-lite', 'gemini-2.5-flash-lite'],
-    vision: true,
-    functionCall: true,
-    reasoning: true,
-    thinkingBudget: -1 // 动态思维
-  },
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
id: 'models/gemini-2.5-flash-lite',
name: 'Gemini 2.5 Flash-Lite',
temperature: 0.7,
maxTokens: 65535,
contextLength: 1048576,
match: ['models/gemini-2.5-flash-lite', 'gemini-2.5-flash-lite'],
vision: true,
functionCall: true,
reasoning: true,
thinkingBudget: -1 // 动态思维
},
{
id: 'models/gemini-2.5-flash-lite',
name: 'Gemini 2.5 Flash-Lite',
temperature: 0.7,
maxTokens: 65535,
contextLength: 1048576,
match: ['models/gemini-2.5-flash-lite', 'gemini-2.5-flash-lite'],
vision: true,
functionCall: true,
reasoning: true,
thinkingBudget: -1 // 动态思维
},
{
id: 'models/gemini-2.5-flash-lite',
name: 'Gemini 2.5 Flash-Lite',
temperature: 0.7,
maxTokens: 65535,
contextLength: 1048576,
match: ['models/gemini-2.5-flash-lite', 'gemini-2.5-flash-lite'],
vision: true,
functionCall: true,
reasoning: true,
thinkingBudget: -1 // 动态思维
},
🤖 Prompt for AI Agents
In src/main/presenter/configPresenter/modelDefaultSettings.ts around lines 365
to 387, there is an exact duplicate entry for the model id
'models/gemini-2.5-flash-lite' which will produce UI duplication and ambiguous
configuration; remove the redundant second block (or consolidate if intentional
differences are needed) so each model id appears only once, ensuring the array
contains a single canonical definition for 'models/gemini-2.5-flash-lite'.

{
id: 'models/gemini-2.5-flash-lite-preview-06-17',
name: 'Gemini 2.5 Flash-Lite Preview',
temperature: 0.7,
maxTokens: 65536,
maxTokens: 65535,
contextLength: 1048576,
match: ['models/gemini-2.5-flash-lite-preview-06-17', 'gemini-2.5-flash-lite-preview'],
vision: true,
functionCall: true,
reasoning: true,
thinkingBudget: 0 // 默认不思考
thinkingBudget: -1 // 动态思维
},
{
id: 'models/gemini-2.0-flash',
name: 'Gemini 2.0 Flash',
temperature: 0.7,
maxTokens: 8192,
maxTokens: 8191,
contextLength: 1048576,
match: ['models/gemini-2.0-flash', 'gemini-2.0-flash'],
vision: true,
functionCall: true,
reasoning: true
reasoning: true //Experimental
},
{
id: 'models/gemini-2.0-flash-lite',
name: 'Gemini 2.0 Flash Lite',
temperature: 0.7,
maxTokens: 8192,
maxTokens: 8191,
contextLength: 1048576,
match: ['models/gemini-2.0-flash-lite', 'gemini-2.0-flash-lite'],
vision: true,
functionCall: true,
reasoning: false
},
{
id: 'models/gemini-1.5-flash',
name: 'Gemini 1.5 Flash',
temperature: 0.7,
maxTokens: 8191,
contextLength: 1048576,
match: ['models/gemini-1.5-flash', 'gemini-1.5-flash'],
vision: true,
functionCall: true,
reasoning: false
},
{
id: 'google/gemini-2.5-flash-image-preview',
name: 'Gemini 2.5 Flash Image Preview',
temperature: 0.7,
maxTokens: 32768,
contextLength: 32768,
match: ['google/gemini-2.5-flash-image-preview', 'gemini-2.5-flash-image-preview'],
vision: true,
functionCall: false,
reasoning: false,
type: ModelType.ImageGeneration
},
{
id: 'models/gemini-2.0-flash-preview-image-generation',
name: 'Gemini 2.0 Flash Preview Image Generation',
Expand All @@ -405,21 +453,10 @@ export const defaultModelsSettings: DefaultModelSetting[] = [
'gemini-2.0-flash-preview-image-generation'
],
vision: true,
functionCall: true,
functionCall: false,
reasoning: false,
type: ModelType.ImageGeneration
},
{
id: 'models/gemini-1.5-flash',
name: 'Gemini 1.5 Flash',
temperature: 0.7,
maxTokens: 8192,
contextLength: 1048576,
match: ['models/gemini-1.5-flash', 'gemini-1.5-flash'],
vision: true,
functionCall: true,
reasoning: false
},
// DeepSeek系列模型配置
{
id: 'deepseek-prover-v2-671b',
Expand Down
57 changes: 45 additions & 12 deletions src/main/presenter/configPresenter/providerModelSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,31 +174,53 @@ export const providerModelSettings: Record<string, { models: ProviderModelSettin
id: 'gemini-2.5-pro',
name: 'Gemini 2.5 Pro',
temperature: 0.7,
maxTokens: 65536,
maxTokens: 65535,
contextLength: 1048576,
match: ['gemini-2.5-pro'],
vision: true,
functionCall: true,
reasoning: true
},
{
id: 'google/gemini-2.5-flash-image-preview',
name: 'Gemini 2.5 Flash Image Preview',
temperature: 0.7,
maxTokens: 32768,
contextLength: 32768,
match: ['google/gemini-2.5-flash-image-preview', 'gemini-2.5-flash-image-preview'],
vision: true,
functionCall: false,
reasoning: false
},
Comment on lines +185 to +194
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Mark flash-image-preview as ImageGeneration

Without type: ModelType.ImageGeneration, downstream won’t set responseModalities and image chunks may be missed.

       {
         id: 'google/gemini-2.5-flash-image-preview',
         name: 'Gemini 2.5 Flash Image Preview',
         temperature: 0.7,
         maxTokens: 32768,
         contextLength: 32768,
         match: ['google/gemini-2.5-flash-image-preview', 'gemini-2.5-flash-image-preview'],
         vision: true,
         functionCall: false,
-        reasoning: false
+        reasoning: false,
+        type: ModelType.ImageGeneration
       },
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
id: 'google/gemini-2.5-flash-image-preview',
name: 'Gemini 2.5 Flash Image Preview',
temperature: 0.7,
maxTokens: 32768,
contextLength: 32768,
match: ['google/gemini-2.5-flash-image-preview', 'gemini-2.5-flash-image-preview'],
vision: true,
functionCall: false,
reasoning: false
},
{
id: 'google/gemini-2.5-flash-image-preview',
name: 'Gemini 2.5 Flash Image Preview',
temperature: 0.7,
maxTokens: 32768,
contextLength: 32768,
match: ['google/gemini-2.5-flash-image-preview', 'gemini-2.5-flash-image-preview'],
vision: true,
functionCall: false,
reasoning: false,
type: ModelType.ImageGeneration
},
🤖 Prompt for AI Agents
In src/main/presenter/configPresenter/providerModelSettings.ts around lines 185
to 194, the model entry for 'google/gemini-2.5-flash-image-preview' is missing a
type designation; add type: ModelType.ImageGeneration to that object so
downstream sets responseModalities and correctly handles image chunks (ensure
ModelType is imported/available in this module).

{
id: 'models/gemini-2.5-flash-lite-preview-06-17',
name: 'Gemini 2.5 Flash-Lite Preview',
temperature: 0.7,
maxTokens: 65535,
contextLength: 1048576,
match: ['models/gemini-2.5-flash-lite-preview-06-17', 'gemini-2.5-flash-lite-preview'],
vision: true,
functionCall: true,
reasoning: true
},
{
id: 'models/gemini-2.5-flash',
name: 'Gemini 2.5 Flash',
temperature: 0.7,
maxTokens: 65536,
maxTokens: 65535,
contextLength: 1048576,
match: ['models/gemini-2.5-flash', 'gemini-2.5-flash'],
vision: true,
functionCall: true,
reasoning: true
},
{
id: 'models/gemini-2.5-flash-lite-preview-06-17',
name: 'Gemini 2.5 Flash-Lite Preview',
id: 'models/gemini-2.5-flash-lite',
name: 'Gemini 2.5 Flash Lite',
temperature: 0.7,
maxTokens: 64000,
contextLength: 1000000,
match: ['models/gemini-2.5-flash-lite-preview-06-17', 'gemini-2.5-flash-lite-preview'],
maxTokens: 65535,
contextLength: 1048576,
match: ['models/gemini-2.5-flash-lite', 'gemini-2.5-flash-lite'],
vision: true,
functionCall: true,
reasoning: true
Expand All @@ -207,7 +229,7 @@ export const providerModelSettings: Record<string, { models: ProviderModelSettin
id: 'models/gemini-2.0-flash',
name: 'Gemini 2.0 Flash',
temperature: 0.7,
maxTokens: 8192,
maxTokens: 8191,
contextLength: 1048576,
match: ['models/gemini-2.0-flash', 'gemini-2.0-flash'],
vision: true,
Expand All @@ -218,7 +240,7 @@ export const providerModelSettings: Record<string, { models: ProviderModelSettin
id: 'models/gemini-2.0-flash-lite',
name: 'Gemini 2.0 Flash Lite',
temperature: 0.7,
maxTokens: 8192,
maxTokens: 8191,
contextLength: 1048576,
match: ['models/gemini-2.0-flash-lite', 'gemini-2.0-flash-lite'],
vision: true,
Expand All @@ -236,15 +258,15 @@ export const providerModelSettings: Record<string, { models: ProviderModelSettin
'gemini-2.0-flash-preview-image-generation'
],
vision: true,
functionCall: true,
functionCall: false,
reasoning: false,
type: ModelType.ImageGeneration
},
{
id: 'models/gemini-1.5-flash',
name: 'Gemini 1.5 Flash',
temperature: 0.7,
maxTokens: 8192,
maxTokens: 8191,
contextLength: 1048576,
match: ['models/gemini-1.5-flash', 'gemini-1.5-flash'],
vision: true,
Expand All @@ -255,7 +277,7 @@ export const providerModelSettings: Record<string, { models: ProviderModelSettin
id: 'models/gemini-1.5-pro',
name: 'Gemini 1.5 Pro',
temperature: 0.7,
maxTokens: 8192,
maxTokens: 8191,
contextLength: 2097152,
match: ['models/gemini-1.5-pro', 'gemini-1.5-pro'],
vision: true,
Expand Down Expand Up @@ -2314,6 +2336,17 @@ export const providerModelSettings: Record<string, { models: ProviderModelSettin
// OpenRouter提供商特定模型配置
openrouter: {
models: [
{
id: 'google/gemini-2.5-flash-image-preview',
name: 'Gemini 2.5 Flash Image Preview',
temperature: 0.7,
maxTokens: 32768,
contextLength: 32768,
match: ['google/gemini-2.5-flash-image-preview', 'gemini-2.5-flash-image-preview'],
vision: true,
functionCall: false,
reasoning: false
},
Comment on lines +2339 to +2349
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

OpenRouter mirror: set ImageGeneration type as well

Keep provider parity; add type: ModelType.ImageGeneration.

       {
         id: 'google/gemini-2.5-flash-image-preview',
         name: 'Gemini 2.5 Flash Image Preview',
         temperature: 0.7,
         maxTokens: 32768,
         contextLength: 32768,
         match: ['google/gemini-2.5-flash-image-preview', 'gemini-2.5-flash-image-preview'],
         vision: true,
         functionCall: false,
-        reasoning: false
+        reasoning: false,
+        type: ModelType.ImageGeneration
       },
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{
id: 'google/gemini-2.5-flash-image-preview',
name: 'Gemini 2.5 Flash Image Preview',
temperature: 0.7,
maxTokens: 32768,
contextLength: 32768,
match: ['google/gemini-2.5-flash-image-preview', 'gemini-2.5-flash-image-preview'],
vision: true,
functionCall: false,
reasoning: false
},
{
id: 'google/gemini-2.5-flash-image-preview',
name: 'Gemini 2.5 Flash Image Preview',
temperature: 0.7,
maxTokens: 32768,
contextLength: 32768,
match: ['google/gemini-2.5-flash-image-preview', 'gemini-2.5-flash-image-preview'],
vision: true,
functionCall: false,
reasoning: false,
type: ModelType.ImageGeneration
},
🤖 Prompt for AI Agents
In src/main/presenter/configPresenter/providerModelSettings.ts around lines 2339
to 2349, the model entry for 'google/gemini-2.5-flash-image-preview' is missing
the type field; add type: ModelType.ImageGeneration to the object to match other
OpenRouter image models. If ModelType is not already imported in this file,
import it from its module (or reference the existing enum location) and ensure
the entry follows the same ordering/format as other provider model objects.

{
id: 'deepseek-r1-0528:free',
name: 'DeepSeek R1-0528:free',
Expand Down
16 changes: 16 additions & 0 deletions src/main/presenter/configPresenter/providers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,22 @@ export const DEFAULT_PROVIDERS: LLM_PROVIDER_BASE[] = [
}
},

{
id: 'tokenflux',
name: 'TokenFlux',
apiType: 'openai',
apiKey: '',
baseUrl: 'https://tokenflux.ai/v1',
enable: false,
websites: {
official: 'https://tokenflux.ai/',
apiKey: 'https://tokenflux.ai/dashboard/api-keys',
docs: 'https://docs.tokenflux.ai/',
models: 'https://docs.tokenflux.ai/api-reference',
defaultBaseUrl: 'https://tokenflux.ai/v1'
}
},

{
id: 'openai-responses',
name: 'OpenAI Responses',
Expand Down
4 changes: 4 additions & 0 deletions src/main/presenter/llmProviderPresenter/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { SiliconcloudProvider } from './providers/siliconcloudProvider'
import { eventBus, SendTarget } from '@/eventbus'
import { OpenAICompatibleProvider } from './providers/openAICompatibleProvider'
import { PPIOProvider } from './providers/ppioProvider'
import { TokenFluxProvider } from './providers/tokenfluxProvider'
import { OLLAMA_EVENTS } from '@/events'
import { ConfigPresenter } from '../configPresenter'
import { GeminiProvider } from './providers/geminiProvider'
Expand Down Expand Up @@ -166,6 +167,9 @@ export class LLMProviderPresenter implements ILlmProviderPresenter {
if (provider.id === 'ppio') {
return new PPIOProvider(provider, this.configPresenter)
}
if (provider.id === 'tokenflux') {
return new TokenFluxProvider(provider, this.configPresenter)
}
if (provider.id === 'deepseek') {
return new DeepseekProvider(provider, this.configPresenter)
}
Expand Down
Loading