samiuljahan/local-ai-code-review-lab
Local AI Code Review Lab
A complete Spring Boot app for testing local AI code reviews.
The app uses fake pull request diffs with known bugs. A local model reviews the diff, then the app scores whether the review found the expected issue.
This is built for a public AI portfolio. It uses demo code only. Do not use private company code, logs, tickets, secrets, or customer data.
What It Shows
- Spring Boot backend development.
- REST API design.
- Thymeleaf web UI.
- Local open-weight model workflow.
- Simple AI evaluation.
- Safe public demo practice.
Requirements
java -version
mvn -version
jq --version
curl --versionUse Java 21 or newer.
Run The Spring Boot App
./mvnw spring-boot:runOpen:
http://127.0.0.1:8080Health check:
http://127.0.0.1:8080/actuator/healthAPI
List review cases:
curl http://127.0.0.1:8080/api/cases | jqGet one case:
curl http://127.0.0.1:8080/api/cases/PR-001 | jqScore a review:
jq -n --arg review "This misses an owner authorization check." '{reviewText: $review}' |
curl -fsS http://127.0.0.1:8080/api/cases/PR-001/score \
-H "Content-Type: application/json" \
-d @- |
jqStart The Local Model
Start Swift/Qwen with a local OpenAI-compatible API:
llama-server -hf ukisai/Swift-Qwen3.8-27B-GGUF:Q4_K_M \
--host 127.0.0.1 \
--port 8000 \
--jinja \
-fa on \
-ngl 99 \
-c 32768 \
--temp 1.0 \
--top-p 0.95 \
--top-k 20 \
--min-p 0 \
--presence-penalty 0 \
--repeat-penalty 1.0The model endpoint should be:
http://127.0.0.1:8000/v1Run A Model Review
Keep the Spring Boot app running on port 8080.
In another terminal, run:
scripts/run_review.sh PR-001
scripts/score_review.sh PR-001 results/PR-001-review.mdTry all cases:
scripts/run_review.sh PR-001
scripts/run_review.sh PR-002
scripts/run_review.sh PR-003Then score them:
scripts/score_review.sh PR-001 results/PR-001-review.md
scripts/score_review.sh PR-002 results/PR-002-review.md
scripts/score_review.sh PR-003 results/PR-003-review.mdReview Cases
First Local Model Run
Swift/Qwen Q4_K_M caught the expected bug in all three fake PRs.
See docs/model-run-results.md.
Run Tests
./mvnw testHugging Face Space
The Spring Boot app runs locally. Hugging Face serves the static report from space/index.html, while the Files tab still shows the full source code.
Create the Space:
hf repos create samiuljahan/local-ai-code-review-lab --type space --sdk static --public --exist-okUpload the repo:
hf upload samiuljahan/local-ai-code-review-lab . . --repo-type space \
--commit-message "Publish local AI code review lab" \
--exclude ".git/*" \
--exclude "target/*" \
--exclude "results/*.md"Interview Talking Points
Use this project to explain:
- Why AI systems need tests.
- How local models can be useful but still need checking.
- How to keep private work separate from public demos.
- Why simple evals are better than vibes.
- What the scoring method catches and what it misses.
Sources
- Spring Boot: <https://spring.io/projects/spring-boot>
- Spring Initializr: <https://docs.spring.io/initializr/docs/current/reference/html/>
- Hugging Face Static Spaces: <https://huggingface.co/docs/hub/spaces-sdks-static>
- Swift GGUF model: <https://huggingface.co/ukisai/Swift-Qwen3.8-27B-GGUF>
