← CookbookView source on GitHub ↗

Chat with PDF Documents

demo

A powerful RAG (Retrieval-Augmented Generation) chat application built with Streamlit, LlamaIndex, and Nebius AI's Qwen3 model. This application allows users to upload PDF documents and interact with them through an AI-powered chat interface.

Features

Prerequisites

Installation

1. Clone the repository

git   clone    https://github.com/nebius/token-factory-cookbook/
cd rag/chat-with-pdf

2. Install the required packages:

If using uv

uv sync

If using pip

pip install -r requirements.txt

3. Set up your environment variables:

Create a .env file in the project root and add your Nebius API key:

NEBIUS_API_KEY=your_api_key_here

Running

  1. Run the Streamlit application:

If using uv

uv run streamlit  run main.py

If using pip

streamlit run main.py
  1. Open your web browser and navigate to the provided local URL (typically http://localhost:8501)

  2. Upload a PDF document using the sidebar

  3. Start chatting with your document!

Features in Detail

Document Processing

Chat Interface

Model Options

Architecture

The application uses a combination of:

Contributing

Feel free to submit issues and enhancement requests!

Credits

This example is adopted with thanks from here