How princegedeon/apiforqcmintelligent works
Main Components
• FastAPI Server: The API is built using FastAPI, with main.py as the entry point. This component will handle incoming HTTP requests (for example, the POST request to /generate-qcm).
• Inference & Utility Modules: The utils directory contains key modules (like inference.py and parsers.py) that perform the processing tasks, including model inference using PyTorch.
• Model Repository: The models directory (and specifically models/ghostprince) contains configuration files, hyperparameters, and model weights (e.g., adapter_model.safetensors). This repository supports model loading and inference.
Relationships and Data Flows
• Client Requests: Label an external “Client” or “API Caller” that sends requests to the FastAPI endpoint (/generate-qcm).
• FastAPI Layer: Illustrate how main.py receives the request and routes it to the appropriate handler.
• Inference Process: Show that FastAPI invokes functions within utils (especially inference.py) to process data. This module loads model configurations and weights from the models/ghostprince directory.
• Model Execution: Emphasize that PyTorch (using GPU support as specified in the README) is used for running the model. Connect the inference component to the model repository, indicating that model weights, hyperparameters, and training metadata are accessed here.
Key Architectural and Design Principles
• Containerization: Highlight the use of Docker and docker-compose for environment consistency and scalability. Show that external dependencies (like CUDA-enabled drivers and Pytorch) are configured within the container.
Technologies and Dependencies to Highlight
• FastAPI for building the REST API endpoints.
• PyTorch for model inference and GPU acceleration.
• Docker & Docker Compose for containerizing and running the application.
• NVIDIA drivers and CUDA toolkit (as prerequisites) for enabling GPU support.
• Utility modules (utils) that assist with parsing inputs and formatting outputs.