Team Ai
Apppublic

samiuljahan/local-ai-code-review-lab

sourceHugging Facemitupdated 27d agoView on Hugging Face
0likes
App README

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

  1. 1.Spring Boot backend development.
  2. 2.REST API design.
  3. 3.Thymeleaf web UI.
  4. 4.Local open-weight model workflow.
  5. 5.Simple AI evaluation.
  6. 6.Safe public demo practice.

Requirements

bash
java -version
mvn -version
jq --version
curl --version

Use Java 21 or newer.

Run The Spring Boot App

bash
./mvnw spring-boot:run

Open:

text
http://127.0.0.1:8080

Health check:

text
http://127.0.0.1:8080/actuator/health

API

List review cases:

bash
curl http://127.0.0.1:8080/api/cases | jq

Get one case:

bash
curl http://127.0.0.1:8080/api/cases/PR-001 | jq

Score a review:

bash
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 @- |
  jq

Start The Local Model

Start Swift/Qwen with a local OpenAI-compatible API:

bash
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.0

The model endpoint should be:

text
http://127.0.0.1:8000/v1

Run A Model Review

Keep the Spring Boot app running on port 8080.

In another terminal, run:

bash
scripts/run_review.sh PR-001
scripts/score_review.sh PR-001 results/PR-001-review.md

Try all cases:

bash
scripts/run_review.sh PR-001
scripts/run_review.sh PR-002
scripts/run_review.sh PR-003

Then score them:

bash
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.md

Review Cases

CaseRiskExpected bug
PR-001authorization bypassTicket close endpoint skips owner check
PR-002validationDiscount percent is not bounded
PR-003secret exposurePayment client logs bearer token

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

bash
./mvnw test

Hugging 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:

bash
hf repos create samiuljahan/local-ai-code-review-lab --type space --sdk static --public --exist-ok

Upload the repo:

bash
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:

  1. 1.Why AI systems need tests.
  2. 2.How local models can be useful but still need checking.
  3. 3.How to keep private work separate from public demos.
  4. 4.Why simple evals are better than vibes.
  5. 5.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>