Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Hugging Face 15 min read How-to hardMaster

Personal Copilot: Train Your Own Coding Assistant

HugCoder is a code LLM fine-tuned on the top 10 Hugging Face GitHub repositories, built by cloning repos in parallel, filtering non-code files and training StarCoder with a fill-in-the-middle objective. Full fine-tuning of the 15.5B model on 8×A100 80GB with FSDP took 9 hours (~$108), while QLoRA on a single A100 40GB took 12.5 hours (~$13.75), with a per-parameter memory breakdown explaining why. QLoRA reached slightly higher loss than full fine-tuning but preserved HumanEval pass@1 (33.37 vs 33.57) and matched it qualitatively on HF-specific infilling where GitHub Copilot failed. The post also covers serving the model in VS Code via Inference Endpoints, training a chat variant, and combining LoRA adapters across tasks and base models.

Assumes: LLM fine-tuning basicsLoRA/QLoRAPyTorch distributed trainingHugging Face Transformers

Related posts

  • Code Llama: Llama 2 learns to code

    Hugging Face mediumAdept

    Code Llama is a family of 7B, 13B and 34B Llama 2 derivatives trained on 500B tokens of code. It comes in base, Python-specialized and instruction-tuned variants, has a 16k training context that extrapolates to 100k via RoPE frequency scaling, and supports fill-in-the-middle infilling in the 7B and 13B models. Hugging Face integration starts at transformers 4.33, with code for completion, infilling with the <FILL_ME> token, the Llama 2 chat prompt template, and 4-bit bitsandbytes loading. Recommended setup is float16 for inference and bfloat16 for fine-tuning, plus GPU sizing guidance for TGI/Inference Endpoints and HumanEval/MultiPL-E evaluation.

  • Codex is Open Sourcing AI models

    Hugging Face mediumAdept

    Hugging Face Skills, a repository of agent instructions loaded via AGENTS.md (or Claude Code Skills), lets OpenAI Codex run end-to-end fine-tuning experiments on Hugging Face Jobs. From a short prompt it validates the dataset, picks hardware, submits TRL training (SFT, DPO, GRPO), tracks metrics in Trackio, runs lighteval evaluations and keeps a markdown experiment report up to date. In the walkthrough, a LoRA SFT of Qwen3-0.6B on open-r1/codeforces-cots raises HumanEval pass@1 from about 0.30 to 0.34, and the model is then converted to quantized GGUF for llama.cpp. Rough costs are $1-2 for models under 1B, $5-15 for 1-3B and $15-40 for 3-7B with LoRA, and models above 7B are not yet supported.

  • We Got Claude to Fine-Tune an Open Source LLM

    Hugging Face mediumAdept

    Hugging Face Skills, specifically the hf-llm-trainer skill, lets coding agents like Claude Code, Codex and Gemini CLI run a full LLM fine-tuning lifecycle. The agent validates the dataset, picks GPU hardware by model size, generates a TRL training script with Trackio monitoring, submits it to Hugging Face Jobs, reports progress and pushes the result to the Hub. The walkthrough covers setup, SFT, DPO and GRPO, LoRA for models over 3B, GGUF conversion for llama.cpp, and cost guidance. A 0.6B Qwen3 SFT run on a t4-small costs about $0.30, 3-7B models need A10G/A100 with LoRA at $15-40, and a cheap 100-example test run before a production job catches dataset format errors early.

  • StarCoder: A State-of-the-Art LLM for Code

    Hugging Face easyNovice

    StarCoder and StarCoderBase are ~15B-parameter code LLMs trained on 1 trillion tokens of permissively licensed GitHub data from The Stack 1.2, covering 80+ languages, commits, issues and notebooks, with StarCoder further fine-tuned on 35B Python tokens. With an 8K+ token context, they beat other open code models and match or exceed OpenAI's code-cushman-001 on HumanEval, MBPP, MultiPL-E and DS-1000. A solution-file prompt prefix lifts StarCoder's HumanEval score from 34% to 40.8%, and prompting alone turns the model into a technical assistant. The release includes weights under OpenRAIL-M, training code, an evaluation harness, a PII-redaction dataset and a code attribution tool.

  • Creating a Coding Assistant with StarCoder

    Hugging Face mediumAdept

    StarCoder, BigCode's 16B-parameter open code model with an 8k context window, can be turned into a coding assistant either by dialogue prompting or by fine-tuning it on conversations. Prompting with a long system message and example dialogues works but is expensive, since every turn resends thousands of tokens. The cheaper route is fine-tuning on the English subset of the OpenAssistant dataset, about 21k dialogues, formatted with ChatML-style special tokens (<|system|>, <|user|>, <|assistant|>, <|end|>) added to the tokenizer so generation stops cleanly at turn boundaries. Training uses 🤗 Transformers with DeepSpeed ZeRO-3, and the resulting StarChat model, dataset and code are released.

The quest for software engineering knowledge.

Look:
Layout: