An interactive, locally running question-and-answer chatbot based on Ollama’s cloud models and modern retrieval methods.
It is operated via Chainlit, uses LangChain for orchestration, FAISS for fast vector search and state-of-the-art open source models on Ollama Cloud (https://docs.ollama.com/cloud#python)
- Development of a local QA bot that utilises PDF and source text data (examples with selectd publications) or web links
- Integration of a multilingual embedding model (DE/EN)
- Integration of an open source model on Ollama Cloud
- Interactive chat interface via Chainlit
- Optional: Protection against jailbreak/bypass prompts
| Technology | Description |
|---|---|
| Chainlit | UI-Framework for LLMs – makes the chat interface |
| LangChain | Retrieval orchestration |
| FAISS | Vector database for semantic search |
| Ollama Cloud | Allows to run large LLM from Ollama's cloud service |
| HuggingFace Embeddings | paraphrase-multilingual-MiniLM-L12-v2 for multilingual embeddings |
Ollama’s cloud models require an account on ollama.com. Navigate to the chat environment and run the following command in the terminal (internet connection is needed). To sign in or create an account, run:
-"ollama signin"
This will open a page in the default browser with a click button to approve
To run a cloud model, open the terminal and run your selected model:
Example: "ollama run gpt-oss:20b-cloud"
The selected model must be the same used for inference in app.py.
- Python ≥ 3.10
- macOS/Linux
- Docker Engine (optional für Container-Betrieb)
- Data:
.env- PDF-Data in the folder
data/
- Installation with conda:
- Clone the repository and navigate into the project folder
- Create the Conda environment from the provided YAML file: "conda env create -f project_langchain3.yml"
- Activate the environment: "conda activate chainlit3"
conda env create -f project_langchain3.yml
conda activate chainlit3 - (Optional) Verify that the environment was created successfully: "conda info --envs"
conda info --envs- If dependencies are updated, you can refresh the environment at any time using:
conda env update -f environment.yml --prune- Installation with venv
pyenv install 3.12.0
pyenv virtualenv 3.12.0 chainlit
pyenv local chainlitpip install chainlitThis script processes PDF files and uses LangChain, Hugging Face Embeddings and FAISS to generate a searchable vector database from them.
- Load files from
data/ - Break down into text sections
- Create embeddings
- Save to
vectorstores/db_faiss
Alternatively:
This script processes web pages and uses LangChain, Hugging Face Embeddings and FAISS to generate a searchable vector database from them.
- Load webpages directly from the script
- Break down into text sections
- Create embeddings
- Save to
vectorstores/db_faiss
This script loads the stored FAISS database and uses a Ollama cloud model to answer user questions.
- Loading model from Ollama Cloud
- Using LangChain Retrieval and harmony chat configuration prompt (works with latest LLMs like gpt-oss)
- Chat interface via Chainlit
- Model: "gpt-oss:20b-cloud" (or other)
- EMBED_MODEL = "sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2"`
- Retrieval: FAISS + LangChain
langchain_community.vectorstores.FAISS - Interface: Chainlit
make ingestGenerate semantic vectors and store them in FAISS.
🧑💻 Question:
What are adaptation limits?
🤖 Answer:
Adaptation limits are he points beyond which further adaptation cannot fully eliminate health risks from heat.....
# Local
python ingest.py
chainlit run app.py -w
MIT License – feel free to use, learn and build on it 🚀