Skip to content

Commit 562cc4d

Browse files
committed
add support for Gemini 2.5 Flash model and update README
Signed-off-by: JR <[email protected]>
1 parent f4eddbd commit 562cc4d

File tree

3 files changed

+23
-6
lines changed

3 files changed

+23
-6
lines changed

README.md

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,19 @@ If you have a resource-constrained PC, try increasing `HEALTHCHECK_START_PERIOD`
4444
enough before healthcheck begins.
4545
For more information, please refer to this [link](https://docs.docker.com/reference/compose-file/services/#healthcheck)
4646

47+
#### Supported Gemini Models
48+
49+
You can specify the Gemini model version using the environment variable `GOOGLE_GEMINI` in your `.env` file.
50+
The following models are supported:
51+
52+
| Environment Value | Model Name | Description |
53+
|------------------|------------------|-------------|
54+
| `1_pro` | `gemini-pro` | Legacy Gemini 1 Pro model (Vertex AI / Generative AI Studio). |
55+
| `1.5_flash` | `gemini-1.5-flash` | Lightweight, faster model suitable for low-latency tasks. |
56+
| `1.5_pro` | `gemini-1.5-pro` | More capable model for complex reasoning and higher-quality outputs. |
57+
| `2.5_flash` | `gemini-2.5-flash` | Latest generation, faster and more accurate than 1.5_flash. |
58+
59+
Set the model by updating your `.env` file:
4760
```bash
4861
cd backend
4962
cp .env.example .env
@@ -60,9 +73,9 @@ make docker-down
6073

6174
### Prerequisites
6275

63-
- [`uv`](https://docs.astral.sh/uv/) (for managing Python, virtual environments, and dependencies)
64-
- `wget`
65-
- `pandoc`
76+
- [`uv`](https://docs.astral.sh/uv/) (for managing Python, virtual environments, and dependencies)
77+
- `wget`
78+
- `pandoc`
6679
- `git`
6780

6881
**Step 1**: Install the required dependencies.
@@ -141,12 +154,12 @@ flowchart LR
141154
id1([Vectorstore]) --- id3([MMR Retriever])
142155
id1([Vectorstore]) --- id4([BM25 Retriever])
143156
144-
id2([Semantic Retriever]) -- Retrieved Docs ---> id5([Reranking])
157+
id2([Semantic Retriever]) -- Retrieved Docs ---> id5([Reranking])
145158
id3([MMR Retriever]) -- Retrieved Docs ---> id5([Reranking])
146159
id4([BM25 Retriever]) -- Retrieved Docs ---> id5([Reranking])
147160
148161
id5([Reranking]) ---> id6(top-n docs)
149-
162+
150163
```
151164

152165
Depending on the input query, each query can be forwarded to any one of the following retrievers,

backend/src/api/routers/chains.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@
6060
llm = ChatVertexAI(model_name="gemini-1.5-flash", temperature=llm_temp)
6161
elif os.getenv("GOOGLE_GEMINI") == "1.5_pro":
6262
llm = ChatVertexAI(model_name="gemini-1.5-pro", temperature=llm_temp)
63+
elif os.getenv("GOOGLE_GEMINI") == "2.5_flash":
64+
llm = ChatVertexAI(model_name="gemini-2.5-flash", temperature=llm_temp)
6365
else:
6466
raise ValueError("GOOGLE_GEMINI environment variable not set to a valid value.")
6567

backend/src/api/routers/graphs.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@
8181
llm = ChatVertexAI(model_name="gemini-1.5-flash", temperature=llm_temp)
8282
elif os.getenv("GOOGLE_GEMINI") == "1.5_pro":
8383
llm = ChatVertexAI(model_name="gemini-1.5-pro", temperature=llm_temp)
84+
elif os.getenv("GOOGLE_GEMINI") == "2.5_flash":
85+
llm = ChatVertexAI(model_name="gemini-2.5-flash", temperature=llm_temp)
8486
else:
8587
raise ValueError("GOOGLE_GEMINI environment variable not set to a valid value.")
8688

@@ -205,7 +207,7 @@ def parse_agent_output(output: list) -> tuple[str, list[ContextSource], list[str
205207
embeddings_config=embeddings_config,
206208
reranking_model_name=hf_reranker,
207209
use_cuda=use_cuda,
208-
inbuilt_tool_calling=True,
210+
inbuilt_tool_calling=False,
209211
fast_mode=fast_mode,
210212
debug=debug,
211213
enable_mcp=enable_mcp,

0 commit comments

Comments
 (0)