File size: 1,663 Bytes
a2d4a76
 
7baafc3
 
a2d4a76
 
 
 
 
7baafc3
a2d4a76
 
7baafc3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
---
title: Otoz Smart Search
emoji: πŸ‘
colorFrom: pink
colorTo: indigo
sdk: gradio
sdk_version: 4.43.0
app_file: app.py
pinned: false
license: cc-by-nc-2.0
---

# Smart Search

This project implements a Mini GPT model using FastAPI, Langchain, and Docker.

## Prerequisites

- Docker
- Docker Compose

## Setup

1. Clone the repository:
   ```
   git clone https://github.com/netsol-research/smart-search
   cd smart-search
   ```

2. Create a `.env` file in the project root and add your environment variables:
   ```
   AWS_ACCESS_KEY_ID=your_aws_access_key
   AWS_SECRET_ACCESS_KEY=your_aws_secret_key
   AWS_DEFAULT_REGION=your_aws_region
   OPENAI_API_KEY=your_openai_api_key
   PINECONE_API_KEY=your_pinecone_api_key
   ```

3. Copy the `.env` file to the `docker` folder:
   ```
   cp .env docker/.env
   ```

4. Create a virtual environment (optional but recommended):
   ```
   python -m venv env
   source env/bin/activate  # On Windows, use `env\Scripts\activate`
   ```

5. Install the required packages:
   ```
   pip install -r requirements.txt
   ```

## Running the Application

To build and run the Docker container:

1. Navigate to the project root directory:
   ```
   cd smart-search
   ```

2. Build and start the Docker containers:
   ```
   docker-compose up --build
   ```

   This command will build the Docker image and start the containers defined in the `docker-compose.yml` file.

3. Once the containers are running, you can access the API at `http://localhost:8000`

To stop the containers, use:
```
docker-compose down
```

This will stop and remove the containers, networks, and volumes created by the `docker-compose.yml` file.