CODEE is a full-stack AI coding assistant built with:
- Qwen 2.5 (0.5B & 3B) fine-tuned models
- Node.js/Express backend with safety guardrails
- React frontend with a modern, responsive UI
It provides safe, high-quality code generation, real-time feedback, automatic refinement via a critic model, and a clean developer experience.
- Multi-layer prompt validation guardrails
- Code generation with Qwen 2.5 Coder
- “Critic” system for improved, cleaner code
- Structured REST API (
/generate-code,/validate) - Logging, error handling, environment configuration
- Dark-themed UI
- Real-time status steps: Validation → Generation → Criticism
- Side-by-side generated and improved code
- One-click copy blocks
- Mobile-responsive layout
- SFT for Qwen 2.5 0.5B
- SFT for Qwen 2.5 3B
- Tools for dataset preparation, evaluation, and experimentation
CODEE/
├── backend/ # Express API server
│ ├── src/
│ ├── .env.example
│ └── package.json
│
├── frontend/ # React web UI
│ ├── src/
│ ├── .env.example
│ └── package.json
│
└── notebooks/ # SFT, evaluation, dataset prep
├── CODEE_qwen_2_5_0_5_SFT.ipynb
├── CODEE_qwen_2_5_3_SFT.ipynb
└── README.md
You can run both services locally for development.
cd backend
npm install
cp .env.example .envEdit .env:
HUGGING_FACE_TOKEN=your_token_here
PORT=5000
NODE_ENV=development
Run server:
npm run dev # dev mode (nodemon)
# or
npm start # productionBackend runs at:
http://localhost:5000
cd frontend
npm install
cp .env.example .envSet backend API URL:
REACT_APP_API_BASE_URL=http://localhost:5000/api
REACT_APP_DEBUG=false
Run client:
npm startFrontend runs at:
http://localhost:3000
Located in /notebooks.
Lightweight 0.5B model fine-tuning notebook → Perfect for prototyping, fast iterations
Large 3B model fine-tuning notebook → Same structure as 0.5B SFT, but with more parameters and better reasoning
- Dataset preparation
- Prompt/response formatting
- Supervised fine-tuning training loops
- Loss/evaluation plots
- Inference and model export tools
Run notebooks with:
jupyter lab
# or
jupyter notebook| Endpoint | Method | Description |
|---|---|---|
/api/generate-code |
POST | Validate → Generate → Critic improve |
/api/validate |
POST | Run guardrails without generating |
/health |
GET | Backend status |
Example request:
{ "prompt": "Write a Python function to reverse a string" }npm run buildExample Docker run:
docker build -f docker/Dockerfile.backend -t coding-assistant-backend .
docker run -p 5000:5000 -e HUGGING_FACE_TOKEN=your_token coding-assistant-backendThis project includes comprehensive test suites for both frontend and backend.
cd codee-backend
npm test # Run all tests
npm run test:coverage # Run with coverage
npm run test:watch # Watch modeNote: Backend tests require a .env.test file. Copy from .env.example and set HUGGING_FACE_TOKEN.
cd codee-frontend
npm test # Interactive mode
npm test -- --coverage --watchAll=false # CI mode with coverageAll tests run automatically on every push and pull request via GitHub Actions:
- Backend CI: Jest tests with ES modules, Prettier formatting checks, coverage reports
- Frontend CI: React Testing Library tests, ESLint checks, build verification, coverage reports
- Unified CI: Runs both in parallel with status checks
Required GitHub Secret:
HUGGING_FACE_TOKEN- Add this to your repository secrets for backend tests to pass
- Backend not running
- Wrong
REACT_APP_API_BASE_URL - CORS issues
HF models cold-start; repeated calls are faster.
Triggered for non-coding and unsafe prompts.
MIT