A Web app stack written in FastAPI, Qdrant, and React for creating AI projects
Tags: apps, chatgpt
Published: 2023-11-19 15:48:36

---
title: A Web app stack written in FastAPI, Qdrant, and React for creating AI projects
published: true
date: 2023-11-16 00:48:00 UTC
tags: Apps,ChatGPT
canonical_url: https://reactjsexample.com/a-web-app-stack-written-in-fastapi-qdrant-and-react-for-creating-ai-projects/
---

# AI Starter Kit
 ![A Web app stack written in FastAPI, Qdrant, and React for creating AI projects](https://reactjsexample.com/content/images/2023/11/Code_2023-11_18-43-27.jpg)

A **minimal** code base for creating AI apps to do Question Answering (QA) over PDF documents, completely **locally**.

![A Web app stack written in FastAPI, Qdrant, and React for creating AI projects](https://github.com/mallahyari/ai-starter-kit/raw/main/ai-starter-kit.png)

This project is inspired by [local-ai-stack](https://github.com/ykhli/local-ai-stack). However, their stack is entirely javascript based, and I needed a python based _backend_, so decided to create this project.

#

ai-starter-kit-demo\_3.mp4

<video src="https://user-images.githubusercontent.com/28068313/282212912-5b65f268-d5e2-499e-92ca-38dc4067e940.mp4" data-canonical-src="https://user-images.githubusercontent.com/28068313/282212912-5b65f268-d5e2-499e-92ca-38dc4067e940.mp4" controls="controls" muted="muted" style="max-width:100%;min-height: 200px"></video>

## Stack

- 🦙 Inference: [Ollama](https://github.com/jmorganca/ollama)
- 💻 VectorDB: [Qdrant](https://github.com/qdrant/qdrant)
- 🧠 LLM Orchestration: [Langchain](https://python.langchain.com/docs/get_started/introduction)
- 🖼️ App logic: [FastAPI](https://fastapi.tiangolo.com/)

## How to get started

1. Clone this repo:

```
git clone https://github.com/mallahyari/ai-starter-kit.git
```

1. Install backend dependencies:

```
cd backend/app
pip install -r requirements.txt
```

1. Install frontend dependencies:

```
cd frontend
npm install
```

1. Start the Qdrant vector database (you need Docker). See [here](https://github.com/qdrant/qdrant) for other options information:

```
docker run -p 6333:6333 qdrant/qdrant
```

1. Install Ollama Instructions are [here](https://github.com/jmorganca/ollama#ollama)

2. Run the FastApi server (from inside `backend` directory):

```
python app/main.py
```

1. Open a new terminal and start the React development server (from inside `frontend`):

```
npm start
```

## Change Configurations

You can change configurations in `.config` file, such as the _embedding model_, _chunk size_, and _chunk overlap_. If you plan to use Qdrant Cloud, you can or you can create your own `.env` file and set necessary api keys.

## Additional Use Cases

Although current app only support pdf files, it’s very straightforward to add other types of files such as text files, etc. Also, you can easily add the open-ended chat in addition to QA over document use case.

## Discussion and Contribution

If you have any comment or feedback, please don’t hesitate to use the `Discussions` section and open a new topic. You can also reach out directly via [Linkedin](https://www.linkedin.com/in/mehdiallahyari/) or [Twitter](https://twitter.com/MehdiAllahyari)

## GitHub

[View Github](https://github.com/mallahyari/ai-starter-kit?ref=reactjsexample.com)

<iframe data-aa='2277849' src='//ad.a-ads.com/2277849?size=728x90' style='width:728px; height:90px; border:0px; padding:0; overflow:hidden; background-color: transparent;'></iframe>