CodeFinetuner: Fine-tune a local code autocomplete model on your own codebase
CodeFinetuner 是一个新工具,旨在帮助用户在其自己的代码库上微调小型代码自动完成模型,例如 Qwen2.5-Coder-3B。该工具经过数月开发,提供了一个完整的 LoRA 微调流程,支持在 Mac (MPS) 和 NVIDIA GPU (CUDA) 上运行,并可选集成 Unsloth 以实现更快的训练速度和更低的 VRAM 占用。微调后生成的 GGUF 模型可以与 llama.vim 或 llama.vscode 等工具配合,在本地完全运行。
时间与来源
时间显示为 UTC
显示时区:UTC
本地时区尚不可用,暂时显示 UTC。
发布当时偏移:UTC+02026年9月11日 18:56 UTC
收录当时偏移:UTC+02026年9月12日 15:01 UTC
- 发布
- 2026年9月11日 18:56
- 收录
- 2026年9月12日 15:01
- 来源类型
- 开发者社区
- 档位
- 社区
- 信源状态
- 正常
档位是按信源手工设定的编辑判断,不是逐条打分。
I was interested in learning LoRA fine-tuning, and ended up building CodeFinetuner over the past few months, a full pipeline that fine-tunes a small code autocomplete model (e.g. Qwen2.5-Coder-3B) specific to a codebase. You can then use the resulting GGUF model via llama.vim/llama.vscode and run it fully locally. Supports fine-tuning on Mac (MPS) and NVIDIA GPUs (CUDA), with optional Unsloth support for faster training and lower VRAM usage.
Pipeline: raw code -> tree-sitter parsing into Structure-Aware FIM examples -> LoRA fine-tuning -> evaluation (CodeBLEU, edit similarity, exact match, perplexity, ...) -> GGUF conversion for local inference.
Create a data folder and place your repo (or code files) inside. For auto-split just drop the files in directly, for manual split create data/train/, data/eval/, data/test/ subfolders and set split_mode: "manual". Get the default config with:
curl -L -O https://raw.githubusercontent.com/cuolm/codefinetuner/master/config/codefinetuner_config.yaml
The example runs in the repo show clear improvements over the base model on these evaluation metrics, but using the model for autocomplete on code you're actively writing is a different thing from scoring well on a test set, and the autocomplete tools themselves (llama.vim/llama.vscode) sample differently from the greedy decoding used in the evaluation. So the real usefulness still has to be verified in the editor itself.
Might also be useful just as a reference, since it's a complete working LoRA fine-tuning pipeline end to end.