Instructions to use rajivmehtapy/git-assistant-qwen2.5-coder-1.5b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use rajivmehtapy/git-assistant-qwen2.5-coder-1.5b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="rajivmehtapy/git-assistant-qwen2.5-coder-1.5b") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("rajivmehtapy/git-assistant-qwen2.5-coder-1.5b") model = AutoModelForCausalLM.from_pretrained("rajivmehtapy/git-assistant-qwen2.5-coder-1.5b", 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use rajivmehtapy/git-assistant-qwen2.5-coder-1.5b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "rajivmehtapy/git-assistant-qwen2.5-coder-1.5b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "rajivmehtapy/git-assistant-qwen2.5-coder-1.5b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/rajivmehtapy/git-assistant-qwen2.5-coder-1.5b
- SGLang
How to use rajivmehtapy/git-assistant-qwen2.5-coder-1.5b 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 "rajivmehtapy/git-assistant-qwen2.5-coder-1.5b" \ --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": "rajivmehtapy/git-assistant-qwen2.5-coder-1.5b", "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 "rajivmehtapy/git-assistant-qwen2.5-coder-1.5b" \ --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": "rajivmehtapy/git-assistant-qwen2.5-coder-1.5b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use rajivmehtapy/git-assistant-qwen2.5-coder-1.5b with Docker Model Runner:
docker model run hf.co/rajivmehtapy/git-assistant-qwen2.5-coder-1.5b
Git Assistant — Qwen2.5-Coder 1.5B
An experimental GRPO fine-tune of Qwen/Qwen2.5-Coder-1.5B-Instruct for generating executable Git-operation instructions. The model is intended to help with small, well-scoped repository tasks such as initializing repositories, creating branches, committing files, tagging releases, and merging branches.
This repository contains the standalone merged 16-bit model. The LoRA adapter and intermediate checkpoints are not included.
Intended use
Use this model as a coding-assistant component that proposes Git commands for human review or execution inside an independently controlled sandbox. Treat generated commands as untrusted output: inspect them before execution and restrict the execution environment to the intended repository.
Training
The model was trained with a container-compatible direct-Python adaptation of the Agent Training Execution Playbook:
- Base model:
Qwen/Qwen2.5-Coder-1.5B-Instruct - Method: LoRA + GRPO
- Training length: 15 optimizer steps across 3 epochs
- Generations per prompt: 4
- Maximum sequence length: 2,048 tokens
- Precision: BF16 when supported by the GPU
- Optimizer: 8-bit AdamW
- Learning rate:
5e-6 - Tasks:
init_commit,branch_create,commit_and_tag, andmerge_branch - Rewards: response-format checks plus an isolated Git sandbox verifier
The Git verifier used an isolated temporary HOME, fixed Git identity, command timeouts, path restrictions, and blocked high-risk shell commands. The run is intentionally small and experimental; it is not a benchmark-quality or production-quality training run. No external training dataset was used beyond the synthetic task prompts defined for this experiment.
Limitations and safety
- The 15-step run is a smoke-scale fine-tune, so behavior may be inconsistent across task wording and repository states.
- The model can produce incorrect, incomplete, or unsafe shell commands. Always review generated commands before execution.
- The reward verifier covered only the four task templates above and should not be treated as broad Git competence evaluation.
- No standardized coding benchmark or human evaluation was run for this release.
- The model does not provide a security guarantee and should not receive unrestricted shell access, credentials, or network access.
Transformers usage
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "rajivmehtapy/git-assistant-qwen2.5-coder-1.5b"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.bfloat16,
device_map="auto",
)
messages = [
{
"role": "system",
"content": (
"You are an expert Git automation assistant. Provide executable "
"bash commands and explain the expected repository state."
),
},
{
"role": "user",
"content": (
"In directory project, create app.py containing print(\"hello\"), "
"commit it with message 'Add app', and create tag v1.0."
),
},
]
inputs = tokenizer.apply_chat_template(
messages,
add_generation_prompt=True,
return_tensors="pt",
).to(model.device)
outputs = model.generate(inputs, max_new_tokens=256, do_sample=False)
print(tokenizer.decode(outputs[0][inputs.shape[-1]:], skip_special_tokens=True))
vLLM usage
vllm serve rajivmehtapy/git-assistant-qwen2.5-coder-1.5b \
--served-model-name git-assistant \
--max-model-len 2048
The source-container validation used vLLM 0.26.0 with eager execution and its non-FlashInfer sampler because that container's bundled CUDA compiler and headers were incompatible with FlashInfer JIT compilation. Other environments may use their normal vLLM configuration.
License and attribution
This derivative model is released under the Apache License 2.0, consistent with the base model's published license. Please review the Qwen model license and usage terms before redistribution or deployment.
- Downloads last month
- 105
Model tree for rajivmehtapy/git-assistant-qwen2.5-coder-1.5b
Base model
Qwen/Qwen2.5-1.5B