AstroGPT is a learning-oriented project built with FastAPI, FAISS, SentenceTransformers, and Ollama.
The main goal is to practice the fundamentals of Retrieval-Augmented Generation (RAG), experiment with FAISS for vector search, and integrate a local LLM through Ollama.
Data source : https://www.kaggle.com/datasets/patrickfleith/astrochat
- FastAPI → Backend REST service
- FAISS → Vector search engine
- SentenceTransformers → Embedding generation for queries and documents
- Ollama (LLaMA 3.1:8B) → Language model
- HTML + Vanilla JS → Frontend interface
- pandas / numpy → Data processing
- Frontend (chat.html) → Collects user messages, sends them to the backend, and renders responses.
- Backend (FastAPI)
- Generates embeddings for user queries.
- Retrieves the most relevant chunks using FAISS.
- Builds an augmented prompt and sends it to Ollama.
- Returns the model’s response to the frontend.
- Ollama → Generates the final answer using the retrieved context.
- Install dependencies:
pip install -r requirements.txt
- Start Ollama and pull the model:
ollama run llama3.1:8b
- Run the FastAPI app:
uvicorn app:app --reload --port 8000
- Open in your browser:
http://localhost:8000