File size: 5,164 Bytes
93094f1
 
a43a8c9
 
 
 
 
 
 
 
 
 
 
 
 
93094f1
 
a43a8c9
93094f1
a43a8c9
93094f1
a43a8c9
93094f1
a43a8c9
 
 
 
93094f1
a43a8c9
93094f1
a43a8c9
 
93094f1
a43a8c9
 
93094f1
a43a8c9
 
 
 
93094f1
a43a8c9
 
93094f1
a43a8c9
 
 
93094f1
a43a8c9
93094f1
a43a8c9
 
 
 
 
 
 
 
93094f1
 
 
 
 
a43a8c9
93094f1
a43a8c9
 
 
 
 
 
93094f1
 
 
a43a8c9
 
 
 
 
 
 
 
 
 
93094f1
 
 
a43a8c9
 
93094f1
a43a8c9
93094f1
a43a8c9
93094f1
a43a8c9
 
 
 
 
 
93094f1
a43a8c9
93094f1
a43a8c9
 
 
 
 
93094f1
a43a8c9
93094f1
a43a8c9
 
 
 
93094f1
a43a8c9
93094f1
a43a8c9
93094f1
a43a8c9
 
 
 
 
 
93094f1
a43a8c9
93094f1
a43a8c9
93094f1
a43a8c9
 
 
 
 
 
 
 
 
93094f1
a43a8c9
93094f1
a43a8c9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
---
library_name: transformers
tags:
  - code
  - coding-assistant
  - qwen2
  - lora
  - fine-tuned
  - full-stack
  - reasoning
license: apache-2.0
language:
  - en
base_model: Qwen/Qwen2.5-Coder-1.5B-Instruct
pipeline_tag: text-generation
---

# ๐Ÿ‡ฎ๐Ÿ‡ณ IndraCoder โ€” AI Coding Assistant

A fine-tuned coding LLM built on **Qwen2.5-Coder-1.5B-Instruct**, trained on 4 curated datasets for code generation, debugging, algorithmic reasoning, and agentic tool use.

## โœจ Highlights

- ๐Ÿง  **Chain-of-thought reasoning** โ€” Uses `<think>` blocks to reason before coding
- ๐Ÿ”ง **Full-stack development** โ€” Python, JavaScript, TypeScript, React, FastAPI, and more
- ๐Ÿ› ๏ธ **Tool/function calling** โ€” Trained on agentic tool-use patterns
- ๐Ÿ“ฆ **Lightweight** โ€” 1.5B parameters, runs on consumer GPUs

## Quick Start

```python
from transformers import AutoModelForCausalLM, AutoTokenizer

model = AutoModelForCausalLM.from_pretrained("RockySinghRajput/Indracoder", torch_dtype="auto", device_map="auto")
tokenizer = AutoTokenizer.from_pretrained("RockySinghRajput/Indracoder")

messages = [
    {"role": "system", "content": "You are IndraCoder, an expert AI coding assistant."},
    {"role": "user", "content": "Write a Python function to find the longest palindromic substring."}
]

text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer([text], return_tensors="pt").to(model.device)

output = model.generate(inputs.input_ids, max_new_tokens=512, temperature=0.7, top_p=0.9)
print(tokenizer.decode(output[0][len(inputs.input_ids[0]):], skip_special_tokens=True))
```

## Model Details

| Property | Value |
|----------|-------|
| **Base Model** | [Qwen/Qwen2.5-Coder-1.5B-Instruct](https://huggingface.co/Qwen/Qwen2.5-Coder-1.5B-Instruct) |
| **Parameters** | 1.5B |
| **Type** | Causal Language Model (merged LoRA fine-tune) |
| **Language** | English |
| **License** | Apache 2.0 |
| **Developed by** | [RockySinghRajput](https://huggingface.co/RockySinghRajput) |

## Training Details

### Training Data

Fine-tuned on **4 curated datasets** (~8,000 samples):

| Dataset | Purpose | Samples |
|---------|---------|---------|
| [glaive-code-assistant-v3](https://huggingface.co/datasets/glaiveai/glaive-code-assistant-v3) | General code generation & debugging | ~2,000 |
| [evol-codealpaca-v1](https://huggingface.co/datasets/theblackcat102/evol-codealpaca-v1) | Hard algorithmic problems | ~2,000 |
| [CodeFeedback-Filtered](https://huggingface.co/datasets/m-a-p/CodeFeedback-Filtered-Instruction) | Code reasoning & explanations | ~2,000 |
| [glaive-function-calling-v2](https://huggingface.co/datasets/glaiveai/glaive-function-calling-v2) | Agentic tool/function calling | ~2,000 |

### Training Procedure

- **Method**: LoRA (Low-Rank Adaptation) โ†’ merged into base model
- **LoRA Config**: r=16, alpha=16, dropout=0.05
- **Target Modules**: q_proj, k_proj, v_proj, o_proj
- **Epochs**: 1
- **Batch Size**: 1 (gradient accumulation: 4, effective batch: 4)
- **Learning Rate**: 1e-4 (cosine schedule)
- **Optimizer**: paged_adamw_8bit
- **Sequence Length**: 512 tokens
- **Precision**: FP16 mixed precision
- **Quantization**: 4-bit NF4 (QLoRA) during training

### Compute Infrastructure

- **Hardware**: NVIDIA T4 GPU
- **Training Time**: ~1 hour

## Capabilities

### โœ… What IndraCoder Can Do

- **Write code** in Python, JavaScript, TypeScript, Java, C++, Go, Rust
- **Debug code** โ€” find and fix bugs with explanations
- **Explain code** โ€” break down complex code step by step
- **Algorithm design** โ€” data structures, dynamic programming, graphs
- **Full-stack development** โ€” React, FastAPI, Express, databases
- **Tool/function calling** โ€” structured function calls for agentic workflows

### โš ๏ธ Limitations

- **1.5B model** โ€” smaller than GPT-4, Claude, or larger open-source models
- **Not suitable** for complex multi-file refactoring or very long code generation
- **English only** โ€” not trained on multilingual data
- **No image/file understanding** โ€” text-only model
- **May hallucinate** โ€” always review generated code before using in production

### โŒ Out-of-Scope Use

- Production code without human review
- Security-critical applications without expert validation
- Medical, legal, or financial advice
- Generating malicious code or exploits

## Evaluation

Tested on 4 qualitative benchmarks:

| Test | Task | Result |
|------|------|--------|
| Full-Stack | REST API with auth in FastAPI | โœ… Generates working code |
| Algorithm | Implement LRU Cache O(1) | โœ… Correct approach |
| Debug | Fix React infinite re-render | โœ… Identifies useEffect issue |
| Tool Use | Chain function calls for file analysis | โœ… Correct tool selection |

> **Note**: These are qualitative assessments, not standardized benchmarks.

## Citation

```bibtex
@misc{indracoder2025,
  title={IndraCoder: A Fine-tuned Coding LLM},
  author={RockySinghRajput},
  year={2025},
  publisher={HuggingFace},
  url={https://huggingface.co/RockySinghRajput/Indracoder}
}
```

## Contact

- **HuggingFace**: [RockySinghRajput](https://huggingface.co/RockySinghRajput)