A sophisticated Streamlit-based application offering AI-powered code assistance and security scanning through multiple language models and advanced vector search capabilities. The system leverages various LLMs for different code-related tasks while maintaining context through vector-based document indexing.
-
Multi-Model AI Processing
- Mistral (Ollama)
- CodeLlama (Ollama)
- LLaMA 3 (Groq)
- GPT-4 (Optional OpenAI integration)
-
Vector-Based Document Management
- Persistent index storage
- Real-time index updates
- Context-aware querying
- Efficient document retrieval
-
Task Processing
- Production code generation
- Code review and analysis
- Documentation generation
- Test case creation
- Contextual querying
- Advanced Code Security Scanning
- Quick, Deep, and Custom scan options
- Comprehensive vulnerability detection
- Git repository scanning with authentication support
- Detailed vulnerability reports with severity filters
- Export scan results in JSON or PDF formats
- Streamlit-based user interface
- Hugging Face embedding model integration
- Vector store indexing for document management
- Multi-model task routing system
- Persistent storage management
- Python 3.8+
- Ollama installation
- Groq API access
- Optional: OpenAI API access
- Repository Clone:
git clone https://github.com/AKKI0511/AI-Code-Generator.git
cd AI-Code-Generator
- Dependency Installation:
pip install -r requirements.txt
- Environment Configuration:
GROQ_API_KEY=your_groq_api_key
OPENAI_API_KEY=your_openai_api_key # Optional
Launch the application:
streamlit run main.py
project/
├── main.py # Application entry point
├── app.py # Core application logic
├── constants.py # System constants
├── requirements.txt # Dependencies
├── components/ # UI components
├── models/ # AI models and core logic
├── services/ # Business logic
└── utils/ # Utility functions
- main.py: Application initialization and configuration
- app.py: Streamlit interface and user interaction handling
- code_assistant.py: Core AI processing and task management
- task_service.py: Task-specific business logic
- session_state.py: Application state management
Input: Natural language description
Output: Production-ready Python code
Features:
- Error handling implementation
- Type hint integration
- Documentation generation
- PEP standard compliance
- Performance optimization
Analysis Components:
- Code quality assessment
- Bug identification
- Performance analysis
- Security evaluation
- Optimization recommendations
Output Components:
- System overview
- Implementation details
- API documentation
- Usage examples
- Parameter specifications
Capabilities:
- Pytest framework integration
- Edge case coverage
- Error scenario testing
- Assertion implementation
- Test documentation
Features:
- Context-aware responses
- Source citation
- Code comprehension
- Implementation guidance
- Best practice recommendations
- Quick Scan: Basic security checks
- Deep Scan: Comprehensive analysis
- Custom Scan: Configure specific checks
- Upload Files: Scan uploaded code files
- Scan Code Snippet: Direct code input for scanning
- Git Repository: Scan code from a Git repository with authentication support
- Detailed vulnerability reports with severity filters
- Export options in JSON or PDF formats
- Historical scan data with trend analysis
GROQ_API_KEY # Required for LLaMA 3
OPENAI_API_KEY # Optional for GPT-4
LLAMA_CLOUD_API_KEY # Optional for cloud services
- Embedding Model: BAAI/bge-small-en-v1.5
- Vector Store: LlamaIndex implementation
- Node Parser: SentenceSplitter configuration
- Choose task type from available options
- Input task-specific requirements
- Review generated output
- Access saved files in output directory
- Upload relevant files via UI
- System automatically indexes content
- Access indexed content via queries
- Refresh index for updates
- Model integration interface
- Task type implementation
- UI component development
- Service layer modification
- Follow PEP standards
- Implement comprehensive error handling
- Maintain type hints
- Document new features
- Include unit tests