Release Announcement
Cloud coding assistants send your code to someone else's server. I wanted completions that never leave my laptop, so I built CodeMind. π§ CodeMind is a 1.5B-parameter fill-in-the-middle code model for Python, Java, JavaS
Cloud coding assistants send your code to someone else's server. I wanted completions that never leave my laptop, so I built CodeMind. π§
CodeMind is a 1.5B-parameter fill-in-the-middle code model for Python, Java, JavaScript and TypeScript. It reads the code before and after your cursor and writes the missing part, offline, on a consumer-grade GPU.
How it was trained:
πΉ Stage 1, SFT: full fine-tuning of Qwen2.5-Coder-1.5B on 2 million FIM examples from permissively licensed code (The Stack Dedup), with hybrid sliding-window attention and a sparse mixture of adapter experts. It ran on a Cloud TPU v6e-8 with PyTorch/XLA FSDP: 4.6 hours, held-out perplexity 10.7.
πΉ Stage 2, RLHF with DPO, rewarded by real unit tests: the model wrote 8 solutions per problem, every one was compiled and run, and passing vs failing code became 402 preference pairs. No reward model, no human labels: the tests decide.
π Result: on held-out pairs, CodeMind now prefers the passing solution 81% of the time (chance is 50%). That's a ranking signal, not pass@1 yet. A full before-and-after benchmark is next.
π οΈ Along the way I fixed five PyTorch/XLA traps: generate() recompiling every token, an Accelerate deadlock on multi-chip hosts, bf16 silently downcasting an fp32 policy, gradient checkpointing crashing, and gradient accumulation becoming one giant graph.
π What's live today:
β’ Model weights (fp32) on Hugging Face: huggingface.co/sudhanshu42844/codemind-1.5b-fp32
β’ Code, design docs (HLD, LLD, flow diagrams) and a VS Code extension that runs CodeMind locally: github.com/su394611-del/Code-Mind
β’ Results and the RLHF flow: su394611-del.github.io/codemind
If you run local models in your editor, I'd love your feedback. What would make you switch from a cloud assistant?
MachineLearning #LLM #GenAI #RLHF #DPO #CodeGeneration #OpenSource #VSCode #TPU #PyTorch #PrivacyByDesign
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.