Instructions to use celebibasar/DroidSenior-7B-v4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use celebibasar/DroidSenior-7B-v4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="celebibasar/DroidSenior-7B-v4") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("celebibasar/DroidSenior-7B-v4") model = AutoModelForCausalLM.from_pretrained("celebibasar/DroidSenior-7B-v4", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use celebibasar/DroidSenior-7B-v4 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "celebibasar/DroidSenior-7B-v4" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "celebibasar/DroidSenior-7B-v4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/celebibasar/DroidSenior-7B-v4
- SGLang
How to use celebibasar/DroidSenior-7B-v4 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "celebibasar/DroidSenior-7B-v4" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "celebibasar/DroidSenior-7B-v4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "celebibasar/DroidSenior-7B-v4" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "celebibasar/DroidSenior-7B-v4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use celebibasar/DroidSenior-7B-v4 with Docker Model Runner:
docker model run hf.co/celebibasar/DroidSenior-7B-v4
DroidSenior-7B-v4
An Android and Kotlin coding model trained to write code for the current stable Android stack. Its lineage (DroidSenior v1 to v3) includes data from JetBrains/KExercises (CC-BY-NC-SA-4.0). Check those terms before commercial use.
Target versions
Trained and evaluated against the stable versions available on 2026-11-08: AGP 9.5.1 (built-in Kotlin), Kotlin 2.4.21, Gradle 9.9.0, compileSdk 37, Compose BOM 2026.09.00. The full list is in droidsenior_versions.json. Library releases after this date are unknown to the model, so for best results paste your libs.versions.toml into the prompt.
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.
Training
- SFT: 3479 examples, LoRA r=32, loss on assistant tokens only. 1461 examples were written or repaired by
Qwen/Qwen3-Coder-30B-A3B-Instruct-FP8after compiler checks. - Every target answer compiled against the target versions with no deprecation warnings.
Evaluation
All models used the same system prompt and greedy decoding. Rates show 95% bootstrap intervals.
| model | new set: compiles | new set: compiles and current | earlier set: compiles | Kotlin HumanEval | + auto import | + 2 repair rounds |
|---|---|---|---|---|---|---|
| v3 | 39.4% (35%-45%) | 36.4% (32%-41%) | 42.3% (32%-54%) | 73.9% (67%-81%) | 47.0% (42%-52%) | 47.6% (43%-53%) |
| sft_r4 | 47.3% (42%-52%) | 46.7% (42%-52%) | 50.0% (38%-62%) | 72.7% (66%-80%) | 55.7% (51%-61%) | 58.4% (53%-64%) |
- New set: 368 questions generated for this release and never used for training. A larger teacher model could solve each of them under the same checks.
- Current: compiles, no deprecation warnings, no outdated library versions or legacy Gradle settings, and migration questions are actually migrated.
- Earlier set: 78 held-out questions from the previous release.
- Compilation uses
:app:compileDebugKotlinin a template project without KSP. It does not test runtime behavior. - Auto import and repair are system results with tools around the model, not single-attempt model results.
- Selected model:
sft_r4. Againstv3: compile +7.9% (95% CI +2.2% to +13.6%), current +10.3% (95% CI +4.6% to +16.0%).
Q4_K_M GGUF: 4.68 GB, CPU speed 7.3 tokens/s on Colab.
Limitations
- Generated code can still be wrong. Review it before use.
- Knowledge of library APIs stops at the target date above.
- These are self-run tests, not an official Android Bench result.
- Downloads last month
- 12
Model tree for celebibasar/DroidSenior-7B-v4
Base model
Qwen/Qwen2.5-7B