Text Generation
Transformers
Safetensors
MLX
English
qwen2
code
bug-fixing
code-review
lora
ollama
chatml
conversational
text-generation-inference
Instructions to use sandeeprdy1729/TIMPS-Coder-0.5B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sandeeprdy1729/TIMPS-Coder-0.5B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="sandeeprdy1729/TIMPS-Coder-0.5B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("sandeeprdy1729/TIMPS-Coder-0.5B") model = AutoModelForCausalLM.from_pretrained("sandeeprdy1729/TIMPS-Coder-0.5B") 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]:])) - MLX
How to use sandeeprdy1729/TIMPS-Coder-0.5B with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("sandeeprdy1729/TIMPS-Coder-0.5B") prompt = "Write a story about Einstein" messages = [{"role": "user", "content": prompt}] prompt = tokenizer.apply_chat_template( messages, add_generation_prompt=True ) text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- vLLM
How to use sandeeprdy1729/TIMPS-Coder-0.5B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "sandeeprdy1729/TIMPS-Coder-0.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": "sandeeprdy1729/TIMPS-Coder-0.5B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/sandeeprdy1729/TIMPS-Coder-0.5B
- SGLang
How to use sandeeprdy1729/TIMPS-Coder-0.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 "sandeeprdy1729/TIMPS-Coder-0.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": "sandeeprdy1729/TIMPS-Coder-0.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 "sandeeprdy1729/TIMPS-Coder-0.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": "sandeeprdy1729/TIMPS-Coder-0.5B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Pi
How to use sandeeprdy1729/TIMPS-Coder-0.5B with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "sandeeprdy1729/TIMPS-Coder-0.5B"
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "sandeeprdy1729/TIMPS-Coder-0.5B" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use sandeeprdy1729/TIMPS-Coder-0.5B with Hermes Agent:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "sandeeprdy1729/TIMPS-Coder-0.5B"
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default sandeeprdy1729/TIMPS-Coder-0.5B
Run Hermes
hermes
- MLX LM
How to use sandeeprdy1729/TIMPS-Coder-0.5B with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "sandeeprdy1729/TIMPS-Coder-0.5B"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "sandeeprdy1729/TIMPS-Coder-0.5B" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sandeeprdy1729/TIMPS-Coder-0.5B", "messages": [ {"role": "user", "content": "Hello"} ] }' - Docker Model Runner
How to use sandeeprdy1729/TIMPS-Coder-0.5B with Docker Model Runner:
docker model run hf.co/sandeeprdy1729/TIMPS-Coder-0.5B
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,21 +1,153 @@
|
|
| 1 |
---
|
| 2 |
-
base_model: unsloth/qwen2.5-coder-0.5b-instruct-bnb-4bit
|
| 3 |
-
tags:
|
| 4 |
-
- text-generation-inference
|
| 5 |
-
- transformers
|
| 6 |
-
- unsloth
|
| 7 |
-
- qwen2
|
| 8 |
-
license: apache-2.0
|
| 9 |
language:
|
| 10 |
- en
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
---
|
| 12 |
|
| 13 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
- **Finetuned from model :** unsloth/qwen2.5-coder-0.5b-instruct-bnb-4bit
|
| 18 |
|
| 19 |
-
|
| 20 |
|
| 21 |
-
|
|
|
|
|
|
| 1 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
language:
|
| 3 |
- en
|
| 4 |
+
license: apache-2.0
|
| 5 |
+
base_model: Qwen/Qwen2.5-Coder-0.5B-Instruct
|
| 6 |
+
tags:
|
| 7 |
+
- code
|
| 8 |
+
- bug-fixing
|
| 9 |
+
- code-review
|
| 10 |
+
- qwen2
|
| 11 |
+
- lora
|
| 12 |
+
- mlx
|
| 13 |
+
- ollama
|
| 14 |
+
- chatml
|
| 15 |
+
pipeline_tag: text-generation
|
| 16 |
+
library_name: transformers
|
| 17 |
---
|
| 18 |
|
| 19 |
+
# TIMPS-Coder v3 โ Elite Bug-Fixing Assistant (0.5B)
|
| 20 |
+
|
| 21 |
+
> A 0.5B parameter coding model fine-tuned to **think before it codes** โ specialising in bug
|
| 22 |
+
> analysis, code review, algorithm problem-solving, and agentic planning.
|
| 23 |
+
> Built by [Sandeep Reddy](https://github.com/Sandeeprdy1729) ยท TIMPS ยท Made in India ๐ฎ๐ณ
|
| 24 |
+
|
| 25 |
+
[](https://huggingface.co/sandeeprdy1729/TIMPS-Coder-0.5B)
|
| 26 |
+
[](https://ollama.com/sandeeprdy1729/timps-coder)
|
| 27 |
+
[](LICENSE)
|
| 28 |
+
[-brightgreen)](https://github.com/Sandeeprdy1729/TIMPS-Coder/blob/main/benchmark_results.json)
|
| 29 |
+
|
| 30 |
+
## Model Summary
|
| 31 |
+
|
| 32 |
+
| Field | Value |
|
| 33 |
+
|---|---|
|
| 34 |
+
| **Base model** | `Qwen/Qwen2.5-Coder-0.5B-Instruct` (Alibaba Cloud) |
|
| 35 |
+
| **Architecture** | Qwen2 Transformer โ 494M parameters |
|
| 36 |
+
| **Fine-tuning method** | LoRA (rank=16, 16 layers) via MLX-LM |
|
| 37 |
+
| **Context window** | 4096 tokens |
|
| 38 |
+
| **Quantization** | Q4_K_M GGUF (Ollama) / BF16 safetensors (HuggingFace) |
|
| 39 |
+
| **Chat template** | ChatML (`<|im_start|>` / `<|im_end|>`) |
|
| 40 |
+
| **License** | Apache 2.0 |
|
| 41 |
+
| **Training hardware** | Apple M-series (Mac M1/M2/M3, 8 GB RAM) |
|
| 42 |
+
|
| 43 |
+
## Benchmark Results โ 25 Tests, 5 Dimensions
|
| 44 |
+
|
| 45 |
+
Evaluated on [3_benchmark_ollama.py](https://github.com/Sandeeprdy1729/TIMPS-Coder/blob/main/3_benchmark_ollama.py).
|
| 46 |
+
Scoring: **2 pts** = complete correct answer with code ยท **1 pt** = partial ยท **0** = wrong/refused.
|
| 47 |
+
|
| 48 |
+
| Dimension | Score | % |
|
| 49 |
+
|---|---|---|
|
| 50 |
+
| ๐ Bug Fix | 9 / 10 | **90%** |
|
| 51 |
+
| ๐ง SWE / Repo-level | 9 / 10 | **90%** |
|
| 52 |
+
| โก Algorithms | 9 / 10 | **90%** |
|
| 53 |
+
| ๐ Code Review | 8 / 10 | **80%** |
|
| 54 |
+
| ๐ค Agentic Reasoning | 9 / 10 | **90%** |
|
| 55 |
+
| **TOTAL** | **44 / 50** | **88%** |
|
| 56 |
+
|
| 57 |
+
## Quick Start
|
| 58 |
+
|
| 59 |
+
### Ollama (recommended)
|
| 60 |
+
|
| 61 |
+
```bash
|
| 62 |
+
ollama pull sandeeprdy1729/timps-coder
|
| 63 |
+
ollama run sandeeprdy1729/timps-coder
|
| 64 |
+
```
|
| 65 |
+
|
| 66 |
+
### Python (Transformers)
|
| 67 |
+
|
| 68 |
+
```python
|
| 69 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 70 |
+
|
| 71 |
+
model = AutoModelForCausalLM.from_pretrained("sandeeprdy1729/TIMPS-Coder-0.5B")
|
| 72 |
+
tokenizer = AutoTokenizer.from_pretrained("sandeeprdy1729/TIMPS-Coder-0.5B")
|
| 73 |
+
|
| 74 |
+
messages = [
|
| 75 |
+
{"role": "system", "content": "You are TIMPS-Coder v3. THINK through the root cause, FIX with complete code, VERIFY edge cases."},
|
| 76 |
+
{"role": "user", "content": "Fix: `data['user']['email']` throws KeyError when email is absent."},
|
| 77 |
+
]
|
| 78 |
+
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
| 79 |
+
inputs = tokenizer(text, return_tensors="pt")
|
| 80 |
+
out = model.generate(**inputs, max_new_tokens=700, temperature=0.1, do_sample=True)
|
| 81 |
+
print(tokenizer.decode(out[0], skip_special_tokens=True))
|
| 82 |
+
```
|
| 83 |
+
|
| 84 |
+
### MLX (Mac Apple Silicon)
|
| 85 |
+
|
| 86 |
+
```bash
|
| 87 |
+
pip install mlx-lm
|
| 88 |
+
mlx_lm.generate \
|
| 89 |
+
--model sandeeprdy1729/TIMPS-Coder-0.5B \
|
| 90 |
+
--max-tokens 700 --temp 0.1 \
|
| 91 |
+
--prompt '<|im_start|>system
|
| 92 |
+
You are TIMPS-Coder v3. THINK through the root cause, FIX with complete code, VERIFY edge cases.<|im_end|>
|
| 93 |
+
<|im_start|>user
|
| 94 |
+
Fix the race condition: two threads increment self.count += 1 simultaneously.<|im_end|>
|
| 95 |
+
<|im_start|>assistant
|
| 96 |
+
'
|
| 97 |
+
```
|
| 98 |
+
|
| 99 |
+
## Training Details
|
| 100 |
+
|
| 101 |
+
### Fine-tuning Configuration
|
| 102 |
+
|
| 103 |
+
| Parameter | Value |
|
| 104 |
+
|---|---|
|
| 105 |
+
| Base model | `Qwen/Qwen2.5-Coder-0.5B-Instruct` |
|
| 106 |
+
| Fine-tuning method | LoRA (Supervised Fine-Tuning) |
|
| 107 |
+
| LoRA rank | 16 |
|
| 108 |
+
| Learning rate | 5e-6 |
|
| 109 |
+
| Iterations | 3,000 |
|
| 110 |
+
| Batch size | 1 (grad accum ร4) |
|
| 111 |
+
| Max sequence length | 2048 tokens |
|
| 112 |
+
| Framework | MLX-LM on Apple Silicon |
|
| 113 |
+
| Peak RAM | ~5.5 GB |
|
| 114 |
+
|
| 115 |
+
### Training Data
|
| 116 |
+
|
| 117 |
+
| Dataset | Type | Approx. Samples |
|
| 118 |
+
|---|---|---|
|
| 119 |
+
| `newfacade/LeetCodeDataset` | Algorithm problems with solutions | ~2,500 |
|
| 120 |
+
| `SWE-bench/SWE-bench_Verified` | Real GitHub issue โ patch | ~400 |
|
| 121 |
+
| `TIGER-Lab/SWE-Next-SFT-Trajectories` | Agentic edit traces | ~2,000 |
|
| 122 |
+
| `WaltonFuture/agentic-sft-new` | Tool use + bash planning | ~3,000 |
|
| 123 |
+
| Custom TIMPS bug-fix corpus | Hand-curated bug/fix pairs | ~500 |
|
| 124 |
+
| **Total** | | **~8,400 samples** |
|
| 125 |
+
|
| 126 |
+
All samples formatted in ChatML with `THINK โ FIX โ VERIFY` answer structure.
|
| 127 |
+
|
| 128 |
+
## Capabilities
|
| 129 |
+
|
| 130 |
+
| Does well | Limitations |
|
| 131 |
+
|---|---|
|
| 132 |
+
| Bug root-cause analysis with explanation | Complex multi-file refactors |
|
| 133 |
+
| SQL injection, race condition, memory leak detection | May miss subtle business-logic bugs |
|
| 134 |
+
| O-notation analysis and algorithm optimisation | Not a replacement for static analysis tools |
|
| 135 |
+
| LeetCode medium-level algorithm problems | Hard competitive programming problems |
|
| 136 |
+
| GitHub Actions / CI YAML generation | Not trained on Terraform, CDK |
|
| 137 |
+
|
| 138 |
+
## Usage Tips
|
| 139 |
+
|
| 140 |
+
- **Temperature**: Keep at `0.1` โ higher values increase hallucination on a 0.5B model
|
| 141 |
+
- **Context**: Include the full function/class when asking for a bug fix
|
| 142 |
+
- **Verification**: Always test generated code. Even at 88% accuracy, edge cases exist
|
| 143 |
+
- **System prompt**: Required for best results โ see the Quick Start examples above
|
| 144 |
+
|
| 145 |
+
## Training Code
|
| 146 |
|
| 147 |
+
Full training pipeline available at:
|
| 148 |
+
[https://github.com/Sandeeprdy1729/TIMPS-Coder](https://github.com/Sandeeprdy1729/TIMPS-Coder)
|
|
|
|
| 149 |
|
| 150 |
+
## License
|
| 151 |
|
| 152 |
+
Apache 2.0 โ free to use, modify, and distribute commercially.
|
| 153 |
+
Base model (Qwen2.5-Coder-0.5B-Instruct) is also Apache 2.0.
|