Local Fine-Tuning of Llama 3.2-1B for Secret Detection Surpasses Wiz's Model

A developer has documented their successful local fine-tuning of Llama 3.2-1B for secret detection in code, surpassing the metrics of a similar model from Wiz. The project was conducted entirely with local AI tools, avoiding proprietary APIs.
Key Results and Approach
The developer aimed to replicate or beat Wiz's results of 86% precision and 82% recall. After a few weekends of work, they achieved 88% precision and 84.4% recall simultaneously with a fine-tuned Llama 3.2-1B model. They also benchmarked Qwen 3.5-2B and 4B models, which outperformed the 1B model at the cost of higher VRAM usage and longer inference times.
Dataset and Training Process
The work relied solely on publicly available data, which was insufficient, so procedural generation was used to augment and improve the dataset. All labeling was done locally using the Qwen3-Coder-Next model. A key training objective was to have the models output structured JSON. Initially, untrained models (Llama & Qwen) scored 0% on schema compliance, but after training, this improved to 98-100%.
Challenges and Learnings
The developer encountered several issues during the process:
- Included a high entropy class that was detrimental to training; this was identified and removed.
- Discovered that 4,500 of the 'negative' samples in the dataset actually contained real-world passwords, meaning the model was being trained to ignore secrets. Fixing this improved recall on passwords.
The developer has published a full technical write-up with training stats, examples, and a step-by-step breakdown of the process.
📖 Read the full source: r/LocalLLaMA
👀 See Also

AI Coding Agents Stall at Deployment: Cowork User Hits Sandbox, Permission, and Context Loss Issues
A developer building a Next.js app with Cowork reports the AI agent built code successfully but failed to deploy — stuck on sandbox restrictions, GitHub push issues, and session context loss.

OpenClaw Use Case: Building a Daily Personal News Digest with AI
A developer shares their OpenClaw setup for a daily news digest using a cronjob with a detailed prompt that specifies news sources, interest priorities, and output format. The system fetches RSS feeds from trusted Dutch publications and delivers 5 curated stories each morning.

Automated Cold Email System Built with OpenClaw, Neon, and Resend
A developer built a fully automated cold email system using OpenClaw as the orchestrating AI agent, Neon for serverless Postgres, and Resend for email API. The system has sent over 5000 emails and manages lead tracking, automated sending, reply detection, and notifications via iMessage.

Practical Lessons from Building a 350K-Line Codebase Solo with AI Agents
A developer shares concrete engineering insights from building a 356K-line production codebase in 52 days using AI agents, including how codebase structure affects agent output and why strong typing is essential.