RAG Chatbot App built with Python (Flask) and designed to interact with LM-Studio via its REST API
863
This Docker image features a Retrieval-Augmented Generation (RAG) Chatbot App built with Python (Flask) and designed to interact with LM-Studio via its REST API. The app enables users to communicate with an AI model running on a local LM-Studio server through a web interface and interact with the contents of a selected PDF document.
LM-Studio:
deepseek-r1-distill-qwen-7btext-embedding-all-minilm-l6-v2-embeddingDocker:
Download the Docker image from Docker Hub:
docker pull michafein/ragchatapp:latest
Run the container with the following environment variables to configure the app:
docker run -d \ # Run the container in detached mode (background)
-p 5000:5000 \ # Map port 5000 on the host to port 5000 in the container
-e LM_STUDIO_API_URL="http://host.docker.internal:1234/v1/chat/completions" \ # Set the API URL for chat completions
-e LM_STUDIO_EMBEDDING_API_URL="http://host.docker.internal:1234/v1/embeddings" \ # Set the API URL for embeddings
-e EMBEDDING_MODEL_NAME="text-embedding-all-minilm-l6-v2-embedding" \ # Define the embedding model name you select in LM Studio
-e CHAT_MODEL_NAME="deepseek-r1-distill-qwen-7b" \ # Define the chat model name you select in LM Studio
-e PDF_PATH="human-nutrition-text.pdf" \ # Specify the path to the PDF file for retrieval
--name ragchatbot \ # Assign a name to the running container (ragchatbot)
michafein/ragchatapp:latest # Use the specified image from Docker Hub (latest version)
The following variables can be set when running the container:
| Variable | Description | My Default Values |
|---|---|---|
LM_STUDIO_API_URL | URL for the LM-Studio Chat API. | http://host.docker.internal:1234/v1/chat/completions |
LM_STUDIO_EMBEDDING_API_URL | URL for the LM-Studio Embedding API. | http://host.docker.internal:1234/v1/embeddings |
EMBEDDING_MODEL_NAME | Name of the embedding model in LM-Studio. | text-embedding-all-minilm-l6-v2-embedding |
CHAT_MODEL_NAME | Name of the chat model in LM-Studio. | deepseek-r1-distill-qwen-7b |
PDF_PATH | Path to the PDF file used for the RAG pipeline. | human-nutrition-text.pdf |
Once the container is running, open your browser and navigate to:
http://localhost:5000
host.docker.internal (Mac/Windows) or your host's IP (Linux) to access the API.human-nutrition-text.pdf) is included in the image. If you want to use a different file, mount it as a volume into the container.If you want to use a custom PDF file, mount it into the container:
docker run -d
-p 5000:5000
-v /path/to/your/pdf.pdf:/app/your_pdf_file.pdf
-e PDF_PATH="your_pdf_file.pdf"
--name ragchatbot
michafein/ragchatapp:latest
Content type
Image
Digest
sha256:0f6cc6166…
Size
295.3 MB
Last updated
over 1 year ago
docker pull michafein/ragchatapp