DroidSenior-7B

DroidSenior-7B is a 7B coding assistant specialized in Android development, fine-tuned from Qwen2.5-Coder-7B-Instruct. It aims to answer like a senior/staff Android engineer: modern idiomatic Kotlin, Jetpack Compose, Coroutines/Flow, Hilt and Room, the official Android architecture guidance, explicit trade-offs, no deprecated APIs and tests where they add value. It answers in English and Turkish.

Recommended system prompt

The model was trained with this system prompt on its highest-quality data. Use it for best results:

You are DroidSenior, a staff-level Android engineer. Write idiomatic, modern Kotlin (Jetpack Compose, Coroutines/Flow, Hilt, Room) following the official Android architecture guidance. Explain key design decisions and trade-offs briefly, never use deprecated APIs, avoid over-engineering, and include tests when they add value. Answer in the user's language.

Quick start

transformers

from transformers import AutoModelForCausalLM, AutoTokenizer

repo = "celebibasar/DroidSenior-7B"
SYSTEM_PROMPT = """You are DroidSenior, a staff-level Android engineer. Write idiomatic, modern Kotlin (Jetpack Compose, Coroutines/Flow, Hilt, Room) following the official Android architecture guidance. Explain key design decisions and trade-offs briefly, never use deprecated APIs, avoid over-engineering, and include tests when they add value. Answer in the user's language."""

tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo, torch_dtype="auto", device_map="auto")

messages = [
    {"role": "system", "content": SYSTEM_PROMPT},
    {"role": "user", "content": "Implement a paginated list screen with Compose, Room and Paging 3."},
]
text = tok.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tok(text, return_tensors="pt").to(model.device)
out = model.generate(**inputs, max_new_tokens=1500, do_sample=True, temperature=0.3, top_p=0.9)
print(tok.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))

vLLM (OpenAI-compatible server)

vllm serve celebibasar/DroidSenior-7B --max-model-len 16384

Ollama

ollama run hf.co/celebibasar/DroidSenior-7B-GGUF:Q4_K_M

For the recommended system prompt, download Modelfile and the GGUF file from the GGUF repo and run ollama create droid-senior -f Modelfile.

Training

  1. Open data: Android/Kotlin examples from public Hugging Face datasets, filtered for Android relevance, Java-only answers, deprecated APIs (AsyncTask, GlobalScope, kapt, synthetics, ...) and near-duplicates.
  2. Senior distillation: a taxonomy of 12 areas x 9 task types (feature implementation, code review, legacy refactoring, architecture decisions, debugging, testing, performance, deep dives, system design). A teacher model (Qwen/Qwen3-Coder-30B-A3B-Instruct-FP8) generated realistic questions and answered them with a detailed staff-engineer prompt.
  3. Judge filtering: every answer scored on correctness, modernity, architecture, code quality, completeness and clarity; only high-scoring answers were kept.
  4. SFT: LoRA (bf16) on all attention and MLP projections, loss on assistant tokens only. Senior data used the system prompt above; open data used a generic prompt (quality conditioning).
  5. DPO: on-policy preference tuning — the SFT model sampled 4 answers per prompt, the judge picked the best/worst (654 pairs, beta=0.1, lr=5e-06, LoRA r=32).

Data

source examples notes
Synthetic senior Q&A distilled from Qwen/Qwen3-Coder-30B-A3B-Instruct-FP8 4143 judge-filtered (kept 4143 of 8788)
JetBrains/KExercises 4000 filtered: Android/Kotlin, legacy APIs, dedup; license: CC-BY-NC-SA-4.0 (non-commercial)
giggiovpg/android-kotlin-compose-compiler-verified 5767 filtered: Android/Kotlin, legacy APIs, dedup
giggiovpg/ornith-android-instruct 5176 filtered: Android/Kotlin, legacy APIs, dedup
glaiveai/glaive-code-assistant-v3 586 filtered: Android/Kotlin, legacy APIs, dedup
ise-uiuc/Magicoder-OSS-Instruct-75K 33 filtered: Android/Kotlin, legacy APIs, dedup
m-a-p/CodeFeedback-Filtered-Instruction 49 filtered: Android/Kotlin, legacy APIs, dedup
microsoft/NextCoderDataset 5000 filtered: Android/Kotlin, legacy APIs, dedup
theblackcat102/evol-codealpaca-v1 1566 filtered: Android/Kotlin, legacy APIs, dedup

Hyperparameters

stage method lora_r lora_alpha epochs learning_rate effective_batch max_seq_len train_examples
SFT LoRA (bf16) 64 64 2 0.0001 32 8192 7793
DPO LoRA 32 32 1 5e-06 16 8192 654

Evaluation

Evaluated on 150 held-out questions (never used in training), scored 1-10 by Qwen/Qwen3-Coder-30B-A3B-Instruct-FP8 with the same rubric for every model.

model correctness modernity architecture code_quality completeness clarity overall legacy_api_rate
base 6.91 6.13 5.92 6.09 5.56 6.6 5.84 0.09
sft 8.08 7.47 7.66 7.46 7.05 7.87 7.23 0.0
dpo 8.13 7.54 7.73 7.53 7.08 8.02 7.29 0.01

Head-to-head vs. the base model (overall score per question):

model win tie loss
sft 76% 17% 7%
dpo 73% 23% 5%

Caveats: LLM-as-judge scores, judged by the same model family that generated the training data, on questions drawn from the same generator distribution. Treat them as a relative signal, not an absolute benchmark.

Limitations

  • 7B model: it can still produce code that does not compile or uses APIs incorrectly. Review generated code.
  • Knowledge of libraries is limited to what the base model and training data contain; very recent APIs may be missing.
  • Training data is largely synthetic and judged by an LLM; it inherits the teacher's biases and mistakes.

License

Released under apache-2.0. Base model: Qwen2.5-Coder-7B-Instruct (Apache-2.0). Training data includes non-commercially licensed sets (JetBrains/KExercises); check their terms before commercial use.

Downloads last month
217
Safetensors
Model size
8B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for celebibasar/DroidSenior-7B

Base model

Qwen/Qwen2.5-7B
Finetuned
(492)
this model
Adapters
2 models
Quantizations
1 model

Datasets used to train celebibasar/DroidSenior-7B