Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gemini model adds #3715

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions core/llm/autodetect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ const MODEL_SUPPORTS_IMAGES: string[] = [
"gemini-ultra",
"gemini-1.5-pro",
"gemini-1.5-flash",
"gemini-2.0-flash-exp",
"gemini-2.0-flash-thinking-exp",
"gemini-exp-1206",
"sonnet",
"opus",
"haiku",
Expand Down
46 changes: 46 additions & 0 deletions docs/docs/customize/model-providers/top-level/gemini.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,52 @@ We recommend configuring **Gemini 1.5 Pro** as your chat model.
}
```

### Other Available Models

**Gemini 1.5 Flash** - Fast and versatile multimodal model with 1M token context length
```json title="config.json"
{
"title": "Gemini 1.5 Flash",
"provider": "gemini",
"model": "gemini-1.5-flash",
"apiKey": "[API_KEY]"
}
```

### Experimental Models

The following experimental models are also available:

**Gemini 2.0 Flash Experimental** - Experimental version with 1M token context length
```json title="config.json"
{
"title": "Gemini 2.0 Flash Experimental",
"provider": "gemini",
"model": "gemini-2.0-flash-exp",
"apiKey": "[API_KEY]"
}
```

**Gemini 2.0 Flash Thinking Experimental** - Optimized for reasoning tasks with 32K context
```json title="config.json"
{
"title": "Gemini 2.0 Flash Thinking Experimental",
"provider": "gemini",
"model": "gemini-2.0-flash-thinking-exp",
"apiKey": "[API_KEY]"
}
```

**Gemini Experimental 1206** - Experimental release with 2M token context length
```json title="config.json"
{
"title": "Gemini Experimental 1206",
"provider": "gemini",
"model": "gemini-exp-1206",
"apiKey": "[API_KEY]"
}
```

## Autocomplete model

Gemini currently does not offer any autocomplete models.
Expand Down
39 changes: 39 additions & 0 deletions gui/src/pages/AddNewModel/configs/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,45 @@ export const models: { [key: string]: ModelPackage } = {
providerOptions: ["gemini"],
isOpenSource: false,
},
gemini20FlashExp: {
title: "Gemini 2.0 Flash Experimental",
description: "Experimental version of Gemini 2.0 Flash with improved performance",
params: {
title: "Gemini 2.0 Flash Experimental",
model: "gemini-2.0-flash-exp",
contextLength: 1_048_576,
apiKey: "<API_KEY>",
},
icon: "gemini.png",
providerOptions: ["gemini"],
isOpenSource: false,
},
gemini20FlashThinkingExp: {
title: "Gemini 2.0 Flash Thinking Experimental",
description: "Experimental version of Gemini 2.0 Flash optimized for reasoning tasks",
params: {
title: "Gemini 2.0 Flash Thinking Experimental",
model: "gemini-2.0-flash-thinking-exp",
contextLength: 32_767,
apiKey: "<API_KEY>",
},
icon: "gemini.png",
providerOptions: ["gemini"],
isOpenSource: false,
},
geminiExp1206: {
title: "Gemini Experimental 1206",
description: "Experimental release (December 6th, 2024) of Gemini with extended context",
params: {
title: "Gemini Experimental 1206",
model: "gemini-exp-1206",
contextLength: 2_097_152,
apiKey: "<API_KEY>",
},
icon: "gemini.png",
providerOptions: ["gemini"],
isOpenSource: false,
},
commandR: {
title: "Command R",
description:
Expand Down
9 changes: 8 additions & 1 deletion gui/src/pages/AddNewModel/configs/providers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,14 @@ Select the \`GPT-4o\` model below to complete your provider configuration, but n
required: true,
},
],
packages: [models.gemini15Pro, models.geminiPro, models.gemini15Flash],
packages: [
models.gemini15Pro,
models.geminiPro,
models.gemini15Flash,
models.gemini20FlashExp,
models.gemini20FlashThinkingExp,
models.geminiExp1206
],
apiKeyUrl: "https://aistudio.google.com/app/apikey",
},
xAI: {
Expand Down
32 changes: 30 additions & 2 deletions packages/llm-info/src/providers/gemini.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,46 @@ export const Gemini: ModelProvider = {
recommendedFor: ["chat"],
},
{
model: "gemini-1.5-pro",
model: "gemini-1.5-pro",
displayName: "Gemini 1.5 Pro",
contextLength: 2097152,
maxCompletionTokens: 8192,
regex: /gemini-1\.5-pro/i,
recommendedFor: ["chat"],
},
{
model: "gemini-1.0-pro",
model: "gemini-1.0-pro", // Gemini 1.0 Pro will be discontinued on February 15th, 2025.
displayName: "Gemini 1.0 Pro",
regex: /gemini-1\.0-pro/i,
},
{
model: "gemini-2.0-flash-exp",
displayName: "Gemini 2.0 Flash Experimental",
contextLength: 1048576,
maxCompletionTokens: 8192,
mediaTypes: AllMediaTypes,
regex: /gemini-2\.0-flash-exp/i,
recommendedFor: ["chat"],
},
{
model: "gemini-2.0-flash-thinking-exp",
displayName: "Gemini 2.0 Flash Thinking Experimental",
contextLength: 32767,
maxCompletionTokens: 8192,
mediaTypes: AllMediaTypes,
regex: /gemini-2\.0-flash-thinking-exp/i,
recommendedFor: ["chat"],
},
{
model: "gemini-exp-1206",
displayName: "Gemini Experimental 1206",
contextLength: 2097152,
maxCompletionTokens: 8192,
mediaTypes: AllMediaTypes,
regex: /gemini-exp-1206/i,
recommendedFor: ["chat"],
},

// embed
{
model: "models/text-embedding-004",
Expand Down
Loading