Skip to content

Commit c4bfca6

Browse files
committed
fix: update documentation and env variables
1 parent 02b551b commit c4bfca6

File tree

5 files changed

+44
-45
lines changed

5 files changed

+44
-45
lines changed

.env.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# GEMINI API key
2+
GEMINI_API_KEY=YOUR_API_KEY
3+
14
# OpenRouter API key
25
OPEN_ROUTER_API_KEY=YOUR_API_KEY
36

README.md

Lines changed: 38 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -7,87 +7,84 @@ Flare AI Kit template for Retrieval-Augmented Generation (RAG) Knowledge.
77

88
## 🚀 Key Features
99

10-
- **Modular Architecture**: Designed with independent components that can be easily extended.
11-
- **Qdrant-Powered Retrieval**: Leverages Qdrant for fast, semantic document retrieval, but can easily be adapted to other vector databases.
12-
- **Unified LLM Integration**: Supports over 300 models via OpenRouter, enabling flexible selection and integration of LLMs.
13-
- **Highly Configurable & Extensible**: Uses a straightforward JSON configuration system, enabling effortless integration of new features and services.
10+
- **Modular Architecture:** Designed with independent components that can be easily extended.
11+
- **Qdrant-Powered Retrieval:** Leverages Qdrant for fast, semantic document retrieval, but can easily be adapted to other vector databases.
12+
- **Highly Configurable & Extensible:** Uses a straightforward configuration system, enabling effortless integration of new features and services.
13+
- **Unified LLM Integration:** Leverages Gemini as a unified provider while maintaining compatibility with OpenRouter for a broader range of models.
1414

1515
## 📌 Prerequisites
1616

1717
Before getting started, ensure you have:
1818

1919
- A **Python 3.12** environment.
2020
- [uv](https://docs.astral.sh/uv/getting-started/installation/) installed for dependency management.
21-
- An [OpenRouter API Key](https://openrouter.ai/settings/keys).
21+
- A [Gemini API key](https://aistudio.google.com/app/apikey).
2222
- Access to one of the Flare databases. (The [Flare Developer Hub](https://dev.flare.network/) is included in CSV format for local testing.)
2323

2424
## 🏗️ Build & Run Instructions
2525

2626
You can deploy Flare AI RAG using Docker or set up the backend and frontend manually.
2727

28-
- **Environment Setup**: Rename `.env.example` to `.env` and add in the variables (e.g. your [OpenRouter API Key](https://openrouter.ai/settings/keys)).
28+
- **Environment Setup:**
29+
Rename `.env.example` to `.env` and add in the variables (e.g. your [Gemini API key](https://aistudio.google.com/app/apikey)).
2930

3031
### Build using Docker
3132

32-
- **Build the Docker Image**:
33+
1. **Build the Docker Image:**
3334

34-
```bash
35-
docker build -t flare-ai-rag .
36-
```
35+
```bash
36+
docker build -t flare-ai-rag .
37+
```
3738

38-
- **Run the Docker Container**:
39+
2. **Run the Docker Container:**
3940

40-
```bash
41-
docker run -p 80:80 -it --env-file .env flare-ai-rag
42-
```
41+
```bash
42+
docker run -p 80:80 -it --env-file .env flare-ai-rag
43+
```
4344

4445
### Build manually
4546

46-
- **Install Dependencies**: Install all required dependencies by running:
47-
48-
```bash
49-
uv sync --all-extras
50-
```
51-
52-
Verify your available credits and get all supported models with:
47+
1. **Install Dependencies:**
48+
Install all required dependencies by running:
5349

54-
```bash
55-
uv run python -m tests.credits
56-
uv run python -m tests.models
57-
```
50+
```bash
51+
uv sync --all-extras
52+
```
5853

59-
- **Setup a Qdrant Service**: Make sure that Qdrant is up an running before running your script.
60-
You can quickly start a Qdrant instance using Docker:
54+
2. **Setup a Qdrant Service:**
55+
Make sure that Qdrant is up an running before running your script.
56+
You can quickly start a Qdrant instance using Docker:
6157

62-
```bash
63-
docker run -p 6333:6333 qdrant/qdrant
64-
```
58+
```bash
59+
docker run -p 6333:6333 qdrant/qdrant
60+
```
6561

66-
- **Configure Parameters and Run RAG**: The RAG consists of a router, a retriever, and a responder, all configurable within `src/input_parameters.json`.
67-
Once configured, add your query to `src/query.txt` and run:
62+
3. **Configure Parameters and Run RAG:**
63+
The RAG consists of a router, a retriever, and a responder, all configurable within `src/input_parameters.json`.
64+
Once configured, add your query to `src/query.txt` and run:
6865

69-
```bash
70-
uv run start-rag
71-
```
66+
```bash
67+
uv run start-rag
68+
```
7269

7370
## 🚀 Deploy on TEE
7471

7572
Deploy on a [Confidential Space](https://cloud.google.com/confidential-computing/confidential-space/docs/confidential-space-overview) using AMD SEV.
7673

7774
### Prerequisites
7875

79-
- **Google Cloud Platform Account:**
76+
- **Google Cloud Platform Account:**
8077
Access to the [`verifiable-ai-hackathon`](https://console.cloud.google.com/welcome?project=verifiable-ai-hackathon) project is required.
8178

82-
- **Gemini API Key:**
79+
- **Gemini API Key:**
8380
Ensure your [Gemini API key](https://aistudio.google.com/app/apikey) is linked to the project.
8481

85-
- **gcloud CLI:**
82+
- **gcloud CLI:**
8683
Install and authenticate the [gcloud CLI](https://cloud.google.com/sdk/docs/install).
8784

8885
### Environment Configuration
8986

90-
1. **Set Environment Variables:**
87+
1. **Set Environment Variables:**
9188
Update your `.env` file with:
9289

9390
```bash
@@ -164,10 +161,10 @@ If you encounter issues, follow these steps:
164161
gcloud compute instances get-serial-port-output $INSTANCE_NAME --project=verifiable-ai-hackathon
165162
```
166163

167-
2. **Verify API Key(s):**
164+
2. **Verify API Key(s):**
168165
Ensure that all API Keys are set correctly (e.g. `GEMINI_API_KEY`).
169166

170-
3. **Check Firewall Settings:**
167+
3. **Check Firewall Settings:**
171168
Confirm that your instance is publicly accessible on port `80`.
172169

173170
## 🔜 Next Steps & Future Upgrades

src/flare_ai_rag/main.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,8 @@ def setup_router(input_config: dict) -> GeminiRouter:
3434
model=settings.gemini_model,
3535
system_instruction=router_config.system_prompt,
3636
)
37-
gemini_router = GeminiRouter(client=gemini_provider, config=router_config)
3837

39-
return gemini_router
38+
return GeminiRouter(client=gemini_provider, config=router_config)
4039

4140

4241
def setup_retriever(

tests/open_router_credits.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88

99
def get_credits(provider: OpenRouterClient) -> None:
10-
# Retrieve available credits
10+
"""Retrieve available OpenRouter credits."""
1111
current_credits = provider.get_credits()
1212
logger.info("current credits", current_credits=current_credits)
1313

tests/open_router_models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55

66
def get_models(client: OpenRouterClient) -> dict:
7-
"""List all available models.
7+
"""List all available OpenRouter models.
88
99
:param client: the initialized OpenRouterClient.
1010
"""

0 commit comments

Comments
 (0)