Docgen is a professional-grade, service-oriented platform designed to automate the lifecycle of code documentation and quality auditing across multiple programming languages. By orchestrating Abstract Syntax Trees (AST) with the Llama 3.3 70B model via Groqβs high-speed LPU architecture, the platform performs deep semantic analysis to produce production-ready code intelligence for Python, Java, JavaScript, and C++.
The Docgen Platform allows users to:
- Generate Docstrings: Automatically insert professional documentation into Python code using AST logic.
- Polyglot Support: Document and analyze logic for Java, JavaScript, and C++ via intelligent AI routing.
- Logic-Aware Code Review: Perform structured audits to detect bugs, security risks, and optimization needs.
- README Generation: Synthesize entire codebases into a professional GitHub-style README.md.
- Interactive Code Chat: Query specific code blocks and logic via a real-time conversational assistant.
- Multi-Style Formatting: Toggle between Google, NumPy, and Sphinx documentation standards.
- Batch Processing: Upload multiple files or a Project ZIP for bulk documentation.
This project is suitable for:
- Engineering teams maintaining large codebases.
- Open-source contributors requiring standardized documentation.
- Automated CI/CD documentation pipelines.
| Category | Technology |
|---|---|
| Frontend | Streamlit |
| Backend | FastAPI |
| AI Engine | Groq LPU + Llama 3.3 70B Model |
| Static Analysis | Python AST (Abstract Syntax Tree) |
| Telemetry | PSUtil (RAM & Latency Tracking) |
| Data Validation | Pydantic Models |
| Environment | Python Virtual Environment (.venv) |
The platform follows a Decoupled Service-Oriented Architecture (SOA) to ensure modularity and scalability.
AUTOMATED-PYTHON-DOCSTRING-GENERATOR-T-B/
βββ .streamlit/ # UI Configuration & Dashboard Theming
β βββ config.toml
βββ app/ # Main Application Logic
β βββ api/ # RESTful Service Layer (FastAPI)
β β βββ main.py # Unified Gateway & Task Routing logic
β β βββ __init__.py
β βββ core/ # The Intelligence Engine (Brain)
β β βββ ai_docstring_engine.py # Core LLM Orchestration (Groq/Llama)
β β βββ ai_engine.py # Feature extraction & context analysis
β β βββ chat_engine.py # Conversational code assistant logic
β β βββ code_reviewer.py # Structured bug & security auditing
β β βββ docstring_gen.py # Heuristic fallback system
β β βββ file_handler.py # File I/O orchestration
β β βββ inserter.py # Surgical AST code re-insertion
β β βββ parser.py # AST node mapping & metadata extraction
β β βββ prompt_builder.py # High-context prompt engineering
β β βββ readme_generator.py # Automatic project documentation logic
β βββ utils/ # Shared Helpers
β β βββ validators.py # Syntax and file-integrity checks
β β βββ __init__.py
β βββ streamlit_app.py # Enterprise Dashboard UI
β βββ __init__.py
βββ docgen-extension/ # VS Code Extension source code
βββ docgen.py # Main CLI Entry point
βββ docstring.py # Standalone documentation utility
βββ requirements.txt # Production-grade dependencies
βββ .env # Environment Secrets (Local only)
βββ .gitignore # Professional Git exclusion rules
βββ LICENSE # MIT License
βββ README.md # Platform Documentation
Ensure the following are installed on your system:
- Python 3.9 or higher
- pip (Python package manager)
- Git
- Groq API Key (Available at console.groq.com)
Check your versions:
python --version
pip --version
git --versionpython -m venv .venvActivate:
Windows:
.venv\Scripts\activatemacOS / Linux:
source .venv/bin/activateCreate / verify requirements.txt:
streamlit
fastapi
groq
uvicorn
dotenv
Install all dependencies:
pip install -r requirements.txtCreate a file named .env in the root directory and add your key: code Text
GROQ_API_KEY=gsk_your_key_herepython -m streamlit run app/streamlit_app.pyAccessible at:
http://localhost:8501python -m uvicorn app.api.main:app --reloadInteractive Documentation: http://127.0.0.1:8000/docs
-
β Python (.py) - Full AST Support
-
β Java (.java) - Routed AI Logic
-
β JavaScript (.js) - Routed AI Logic
-
β C/C++ (.c, .cpp) - Routed AI Logic
-
β Project ZIP - Automated Batch Extraction
-
β Documentation: Generates Google, NumPy, or Sphinx docstrings.
-
β Code Review: Structured JSON analysis of bugs and security risks.
-
β README Gen: Comprehensive Markdown project overviews.
-
β Telemetry: Real-time RAM (MB) and Latency monitoring per request.
Add and Commit Changes
git add .
git commit -m "Feature: Added Multi-Language Routing"Push ONLY to Your Branch
git push origin Member-xError Solution
- JSON Decode Error (422) Ensure input code is wrapped in a {"code": "..."} JSON object.
- Attribute "app" not found Ensure app = FastAPI() is defined in app/api/main.py.
- ModuleNotFoundError Ensure you have activated the .venv and run pip install.
- Memory Error Ensure psutil is installed for telemetry features.
-
Ansh Sharma
-
Sreya Merin Sam
-
Kasa Navya Sri Durga
-
Vattikoti Pooja
- Streamlit Team
- Open-source Python Community
- Mentor Guidance
β¨ This project follows professional Git and Python development practices for AI-driven code intelligence.