viplismism/deepseek-coder-6.7b-fim-reth-v1
011
deepseek-coder-6.7b-fim-reth-v1
A LoRA fine-tuned adapter for deepseek-ai/deepseek-coder-6.7b-base, specialized for Fill-in-the-Middle (FIM) code completion on the reth Rust codebase.
On a held-out reth test split it more than doubles the base model's exact-match rate (see Evaluation).
Want plug-and-play (Ollama / llama.cpp)? Use the GGUF build (q4km / q8_0) — no base model or PEFT needed.
Model Details
- Base Model: deepseek-ai/deepseek-coder-6.7b-base
- Fine-tuning Method: LoRA (Low-Rank Adaptation) with 4-bit quantization (QLoRA)
- Training Data: AST-extracted FIM samples from the reth Rust codebase
- Task: Fill-in-the-Middle code completion (predict missing code between prefix and suffix)
Training Configuration
FIM Format
Uses the DeepSeek Coder FIM token format:
<|fim▁begin|>[code before cursor]<|fim▁hole|>[code after cursor]<|fim▁end|>[generated completion]Usage
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
base = AutoModelForCausalLM.from_pretrained(
"deepseek-ai/deepseek-coder-6.7b-base", device_map="auto", load_in_4bit=True)
model = PeftModel.from_pretrained(base, "viplismism/deepseek-coder-6.7b-fim-reth-v1")
tokenizer = AutoTokenizer.from_pretrained("viplismism/deepseek-coder-6.7b-fim-reth-v1")
prompt = "<|fim▁begin|>fn add(a: i32, b: i32) -> i32 {\n <|fim▁hole|>\n}<|fim▁end|>"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
out = model.generate(**inputs, max_new_tokens=64, do_sample=False)
print(tokenizer.decode(out[0][inputs.input_ids.shape[1]:], skip_special_tokens=True))Evaluation
Evaluated on a held-out reth test split (200 samples never seen in training), tuned adapter vs. the unmodified base model, same FIM prompts:
The fine-tune wins on every metric. (pass@1 is strict exact-string match; edit-similarity/BLEU capture near-correct completions.)
Limitations
- Tuned on Rust code from a single repository (reth) — generalizes less to other languages/repos.
- FIM-only: expects the FIM prompt format above, not free-form chat.
- Inherits the biases/limitations of
deepseek-coder-6.7b-base.
License
Use of this adapter is subject to the DeepSeek License Agreement governing the base model.
Framework versions
- transformers 4.49.0 · trl 0.17.0 · PEFT 0.19.1
