This project is an AI-powered code generator that uses the Groq API (Mixtral 8x7B or another free model) to generate, optimize, and debug code. The tool is designed to assist developers in writing efficient and well-documented code with AI assistance.
- AI-Powered Code Generation → Generate code in multiple languages (Python, JavaScript, C++, Java, etc.).
- Code Optimization & Debugging → AI analyzes, fixes errors, and suggests improvements.
- AI-Generated Documentation → Auto-generate inline comments and README.md files.
- Multi-Platform Support → Web UI (Streamlit) and CLI tool.
- Free & Fast → Uses Groq API (Mixtral 8x7B) for cost-effective AI-powered coding.
git clone https://github.com/mharoon1578/ai-code-generator.git
cd ai-code-generator
pip install -r requirements.txt
- Get an API key from Groq Console.
- Create a .env file and add your key:
GROQ_API_KEY=your_api_key_here
python generate.py --prompt "Write a Python function for quicksort"
To enable debugging & optimization:
python generate.py --prompt "Write a Python function for quicksort" --debug
streamlit run app.py
ai-code-generator/
│── app.py # Streamlit web UI
│── generate.py # CLI tool for code generation & debugging
│── requirements.txt # Dependencies
│── README.md # Project documentation
│── LICENSE # License file
Contributions are welcome! Feel free to fork the repo, open issues, or submit PRs.
This project is licensed under the MIT License.