How czerny40/project-gpt works
Based on our analysis of the file structure and README, this project is an LLM-based chatbot service implemented in Python using Streamlit and LangChain. It provides several “GPT” modules (e.g., DocumentGPT, AudioGPT, PrivateGPT, QuizGPT, and SiteGPT) that offer specialized functionalities such as document analysis, audio transcription, and Q&A based on different input types. Although there are several Jupyter notebooks and example files, the core interactive application is driven by Streamlit (via Home.py/app.py) with separate modules under the “pages” directory, and supporting utilities in the “utils” folder. External integrations include OpenAI APIs, local LLM alternatives (e.g., ChatOllama), HuggingFace modules, and other AI/ML libraries (e.g., yt_dlp, pydub, ffmpeg).
Main Components
• Frontend/UI Layer
– The user interface is powered by Streamlit. This is represented by files such as Home.py and app.py.
• Service/Module Layer
– The “pages” directory encapsulates the main functional components (AudioGPT.py, DocumentGPT.py, PrivateGPT.py, QuizGPT.py, SiteGPT.py). These can be depicted as separate modules responsible for different conversation and processing tasks.
• Business Logic and Utilities
– Utility functions handling callbacks, chat management, document processing, and retrieval are in the “utils” folder.
– The configuration files (prompt.json, prompt.yaml, model.json) and the cache database (cache.db) support the back-end processing.
• External Services & APIs
– External APIs (OpenAI, HuggingFace, etc.) and local LLMs are key external integration points. These provide core LLM functionality.
• Experimental / Example Workbench
– Jupyter notebooks (agents.ipynb, assistant.ipynb, notebook.ipynb, whisper.ipynb) and the notebook examples in the “examples” directory demonstrate experimental code and usage examples.
Relationships & Interactions
• Shared Resources: Indicate how configuration (prompt files) or caching (cache.db) plays a role in the services.
• Additionally, note that while many experimental notebooks exist, they are not part of the production service but are useful for understanding and demonstrating the processing logic.
Architectural Patterns & Design Principles
• Separation of Concerns: Clearly separate the presentation layer (Streamlit UI) from the functional logic (different GPT pages) and from external API integrations.
• Modularity: Each GPT module acts as an independent service (functionally or as a micro-module) that leverages common utilities.
• Extensibility: The design supports adding more pages or integrating additional external services without impacting the overall structure.
• Reusability: The “utils” module provides shared functions across different GPT services.